Learn how to monitor your TrueFoundry AI Gateway using Prometheus metrics and Grafana dashboards for performance, cost, and usage insights.
The tfy-llm-gateway provides detailed, Prometheus-compatible metrics to monitor the health, performance, and cost of your LLM applications with Grafana.
You will be able to export metrics only if the AI Gateway is hosted on your end.
The AI Gateway exposes a /metrics endpoint that can be scraped by your Prometheus instance. This is the standard way to collect metrics.Alternatively, if your setup uses an OpenTelemetry Collector, you can configure the AI Gateway to push metrics directly. To do this, set the following environment variables for the tfy-llm-gateway service:
ENABLE_OTEL_METRICS: Set to "true".
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: The endpoint of your OTEL metrics exporter.
OTEL_EXPORTER_OTLP_METRICS_HEADERS: (Optional) Headers for authentication.
Complexity-based routing classification decisions. decided_tier is the classified tier, resolved_tier the tier actually attempted — they differ when the request escalated.
model_name, tenant_name, decided_tier, resolved_tier, cause
Our pre-built Grafana dashboard helps you monitor the LLM Gateway. It is organized into several views so you can analyze gateway activity from different perspectives.
The pre-built dashboard includes filters for model_name, tenant_name, and username. If you use custom metadata labels (via LLM_GATEWAY_METADATA_LOGGING_KEYS), you can add them as filters to your dashboard for more granular analysis.