LiteLLM Prometheus metrics and monitoring

LiteLLM exposes spend, request and budget metrics on a /metrics endpoint that Prometheus can scrape. This page explains which metrics to use, how to enable them, and which labels to keep under control.

On this page

How LiteLLM Prometheus metrics show spend, traffic and budget health

A shared LiteLLM gateway serving several teams can answer spend and rate questions only when the platform team has data to query. LiteLLM exposes a /metrics endpoint for Prometheus once prometheus is added to callbacks in litellm_settings, so the proxy produces this data without a separate exporter. Without it, questions such as which team drove last month's spend on a given model tend to be answered from invoices after the fact, and rate-limit complaints arrive before anyone can see the traffic behind them. The metrics turn those questions into queries that run during the month, while spend can still be adjusted. This section covers what the gateway exports, who should own the work, and where Prometheus is the wrong tool.

Most teams start with three things: spend, request volume and budget headroom. The litellm_spend_metric metric tracks total spend and carries labels for end user, hashed API key, key alias, model, team and user, which is enough to break cost down by team or model on a dashboard. For request volume, use litellm_proxy_total_requests_metric. LiteLLM marks the older litellm_requests_metric as deprecated in favor of it, so any dashboard built on the old name will need migrating. Budget remaining is less straightforward. The litellm_provider_remaining_budget_metric appears only when provider budget routing is configured, so if you plan alerts on it, confirm it appears in the /metrics output of your release before you write the rule.

In a self-hosted setup, the platform team owns the monitoring stack: the proxy's callback configuration, the Prometheus server that scrapes /metrics, retention, alert rules and dashboards. Each application team owns the keys and budgets allocated to it and should agree on the alert thresholds that apply to them. Finance or a cost owner should decide how spend is attributed, because the team and key alias labels only help if keys are named consistently. Prometheus is licensed under Apache-2.0 and has no paid edition, so the cost sits in infrastructure, storage, implementation and the people who run it. Its local storage is not clustered or replicated and keeps data for 15 days by default, so decide early whether longer history goes to external storage through remote write, and who restores the server if it fails.

Prometheus values reliability over precision and is not a suitable source for per-request billing. Use LiteLLM's own spend records for chargeback and invoices, and use Prometheus for trends, anomaly alerts and early warning when a team approaches its limit. The label set needs the same care. The spend metric includes end user and hashed API key labels, and each distinct value creates another time series. On a gateway with many end users, keep end user out of the dashboards and alert rules that everyone reads, and check the series count after the first scrapes. Before go-live, ask the team running the gateway for a sample of the /metrics output from a test environment with the callback enabled, so metric names and labels are confirmed, not assumed.

Which LiteLLM metric answers which monitoring question

This table maps each supplied LiteLLM Prometheus metric to the monitoring question it answers, the labels that make it useful, and the condition that must hold before it appears. Use it to choose which series to chart and alert on, and to avoid relying on a deprecated name. Confirm exact names and labels against the version you run before building dashboards.

MetricQuestion it answersLabels that matterCondition for it to exist
litellm_spend_metricHow much money is each team, user, key or model consuming over time?End user, hashed API key, key alias, model, team, userPrometheus callback enabled in litellm_settings and the gateway is recording spend
litellm_proxy_total_requests_metricHow many requests is the proxy handling, and which keys, teams or models generate them?Request labels for key, team, user and model as exposed by the running versionPrometheus callback enabled; this is the current successor to the deprecated request counter
litellm_requests_metricLegacy request count, kept only so existing dashboards keep working during a migrationConfirm the label set in your version before reusing old queriesPresent in older releases; marked deprecated in favour of litellm_proxy_total_requests_metric, so plan to retire it
litellm_provider_remaining_budget_metricHow much budget remains for each upstream provider before routing changes?Provider and budget-related labels as exposed by the running versionAppears only when provider budget routing is configured on the router
Metric names in generalAre the names and labels in my dashboards and alerts still correct for this release?Not applicableConfirm each name against the /metrics output of the running LiteLLM version before you write alert rules

How Prometheus pulls LiteLLM metrics from the gateway

Prometheus does not wait for LiteLLM to send its numbers. It makes HTTP requests to the gateway's /metrics endpoint on a fixed schedule, stores each sample as a time series, and answers questions about those series with PromQL. On the LiteLLM side, the endpoint appears once you add prometheus to the callbacks in litellm_settings. The prometheus_client package is preinstalled in the LiteLLM Docker image, so you do not add it yourself when you run that image. Confirm that the image tag you deploy includes it, because a custom build may not.

The scrape target depends on where the proxy runs. In Kubernetes, Prometheus usually discovers proxy pods or their service endpoints and reaches the metrics port over the cluster network, so the first check is that the Prometheus pod can open a connection to each proxy on that port and that network policies allow it. On virtual machines, targets are often listed statically or found through a cloud or file-based discovery mechanism. Whichever you choose, confirm the network path, and confirm whether your LiteLLM version exposes /metrics without credentials so you know how to restrict it at the network layer.

Each proxy instance should be its own scrape target. Every process keeps its own in-memory counters and gauges, so when several instances run behind a load balancer, scraping the shared address would return a different instance on each attempt and the series would appear to jump. Scraping each instance directly gives every series an instance label, lets you see one instance falling behind, and makes counter resets from restarts visible. Use rate() or increase() on counters so that a restart does not look like a drop in spend. Prometheus values reliability over precision, so treat these series as operational signals, not as an exact per-request bill.

Pull fits the LiteLLM proxy because it is a long-running service that stays up long enough to be scraped on every interval. Short-lived jobs are different: a batch process that exits before the next scrape cannot be sampled, so it pushes its metrics to a Pushgateway, which Prometheus then scrapes. Do not route proxy metrics through a Pushgateway just because the proxy sits behind other infrastructure. After deployment, check that each proxy instance appears as an up target in Prometheus, and set an alert for a target that stops responding so a silent gap in spend data does not go unnoticed.

Enabling the Prometheus callback and scraping the gateway

This sequence turns on the LiteLLM Prometheus callback, exposes the proxy's /metrics endpoint, and confirms that Prometheus scrapes every proxy instance and stores the expected series. Each step closes with a check, so the team knows whether to continue or roll back.

  1. Confirm the endpoint and release in the docs

    The platform owner checks the LiteLLM Prometheus documentation for the release in use, because the endpoint path, metric names and label sets can change between versions. Record the running proxy version, the metrics path and the metric names the team expects to see in the change ticket. Done when the documented path and metric names are written down and match the version under test.

  2. Add prometheus to the callbacks

    The proxy owner edits the proxy configuration file and adds prometheus to the callbacks list under litellm_settings, keeping any existing callbacks in place. The change goes through the same review and version control as other gateway configuration. The master key and provider credentials stay in the secret manager and out of this file. Done when the configuration diff shows only the intended callback change and passes review.

  3. Restart or redeploy the proxy

    The platform team restarts the proxy process or rolls the deployment so every instance loads the new configuration. On Kubernetes, roll the change out across the deployment and confirm that all pods report ready. Read the startup logs for errors about the callback or the prometheus_client package, which ships in the LiteLLM Docker image, so a configuration problem surfaces during startup. Done when all instances are ready and the logs show no callback errors.

  4. Confirm the metrics endpoint responds

    From a host that can reach each proxy instance directly, request the metrics path with curl and confirm an HTTP 200 response with Prometheus text exposition lines. Repeat this for every instance, not only the service address, because a load balancer can hide an instance that is not exposing the endpoint. If the response or access behavior differs from the documentation for your release, stop and resolve it before changing the scrape job. Done when every instance returns metrics.

  5. Add a scrape job for each instance

    The monitoring owner adds a scrape job to the Prometheus configuration with one target per LiteLLM proxy instance, using the path confirmed in the previous step. Use service discovery if the platform provides it, or a static list of instance addresses if it does not. Set the scrape interval to match the team's operating needs, reload Prometheus, and open the Targets page. Done when every target shows as up with a recent last scrape.

  6. Send a test request and query the series

    Send one test request through a virtual key to a model the gateway serves, preferably a low-cost model, then run a PromQL query for litellm_spend_metric in the Prometheus expression browser. Filter by a test key alias or model label so the result is easy to read, and confirm the series appears and its value changes after the request. Query the request metric your release documents, and check that its labels match the documented set. Done when the expected series return values for the test traffic, which confirms the pipeline end to end.

Which labels to keep under control in LiteLLM metrics

Every distinct combination of label values creates its own time series in Prometheus, so the cost of a label depends on how many distinct values it takes. On a LiteLLM gateway, end user, hashed API key, key alias, user and team are the labels most likely to grow out of control, because they follow the population of people and keys using the gateway rather than the number of things you operate. litellm_spend_metric carries several of these at once, so its series count is driven by the combinations of their values, not by any single label. Before you write dashboards, confirm the exact label set for each metric in your LiteLLM version against the Prometheus metrics documentation.

Start by deciding which questions your dashboards and alerts must answer. A finance view of spend usually needs team and model. An on-call alert about a runaway key may need key alias. A per-end-user breakdown is rarely needed as a live metric, and if your privacy or chargeback process requires it, answer that question from the spend log in the database. Write the agreed list down with its owner, and treat every other label as a candidate for removal. Review the list with finance, platform and security together, since each group tends to ask for a different breakdown.

Enforce the list in two places. At scrape time, use metric_relabel_configs in the Prometheus scrape job to drop labels that are not on the list. Dropping a label merges series that differed only in that label, so test the change in a non-production environment first to catch collisions. For dashboards and long-range views, create recording rules that pre-aggregate by the approved labels, such as team and model. Raw series remain in local storage for the configured retention, which defaults to 15 days, so the recording rules are what keep long-term views small and fast.

Illustrative example: a team-by-model breakdown produces one series for each combination of a team and a model that team uses, so growth follows the number of teams and models. A per-end-user breakdown adds a dimension sized by the number of people who call the gateway, and that number grows with every onboarding. Both views can answer useful questions, but only the first is a sensible default for a live dashboard. The second belongs in a report generated from stored logs.

Review the series count after the rollout and again after each LiteLLM upgrade, because new releases can add labels or metrics. Also review it when a large new team or a new model provider is onboarded. Set an alert on sustained growth in series for the LiteLLM metric names so the team hears about a problem before storage fills. Remember that Prometheus favors reliability over precision and is not suited to per-request billing, so use the spend log and the budget features for chargeback and treat Prometheus as the operational view.

Protecting the metrics endpoint and the data it exposes

The /metrics endpoint is a read path into your gateway's usage data, so it needs the same care as the proxy's admin interface. The cards below cover who can reach the endpoint, what the labels reveal, where the master key must stay out of view, what Prometheus expects from its deployment, and how query UIs are controlled. Confirm each item against your own ingress and network layout before go-live.

Restrict network access to /metrics

Limit which sources can reach the /metrics path on each LiteLLM proxy to the Prometheus servers that scrape it. In a Kubernetes deployment, this usually means a network policy or firewall rule that admits only the Prometheus pods or host addresses, and it should not depend on the ingress that serves user traffic. Check whether your ingress routes /metrics along with the API paths, because a path rule that works for API traffic can expose metrics to every caller. Test from a non-allowed source and confirm the request is refused.

Label values reveal internal structure

The spend metric carries labels such as team, user, end user, model, hashed API key and key alias. A hashed key is still a stable identifier, and aliases often spell out team names, projects or environments, so anyone who reads the series can map your internal structure and usage patterns. Decide which labels Prometheus stores, drop the ones you do not need at relabeling time, and confirm in the LiteLLM Prometheus docs which labels your version emits before you build dashboards.

Keep the master key out of scrape configuration

Prometheus scrape configuration, dashboard JSON and exported panels are often copied between teams and stored in version control. If a scrape job or bearer token header carries LITELLM_MASTER_KEY, which must start with sk-, that credential spreads to everyone who can read those files. Keep the key in your secret manager, supply it to Prometheus at runtime if authentication is needed, and scan configuration repositories for the sk- prefix before each merge.

Apply Prometheus security guidance

Prometheus's security model assumes the operator controls the network around the server and its scrape targets. Recent releases can enable TLS and basic authentication through a web configuration file, but confirm which options your version supports on the current security model page. Decide which controls supply authentication and encryption in your setup, including any reverse proxy in front of the endpoint, and confirm how your proxy is exposed behind your ingress before you treat the endpoint as internal.

Control access to Grafana and query UIs

Grafana and any other PromQL query interface can return the same label values to people who never use the proxy directly. Map the Grafana roles you use to the teams allowed to see spend by team or key, restrict data source edit rights to the platform team, and confirm whether dashboards can be shared through public links or embedded panels. Recheck these settings after each Grafana upgrade and after adding a new data source.

Where gateway metrics are stored and how alerts get routed

Decide where gateway metrics live before you build alerts on them, because alert history depends on how long Prometheus keeps its data. Prometheus writes scraped samples to a local time series database organized into two-hour blocks, with a write-ahead log that protects recent samples before they are compacted into blocks. The default retention is 15 days, and you can configure retention by time or by size. Fifteen days is a default, not a retention decision. Check it against how far back your spend reviews, budget investigations and incident reviews need to look, and confirm the chosen limits in your deployment configuration before go-live.

Local storage is not clustered or replicated, and Prometheus documentation says to manage it like any other single-node database. If the node or its disk fails, the history stored on it is lost with it. That makes two decisions for the platform owner. The first is how long data stays on local disk, sized against the volume of LiteLLM series you expect. The second is whether to configure remote write to a long-term storage system, which Prometheus supports through its remote write and remote read protocols. Ask who operates that system, who controls access to gateway metrics, and how Prometheus behaves if the remote endpoint is unavailable. Also decide whether a second Prometheus instance is part of the design, since duplicate scraping is a deliberate choice you must plan and test.

Alertmanager receives alerts from Prometheus and controls how they reach people. Grouping combines related alerts into one notification, inhibition suppresses dependent alerts while a higher-severity alert is firing, and silences cover planned maintenance or known noise. These settings decide whether an on-call engineer gets one clear page or a flood of duplicates, so write the routing tree with the gateway's owners before the first rule ships. For high availability, Alertmanager can run as a cluster configured through its --cluster flags. Point Prometheus at every Alertmanager instance directly, not through a load balancer in front of them, so that each instance receives alerts and the cluster can group and deduplicate notifications. Test this with one instance stopped during a drill.

Spend alerts need to account for a known delay. LiteLLM recommends batching spend updates to the database every 60 seconds at scale, so spend dashboards and any queries built on that data can trail real usage by about that long. Prometheus is designed to favor reliability over precision and is not suited to per-request billing, so treat spend metrics as signals for alerting and not as the accounting record. Set budget alert thresholds with headroom for that lag, so a warning fires while there is still time to act on the key or team involved. In a non-production environment, run an illustrative test with a low budget and measure how long the alert takes to fire after the threshold is crossed.

Where Prometheus metrics fall short and what to confirm

Prometheus gives this gateway useful operational visibility, but several metrics carry limits that matter for spend reporting, dashboards and version planning. Each card names one limit and the check to run before you rely on the numbers. Read them together before you set budgets or alerts on LiteLLM metrics.

Reliability over precision

The Prometheus project values reliability over precision and says it is not a good choice where 100% accuracy is required, such as per-request billing. Scrape gaps, restarts and delayed collection can leave counter totals short of the true figure. Treat metric-based spend as operational visibility, and ask your finance team which system is authoritative for chargeback and invoicing.

Deprecated requests metric

LiteLLM marks litellm_requests_metric as deprecated in favor of litellm_proxy_total_requests_metric. Any dashboard, alert or recording rule that queries the old name may show flat lines or stop firing after you switch. Search your Grafana panels and Prometheus rules for the old name, move them to the new metric, and compare both series over a period before you retire the old panels.

Conditional provider budget metric

The litellm_provider_remaining_budget_metric appears only when provider budget routing is configured. A dashboard built on it shows no data in an environment without that routing, which can look like a monitoring fault. Confirm in your gateway configuration whether provider budget routing is enabled, and alert on the metric's absence only in environments where you expect it to exist.

Prometheus release lines

The latest Prometheus release is v3.15.0, published September 25, 2026. The current long-term support line is 3.13, supported until July 31, 2027, and LTS 3.5 reached end of life on July 31, 2026. A new minor release cycle begins every six weeks, and a minor release generally stops receiving bug fixes after those six weeks, so a non-LTS server needs a planned upgrade cadence.

Confirm both release versions

Record the exact Prometheus server version and the LiteLLM release your environment runs before you compare metric names or plan an upgrade. The latest LiteLLM release listed on GitHub as of October 2026 is v1.105.1, published October 14, 2026, but the version you deploy is the one that counts. LiteLLM maintains support for the four most recent stable minor versions, so confirm your release is still inside that window.

Reconcile spend against the database

Compare litellm_spend_metric totals with spend recorded in the PostgreSQL database that backs the gateway before you use either source for reporting or budget decisions. Metrics show trends and break spend down by team, key alias and model, while the database holds the record your finance process can audit. LiteLLM batches spend updates to the database every 60 seconds at scale, so compare over time windows, schedule periodic reconciliation, and document the tolerance you accept between the two.

What LiteLLM Prometheus monitoring costs and what it takes to run

How much does Prometheus monitoring for LiteLLM cost to run?

Prometheus carries no license fee. It is Apache-2.0 licensed and has no paid enterprise edition, so your cost comes from four places: compute and storage for the Prometheus server, any external long-term storage you add, the one-time implementation work, and the staff who operate it.

One-time: enabling the LiteLLM callback, building dashboards, writing alert rules and documenting a runbook. Recurring: server and storage infrastructure, upgrades, alert tuning, dashboard maintenance and on-call time.

The largest cost drivers are the number of proxy instances, how many label combinations you keep, and how long you retain data. Ask any quote to list fixed-scope deliverables separately from ongoing support, and to state the storage and retention assumptions it uses. The final figure depends on your environment, so confirm it against your own infrastructure costs and staffing.

How long does it take to set up LiteLLM Prometheus monitoring?

The duration depends mainly on scope and access, not on the configuration change itself. Adding prometheus to the callbacks in litellm_settings and checking the /metrics endpoint is the small part of the work.

The time grows with:

  • the number of LiteLLM instances and workers to scrape
  • whether targets are found by service discovery or configured by hand
  • how long security and network approvals take
  • how many dashboards and alert rules you require
  • how Alertmanager routes alerts to your paging and ticketing tools
  • the retention and remote storage design

Ask for the duration in the written scope, with milestones and the assumptions behind each one. A timeline that does not list its assumptions is hard to check.

What must our team provide before monitoring work starts?

Four inputs decide whether the work can start on schedule:

  • Cluster or host access with rights to view the LiteLLM deployment and change Prometheus scrape configuration.
  • Network paths from Prometheus to each LiteLLM instance on its metrics port, and from Prometheus to every Alertmanager instance.
  • Named owners for Grafana dashboards and Alertmanager routing, including who approves changes and who receives and acts on alerts.
  • Label decisions. litellm_spend_metric carries labels for end user, hashed API key, key alias, model, team and user. Each unique combination creates a separate time series, so you must decide which labels you need and which ones stay out of Prometheus.

Also confirm where the Prometheus server runs, how much disk it has, and who patches it.

Can our internal platform team set up LiteLLM monitoring alone?

Often yes for the basic callback, if the team already runs Prometheus and Grafana and has experience with Kubernetes or virtual machines. The Prometheus client library is preinstalled in the LiteLLM Docker image, so the first step is a configuration change.

Gaps usually appear in four places: label cardinality planning, choosing which metrics answer which questions, alert design, and the handoff to on-call staff. Prometheus documentation says it values reliability over precision and is not suited to requirements for 100% accuracy, such as per-request billing. Billing therefore needs LiteLLM's own spend records, and deciding that boundary takes judgment.

Check whether anyone has run a multi-instance LiteLLM proxy and whether you have capacity for upkeep. Note that litellm_requests_metric is deprecated in favor of litellm_proxy_total_requests_metric.

How long should we keep LiteLLM metrics in Prometheus?

Local Prometheus storage keeps data for 15 days by default, and you can configure retention by time or by size. Use that default as a starting point, then adjust it to the questions you need to answer, such as monthly spend trends, budget reviews and capacity planning.

Local storage is not clustered or replicated. Treat the Prometheus server like any other single-node database, with backups or a rebuild plan, because losing the server loses its history.

For longer retention, use remote write to send samples to an external long-term storage system. You must choose, run and pay for that system. Keep formal spend reporting tied to LiteLLM's records, and ask your team to confirm retention requirements with finance and compliance owners before setting them.

Does LiteLLM Enterprise change how Prometheus monitoring works?

The Prometheus side does not change. Prometheus stays under Apache-2.0, and the metrics come from the proxy. LiteLLM Enterprise changes the controls around the gateway instead.

Enterprise adds audit logs, SSO and SCIM beyond the free limit, organization and team RBAC, and secret manager integrations. These affect who can view and change keys and teams, and how identities map to the labels you chose. From v1.76.0, SSO is free for up to 5 users, and an Enterprise license is needed beyond that.

Enterprise support includes a dedicated engineering channel and optional 24/7 SLAs, with a 1 hour response for critical issues and 72 hours for security patches. Confirm with LiteLLM whether any monitoring feature in your version depends on the license.

Which LiteLLM Prometheus metrics should we alert on first?

Start from the decisions each alert supports, not from every metric the endpoint exposes. Candidate signals include request volume through litellm_proxy_total_requests_metric, spend through litellm_spend_metric, and remaining provider budget through litellm_provider_remaining_budget_metric. The last one appears only when provider budget routing is configured.

Before writing rules, check the exact names and labels in the /metrics output of your LiteLLM version. Set thresholds from your own baseline, not from a generic number.

Alertmanager then needs routing to named owners, grouping, silences and inhibition rules. It can run as a cluster for high availability through its cluster flags. Prometheus should send alerts to every Alertmanager instance directly, with no load balancer in between.

How DeployOpen scopes and supports LiteLLM monitoring

DeployOpen scopes LiteLLM monitoring around the gateway's /metrics endpoint, the Prometheus callback that exposes spend, request and budget metrics from your own proxy. We build the scrape, label and storage setup inside your infrastructure, then document and hand it over to your team. Engagements are fixed-scope, with ongoing support available as a retainer.

How we scope

  • Written scope listing the LiteLLM metrics to expose, such as spend, request and budget series
  • Agreed label policy for spend metrics, covering end user, hashed API key, key alias, model, team and user
  • Confirmation of the Prometheus version line, retention period and who owns the monitoring stack

How we build

  • Enabling prometheus in the litellm_settings callbacks and confirming the /metrics endpoint responds on the proxy
  • Scrape configuration for each proxy instance, using service discovery or static targets your platform already runs
  • Recording rules and alert rules tested against the metrics your scope names, with label cardinality reviewed

How we hand over

  • Runbook covering scrape targets, retention settings, and how to add or remove label dimensions safely
  • Notes on the deprecated litellm_requests_metric and its replacement, litellm_proxy_total_requests_metric
  • Documentation of Prometheus limits, including its reliability-first design and why per-request billing needs another record

How we support

  • Ongoing support available as a retainer for Prometheus upgrades, rule reviews and LiteLLM version changes
  • Review of Prometheus release and long-term support status before each planned upgrade of the monitoring stack
  • Alertmanager configured for grouping and silences, with every Alertmanager instance listed in Prometheus

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.