How do I export LLM spend metrics to Prometheus and Grafana?
A Prometheus metrics endpoint for month-to-date AI spend, requests, tokens, latency and budget utilisation, scrapeable into Prometheus, Grafana Cloud or any compatible tool. Growth plan and above.
GET /api/metrics/prometheus returns your AI spend in the Prometheus text
exposition format, so you can graph and alert on it next to the rest of your
infrastructure. Available on the Growth plan and above.
In the app, Control → Integrations → Prometheus metrics has the scrape config ready to copy and a Test endpoint button that calls the endpoint with your session and reports how many series it returned.
Scrape configuration
Metrics
| Metric | Type | Labels | Meaning |
|---|---|---|---|
cognocient_spend_usd_total | counter | provider, model, feature | Month-to-date spend in USD |
cognocient_requests_total | counter | provider, model, feature, status | Requests by HTTP status class (2xx, 4xx, 5xx) |
cognocient_tokens_total | counter | provider, model, feature, direction | Tokens, direction is prompt or completion |
cognocient_request_latency_ms_sum | counter | provider, model, feature, status | Total latency in ms; divide by requests for the mean |
cognocient_budget_used_ratio | gauge | budget, scope, mode | Budget spend divided by its monthly limit |
cognocient_budget_limit_usd | gauge | budget, scope, mode | Configured monthly limit |
Untagged calls appear with feature="unattributed".
Example alerts
Month-to-date, and bounded
Counters reset at the start of each UTC month, which Prometheus handles in
rate() and increase(). Series are capped at the 500 highest-spend
provider, model and feature combinations; the remainder is folded into
feature="__other__", so a tenant with thousands of tags cannot overwhelm a
scraper.
Frequently asked questions
Related articles
Budget Enforcement
Hard limits enforced at the proxy before charges reach your card.
Spend Groups
Named groups of people, managed in the app or pushed by your identity provider, that one budget caps together.
Alerts: Email & Slack
Budget-threshold and anomaly alerts by email (every plan) and Slack (Base+): defaults, recipients, quiet hours, hourly cap.