What LiteLLM Prometheus metrics show and when you need them
A platform team running a shared self-hosted LiteLLM gateway needs to see spend, traffic and budget consumption across teams without querying the database by hand. LiteLLM exposes a /metrics endpoint for Prometheus when you add prometheus to callbacks in litellm_settings, and that endpoint is the starting point for dashboards and alerts on the gateway itself. Use it when you need trends and thresholds: spend climbing for one team, request volume dropping after a routing change, or a provider budget nearing its limit. The metrics are aggregated time series, so they answer "how much and how fast" rather than "what happened to this request."
Keep the three data sources separate in your mind. Request logs describe individual calls, spend logs record cost per request in the database, and Prometheus holds sampled counters that are scraped at intervals and kept in a local time series store. Prometheus values reliability over precision and is not a good choice where 100% accuracy is required, such as per-request billing. Treat the spend log and the provider invoices as the system of record for chargeback, and treat Prometheus as the early warning layer that tells you when to look. Confirm with your finance team which source they will reconcile against before any dashboard is shown to them as a bill.
Before you rely on these metrics, decide who owns the scrape, the retention and the alerts. Prometheus stores data locally by default with a 15-day retention, and its storage is not clustered or replicated, so a single instance needs the same care as any other database. Confirm the metric names against the version you run, because LiteLLM has marked litellm_requests_metric as deprecated in favour of litellm_proxy_total_requests_metric. Ask the LiteLLM vendor documentation and your own test environment which metrics appear in your release, and check the LiteLLM Prometheus metrics documentation before writing alert rules against them.
Which metric families and settings fit which monitoring goal
This table compares the LiteLLM Prometheus metric families and the callback setting that enables them, with the labels each one carries. Read each row against the question you need answered, such as spend by team, request health, or provider budget headroom. The main takeaway is that the spend metric carries the most identifying labels, so keep high-cardinality labels deliberate.
| Setting or metric | What it answers | Labels and guidance |
|---|---|---|
| prometheus callback in litellm_settings | Whether the /metrics endpoint is exposed at all | Add prometheus to the callbacks list in litellm_settings. The prometheus_client package ships in the LiteLLM Docker image, so no extra install is needed for the endpoint. Confirm the setting in your deployed config before building dashboards. |
| litellm_spend_metric | Total spend over time for chargeback and budget tracking | Labels include end user, hashed API key, key alias, model, team and user. Keep team, model and key alias for reporting. Treat end user and hashed API key as high cardinality and enable them only when you need them. |
| litellm_proxy_total_requests_metric | Request volume and success or failure trends across the gateway | Replaces the deprecated litellm_requests_metric. Migrate existing dashboards and alert rules to this name. Confirm its label set in your version before writing alerts that depend on specific labels. |
| litellm_requests_metric | Legacy request counts in older dashboards | Marked deprecated by LiteLLM. Use only while migrating old dashboards, then remove references so they do not drive new alerts. |
| litellm_provider_remaining_budget_metric | Remaining budget at each upstream provider | Emitted only when provider budget routing is configured. If you do not use provider budget routing, expect no series and do not build a panel that depends on it. |
| End user and user labels | Attribution of traffic to individuals | Highest cardinality and most personal-data sensitive. Prefer team-level aggregation for dashboards. Review retention and access before enabling these labels in a shared Prometheus. |
| Hashed API key and key alias labels | Attribution to a virtual key | Use the key alias for human-readable grouping. The hashed key distinguishes keys with the same alias. Each new key adds a new series, so plan for key churn. |
| Model and team labels | Cost and usage by model and by team | Usually the most useful balance of insight and cardinality. Keep these as the default labels for FinOps and capacity views. |
How to enable the Prometheus callback and scrape the gateway
This sequence turns on LiteLLM's Prometheus callback, exposes the /metrics endpoint on every proxy instance, and confirms that Prometheus collects the series so dashboards and alerts have data to work from.
Confirm the proxy image and configuration
The platform engineer confirms which LiteLLM image and version the gateway runs, and opens the proxy configuration file that holds litellm_settings. The prometheus_client package is preinstalled in the LiteLLM Docker image, so no separate install is needed for a standard image. If the team builds a custom image, it should confirm that prometheus_client is still present in the final layer. Done when the image tag and the config file location are recorded in the change ticket.
Add prometheus to the callbacks
The engineer adds prometheus to the callbacks list under litellm_settings in the proxy configuration, then rolls the change out through the normal deployment path. This setting is what makes the proxy register its Prometheus metrics and serve them on /metrics. Keep the change in version-controlled configuration so it survives redeployments. Done when the rendered configuration in the running pods shows prometheus in the callbacks list.
Expose metrics on each proxy instance
The platform team makes sure the /metrics endpoint is reachable on every proxy instance that Prometheus must scrape, which means the port the proxy listens on and any network policy or service rule between Prometheus and the gateway. Scrapes should reach the instance directly, not only through a load-balanced service address, because a load balancer hides which replica answered. Done when the team has a list of every instance address Prometheus will target.
Test the endpoint with curl
From a host that can reach the gateway, the engineer runs curl against the /metrics path of one instance and checks that the response is plain Prometheus text. The engineer then searches the output for the expected names, including litellm_spend_metric and litellm_proxy_total_requests_metric. If the request-count metric is missing, the engineer checks that no older configuration still expects litellm_requests_metric, which LiteLLM marks as deprecated. Done when the expected series names appear in the output of at least one instance.
Add scrape targets to Prometheus
The monitoring engineer adds the gateway addresses to the Prometheus configuration, either as static targets or through a service discovery mechanism such as Kubernetes pod discovery. With several replicas, every pod or instance needs its own target, because each process keeps its own metrics counters. The team records the job name so queries and alerts can filter on it. Done when the Prometheus targets page lists every gateway instance as up.
Verify series in PromQL
The engineer runs PromQL queries in the Prometheus expression browser, starting with a query on litellm_spend_metric and another on the request total, and confirms that series for each instance appear after a few test requests go through the gateway. The engineer also checks that the instance label distinguishes replicas, so that a single pod's traffic is not mistaken for the whole gateway. Done when test traffic produces visible, increasing values for each instance.
Confirm which budget metrics apply
The team checks whether provider budget routing is configured, since LiteLLM emits litellm_provider_remaining_budget_metric only in that case. If it is not configured, the engineer records that the metric is expected to be absent rather than treating the gap as a fault. The engineer also reviews the label list on each series and removes any label that carries high-cardinality values before dashboards are built. Done when the team has a written list of metrics present, metrics absent and the labels approved for use.
How metrics flow from LiteLLM pods to Prometheus and Alertmanager
The flow starts at each LiteLLM proxy instance, which exposes a /metrics endpoint once the prometheus callback is enabled. Prometheus pulls from those targets through service discovery or static configuration, and stores samples in its local time series database. Remote write is optional and forwards samples to external long-term storage. Prometheus sends alerts to every Alertmanager instance, not to a load balancer. Check that the metrics endpoint sits inside the trust boundary and that only Prometheus can reach it.
Each LiteLLM instance is scraped by Prometheus, which stores samples locally and sends alerts to every Alertmanager.
Keeping label cardinality under control
Labels that identify a person or a key are the main source of growth. Hashed API key, key alias, end user and user each create a new series for every distinct value, combined with the other labels on a metric. These values follow the number of people, teams and integrations in your organization, so the series count rises as adoption spreads and as keys are regenerated. Keep these labels only when a specific question needs them and the spend or request logs cannot answer it.
- Hashed API key: Regenerating keys creates new series while the old ones age out, so churn adds cost even when headcount is flat.
- Key alias: Aliases are readable, but they are often created per project or per integration, so their count can grow faster than headcount.
- End user: Where applications pass end users through the gateway, this label can hold the largest number of distinct values.
- User: This label scales with onboarding and offboarding, so it changes as staff join and leave.
Before enabling any identity label on a shared gateway, count its distinct values in your deployment.
Model and team labels change slowly. A team list changes when the organization reorganizes, and the model list changes when you add or retire a provider route. The total number of series stays bounded by the models and teams in use, which makes these labels good candidates for shared dashboards and alerts. The trade-off is that they cannot show which person or key caused a cost spike, so they answer operational questions at the gateway level.
- Model: Supports comparison of latency, error rates and spend across providers and aligns with provider bills.
- Team: Supports budget alerts and chargeback-style views, provided team records are kept current.
- Combined use: Spend by model and team together usually stays manageable, but multiply the two lists before adding a third label.
- Alert design: Alert on model and team aggregates so a single noisy key does not trigger a separate alert for each key.
- Canonical names: Renamed teams create new series, so agree on the team name values with your platform team before dashboards depend on them.
List the distinct model and team values in your deployment and multiply them to estimate the worst-case series count for each metric.
Prometheus stores each unique label combination as its own series, so cost tracks series count more than sample volume. Its local storage keeps data in two-hour blocks with a write-ahead log, and the default retention is 15 days, configurable by time or size. High-cardinality labels raise memory use while series are active, enlarge the blocks on disk, and slow queries that group or filter across many series. Local storage is not clustered or replicated, so growth also affects backup and recovery planning for the server.
- Memory: Active series sit in memory, so a label with many values raises the memory the server needs before any query runs.
- Disk: Retention multiplies the series count, so a high-cardinality metric costs more disk over the retention window than a bounded one.
- Queries: A dashboard that sums across a label with thousands of values scans every matching series.
- Long-term storage: Remote write sends samples to external storage, whose sizing and pricing depend on series and sample volume, so confirm the model with that vendor.
- Accuracy: Prometheus favors reliability over precision and is not suited to per-request billing, so use LiteLLM spend records for exact chargeback.
Check the series count and disk usage of your Prometheus server after enabling the LiteLLM callback, and compare them with your sizing plan.
Prometheus lets you control labels at scrape time through relabeling rules in the scrape configuration. metric_relabel_configs runs after samples are scraped and before they are stored, so it can remove a label or drop a series before it reaches the time series database. Use it to strip identifying labels from metrics you keep, or to drop metrics you do not need. Relabeling reduces what Prometheus stores, but LiteLLM still produces those values on its /metrics endpoint.
- labeldrop: Removes a named label from matching series. Removing a label can make separate series collide, so check Prometheus logs for duplicate-sample errors after each change.
- drop action: Discards series whose metric name or label values match a regex, which suits high-cardinality end user values.
- labelkeep: Keeps only an allow list of labels, which holds up better than a deny list when new labels appear in later releases.
- Label names: Confirm the exact label names in your /metrics output for your LiteLLM version before writing rules, since names can change between releases.
- Attribution: Dropping labels at scrape time removes data from Prometheus only, so keep per-key attribution in the spend and request logs when you need it.
Test each relabel rule against a sample scrape and confirm the expected series remain before you roll it out.
A sane default keeps the labels that answer operational questions across the whole gateway and moves per-person questions to records built for them. An organization's people, keys and end users generally grow over time, so a policy that keeps identity labels will need revisiting as adoption spreads. Start with model and team on shared metrics, add identity labels only to a narrow set of metrics for a named investigation, and set a review point for any material change in teams, providers or proxy instances.
- Keep by default: Model and team on request, spend and latency metrics.
- Restrict: Hashed API key and end user on a separately scoped scrape, or leave them out of Prometheus entirely.
- Use records for people: Attribute spend and requests to individuals from the LiteLLM spend and request logs, which hold that detail.
- Measure before enabling: Capture series counts and disk growth during a pilot period you define, then compare them with your storage plan.
- Review on change: Revisit the label set when you add teams or providers, or when you run more than one proxy instance.
Ask your LiteLLM vendor or implementation partner to confirm which metrics carry which labels in your version before you finalize the relabel policy.
Security and operational risks of exposing gateway metrics
The /metrics endpoint reveals spend, usage and identity-linked labels about your gateway, and a single Prometheus server holds that data without replication. The four risks below cover who can reach the endpoint, what the labels disclose, how much history survives a failure, and where alerts go when Alertmanager runs more than one instance.
Unrestricted access to the metrics endpoint
The LiteLLM /metrics endpoint publishes spend, request counts and model usage for your gateway. Prometheus's security model describes network-level and authentication posture as the operator's responsibility, so the endpoint should be reachable only from the Prometheus servers and the monitoring network that scrapes it. Confirm that no ingress rule, load balancer path or service mesh route exposes the proxy's metrics port to callers or the public internet, and that the scrape path uses whatever authentication your platform enforces.
Labels that expose identities
The spend metric carries labels for end user, hashed API key, key alias, model, team and user. Key aliases and user identifiers can reveal who is consuming which model, which is sensitive in shared gateways and may matter for privacy reviews. Decide which labels Prometheus stores, drop or relabel the rest at scrape time, and confirm with your security team who may query dashboards that show per-person spend. Treat the label set as a data governance decision, not a default.
Metric loss on single-node storage
Prometheus stores data in a local time series database that is not clustered or replicated. If the node fails or its volume is lost, the spend and budget history held there is gone unless you have configured remote write to external long-term storage. Default local retention is 15 days. Do not treat Prometheus counters as a billing record, because Prometheus itself favors reliability over precision. Confirm the retention you need, the backup or remote write target, and who restores the volume.
Prometheus storage docsAlert routing across Alertmanager instances
Alertmanager handles grouping, inhibition and silences for alerts from Prometheus, and it can run as a cluster for high availability using its cluster flags. Prometheus must be configured to send alerts to every Alertmanager instance rather than through a load balancer, or alerts can be lost or duplicated. Check that each Alertmanager replica is listed in the Prometheus configuration, that cluster peering works, and that budget and error alerts reach an on-call route someone monitors.
Alertmanager docsHow long to keep LiteLLM metrics in Prometheus
Prometheus keeps metrics on the local disk of the server that scrapes them, so the retention period decides how far back your LiteLLM spend and request history can be queried. Prometheus writes samples into a local time series database organized into two-hour blocks, with a write-ahead log that protects recent data if the process stops. The default retention is 15 days, and you can set it by time or by size with the storage retention flags. Decide the window you need before go-live, because lowering it later deletes data that cannot be recovered from that server.
Local storage is not clustered or replicated. If the Prometheus server fails, the history it held is only as safe as its disk and backups, so treat it like any single-node database. Most teams that need months of spend or budget history add remote write to send samples to long-term storage, and keep a short local window for dashboards and alerts. Confirm with your storage vendor how it handles the label cardinality that LiteLLM produces, since per-key and per-user series multiply quickly. Check the Prometheus storage documentation before choosing the setup.
Size the disk from three drivers: the number of active series, the scrape interval, and the retention period. More labels such as end user, key alias or model create more series, and a shorter scrape interval stores more samples for each one. Measure your own series count in a test environment, then multiply it out for your retention window. Plan upgrades against the release cycle too: a new minor release appears every 6 weeks and stops receiving fixes after that, while the current LTS line (3.13) is supported until July 31, 2027, so schedule moves onto a supported line before that date.
Limits to confirm before you rely on these metrics
Several of the metrics on this page depend on your LiteLLM version, your routing configuration and the Prometheus line you run. Each card below is a check to complete before dashboards or alerts become the record for spend or budget decisions.
Metric names by version
The metric names you can scrape depend on the LiteLLM release you run, so the list in this guide is a starting point, not a contract. Compare the metric names your /metrics endpoint actually exposes against the release notes for your version before you write alert rules. Keep a record of the version next to each dashboard so a later upgrade does not silently break a panel.
Deprecated request counter
litellm_requests_metric is marked deprecated in favour of litellm_proxy_total_requests_metric. Dashboards and alerts built on the old name will stop receiving new data once the old series is removed. Migrate queries to the newer metric, run both side by side for a period, and confirm the replacement carries the labels your alerts filter on.
LiteLLM Prometheus docsProvider budget routing prerequisite
The provider remaining-budget metric, litellm_provider_remaining_budget_metric, only appears when provider budget routing is configured. A panel that shows no data is not evidence that the provider has unlimited budget. Confirm the routing configuration is in place in your deployment, then check that the series exists before you rely on it for a provider spend warning.
LiteLLM routing docsPrometheus is not a billing ledger
Prometheus favours reliability over precision and is not suited to workloads that need 100% accuracy, such as per-request billing. Counters can be affected by scrape gaps, restarts and retention limits, so spend totals from metrics may not match provider invoices. Use the gateway's spend records or provider billing exports for chargeback, and treat metrics as trend and alert signals.
Prometheus overviewPrometheus release support window
Prometheus minor releases receive bug fixes only for a limited period after their six-week cycle, and long-term support lines receive fixes for one year. Confirm which Prometheus line your monitoring stack runs and whether it is still inside its support window. Plan an upgrade before the line reaches end of life, because an unsupported monitoring server can fail quietly during a gateway incident.
Prometheus release cycleQuestions buyers ask about LiteLLM monitoring
What does it cost to monitor LiteLLM with Prometheus?
Prometheus itself is free to use. It is licensed under Apache-2.0 and has no paid enterprise edition, so the cost comes from four places: the servers or storage that run Prometheus and its retention, the implementation work to enable and tune the metrics, dashboards and alerts, and the people who operate the stack after go-live. Infrastructure and storage recur every month and grow with the number of series and the retention period. Implementation is usually one-time, with ongoing effort for alert tuning and upgrades. When you ask for a quote, ask for the components separately: the monitoring host or cluster resources, the retention and any remote write target, the dashboard and alert work, and the handover and support hours. Your Prometheus storage plan should also account for the fact that a single local Prometheus is not clustered or replicated.
How long does it take to set up LiteLLM metrics in Prometheus?
The LiteLLM side is a configuration change: adding prometheus to the callbacks in litellm_settings exposes a /metrics endpoint, and the prometheus_client package is already in the LiteLLM Docker image. The longer work depends on scope: how many gateway instances you run, whether your Prometheus already scrapes Kubernetes services, how many dashboards and alert rules you need, whether Alertmanager routing already exists, and whether you must send data to long-term storage. A single test instance with one scrape job can be checked quickly. A production rollout with label policy review, alert routing and sign-off takes longer. Ask any partner for a written timeline tied to these items rather than a generic duration.
What does our team need to provide for a LiteLLM monitoring setup?
Plan to provide the following before work starts:
- Cluster or host access with rights to change the Prometheus scrape configuration and the LiteLLM deployment configuration.
- Network policy that allows Prometheus to reach the gateway's /metrics endpoint and Alertmanager to receive alerts.
- Alertmanager routing: receivers, on-call paths and the teams that own each alert.
- A label policy that names which labels are allowed, such as model and team, and which must be dropped or hashed, since per-user and per-key labels can multiply series quickly.
- Decisions on retention, long-term storage and who receives dashboards.
- Named owners for acceptance testing and for the first few weeks of alert tuning.
Can our own team set up LiteLLM monitoring without a partner?
Yes, if your team already runs Prometheus and Alertmanager. The LiteLLM change is small, and the official documentation covers enabling the callback and the metric names. The skills that take more time are label design, cardinality control, PromQL for budget and spend alerts, and Alertmanager routing with inhibition and silences. Teams without that experience often find that the first version works but produces noisy alerts or high series counts. A partner is most useful for a scoped review of the design, a build of dashboards and alert rules, or a handover that leaves your team able to change them. Decide based on who will own the stack after go-live.
Can Prometheus replace LiteLLM spend logs for chargeback?
Not on its own. The litellm_spend_metric tracks total spend with labels such as team, user, key alias and model, which is useful for dashboards and budget alerts. However, Prometheus is designed to favor reliability over precision and the project itself says it is not a good choice where 100% accuracy is required, such as per-request billing. Scrapes can be missed, counters can reset on restarts, and retention is limited by default to 15 days unless you configure more. Chargeback and invoice reconciliation should use the spend records in the gateway database and be checked against provider bills. Use Prometheus for trends, alerts and near-real-time views, and confirm the exact spend fields with your LiteLLM version before building finance reports.
Which LiteLLM labels should we keep under control in Prometheus?
Keep labels that answer an operational question and drop or aggregate the rest. Labels such as model and team are usually stable and useful. The hashed API key and end user labels can grow with every key and user, which increases the number of time series Prometheus must store and query. Review the label set against the metrics LiteLLM emits in your version, and confirm which metrics are deprecated before you write dashboards. For example, litellm_requests_metric is marked deprecated in favor of litellm_proxy_total_requests_metric, and litellm_provider_remaining_budget_metric only appears when provider budget routing is configured. Write the label policy down and test it against a staging scrape before production.
Does exposing the LiteLLM /metrics endpoint create a security risk?
The endpoint can reveal operational detail such as model names, team and key aliases, and request volumes, so treat it as an internal interface. Restrict it with network policy so that only your Prometheus servers and approved scrapers can reach it, and do not expose it through a public ingress. Hashed key labels reduce direct exposure of key identifiers, but they still reveal patterns of use. Review the Prometheus security model with your security team, and confirm that the scrape path uses the transport and access controls your policy requires. Record the decision in your data classification for monitoring data.
How DeployOpen scopes monitoring for a LiteLLM gateway
DeployOpen scopes monitoring for a LiteLLM gateway as a written set of decisions before any configuration changes. The first decision is the metric set: which metrics from the proxy's Prometheus endpoint the monitoring will depend on, how the prometheus callback is enabled in litellm_settings, and which metrics are deprecated in the release line you run, so that dashboards and alerts are not built on a name that will disappear. The second is the label policy. Spend, request and budget metrics carry labels such as model, team, user, key alias and hashed API key, and each label multiplies the number of time series Prometheus must store. The agreed policy names which labels are kept, which are dropped or relabeled, and who approves a new one. The label list should be confirmed against the current LiteLLM Prometheus documentation for your version before it is fixed.
The second part of the scope covers collection, storage and alerting. DeployOpen plans the scrape configuration for every proxy instance in your environment, the retention period and size limits for the Prometheus server, and whether long-term storage through remote write is needed. Because Prometheus stores its local data on a single node without clustering or replication, the storage design also states how that node is backed up or rebuilt. Alert rules are written against the agreed metrics, with thresholds that your team confirms for spend, budget consumption and request health. Alert routing through Alertmanager is planned at the same time. Where the business needs exact per-request billing records, the scope says that Prometheus is not the source for them and that spend data comes from the gateway's own records.
Once the scope is agreed in writing, the work is fixed-scope: the metric set, label policy, scrape and storage design, alert rules and handover are priced from that document, and changes go through a written change request. Ongoing support, metric and label reviews after LiteLLM upgrades, and alert tuning are available as a retainer. Ask any monitoring partner, including DeployOpen, to state in the quote which metrics, labels, instances and alert rules are included, who owns the Prometheus host and its storage, and what happens when the LiteLLM release line or the Prometheus LTS line changes.
How DeployOpen works on this
DeployOpen plans and builds LiteLLM Prometheus monitoring inside infrastructure you control, starting from the metrics your gateway actually exposes and the labels your team can afford to keep. The work is fixed-scope, with deliverables and timelines agreed in writing before any change reaches your gateway or Prometheus servers.
How we scope
- We inventory the LiteLLM version, callbacks and metrics your gateway currently exposes on its /metrics endpoint.
- We agree which spend, request and budget questions the monitoring must answer, and who receives each one.
- We set the label policy in writing, listing which labels such as team or key alias are kept and which are dropped.
How we build
- We enable the Prometheus callback in your LiteLLM configuration and confirm the endpoint is scraped by your Prometheus setup.
- We write recording and alert rules against the spend and budget metrics, then test them with real traffic in a non-production environment.
- We size Prometheus storage and retention against your scrape interval and label cardinality, and document the chosen values.
How we hand over
- You receive the configuration, scrape targets, dashboards, alert rules and label policy as versioned files in your repository.
- You receive a runbook covering metric meanings, deprecated metrics and what to check when a series disappears after an upgrade.
- We walk your platform and finance team through the dashboards and alert routing so they can operate the setup without us.
How we support
- Ongoing support, upgrades and monitoring reviews are available as a retainer, scoped in writing.
- We review metric names and label sets again whenever you move to a new LiteLLM release line, so dashboards keep working.
- Retainer scope can include reviewing Prometheus release support status and planning upgrades before a line reaches end of life.

