Repository navigation
fix(monitoring): read AI spend from the gateway counter - #5924
Merged
Merged
Conversation
The spend panels of ai-spend.json take a gateway call from the gateway's spend counter litellm_spend_metric_total, and devops-cli's own spend series only for a call that did not go through the gateway. Hourly spend bars use increase([$__interval]) with a Min interval of 1h, the spend projections read the last 7 days, and the coverage stat shows the spend coverage. promtool cases in tests/fixtures/dashboard_queries/ai-spend.yaml hold the new queries.
dan-petty
marked this pull request as ready for review
November 16, 2026 02:44
Owner
Author
|
Vet: SAFE. The spend panels read |
dan-petty
pushed a commit
that referenced
this pull request
Nov 16, 2026
🤖 I have created a release *beep* *boop* --- ## [0.160.1](v0.160.0...v0.160.1) (2026-11-16) ### Bug Fixes * **monitoring:** read AI spend from the gateway counter ([#5924](#5924)) ([f391129](f391129)) * **telemetry:** a Job pod exports its metrics while it runs ([#5926](#5926)) ([00bfc49](00bfc49)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This was referenced Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The spend panels of
ai-spend.jsonreaddevops_cli_ai_spend_usd_total. A Job pod sends it a few times an hour, sorate([5m])missed it andrate([1h])drew spikes. For 6 h to 2026-11-16 02:00Z the panel gave $0.67 and the gateway counter $1.23.litellm_spend_metric_totalfor gateway calls anddevops_cli_ai_spend_usd_total{provider!="gateway"}for direct calls.increase([$__interval]), Min interval 1h. Projections read the last 7 days.tests/fixtures/dashboard_queries/ai-spend.yaml.The savings queries do not change (#5914, #5784). Request, token and slot-wait panels: #5922.
Closes #4724
Change:
openspec/changes/archive/2026-11-16-4724-spend-from-gateway-counter/