Repository navigation
fix(telemetry): review, findings and AI spend metrics reach Prometheus - #568
Merged
Merged
Conversation
The devops-cli and ai-spend dashboards queried review and findings metrics nothing emitted, and AI spend metrics only `devops server` exposed. Every metric was also sent as a gauge from a short-lived process, with the process id in its resource, so no counter or histogram could accumulate. Counters and histograms are now OTLP deltas from a per-host resource (service.instance.id is the host), and the collector's deltatocumulative processor keeps running totals before remote write. telemetry/instruments.py lists every metric sent. Reviews send their wall time and findings by persona, severity and status; AI calls count requests, prompt and completion tokens and spend by backend and model as they happen. Both dashboards read only sent metrics, checked by a test, and docs/TELEMETRY.md is generated from the list instead of naming metrics nothing emitted. Closes #564
This was referenced Sep 25, 2026
Merged
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.
Summary
Found while fixing #547. With telemetry reaching the collector, the
devops-cliandai-spenddashboards still showed nothing useful:devops_cli_review_duration_secondsanddevops_cli_findings_totalwere emitted nowhere.devops server's/metrics, which nothing scrapes.increase(devops_cli_command_total[1h])read a constant 1.Changes
Deltas (
telemetry/tracer.py):increment_countersends a monotonic delta sum;record_histogramsends a delta histogram;record_metricstays a gauge.Metrics carry a host resource:
service.instance.idis the host name, which Prometheus stores asinstance. There is no pid or version in it, so one host's commands add to one series.Collector (
k8s/otel/values.yaml): thedeltatocumulativeprocessor (max_stale: 1h) runs before remote write.telemetry/instruments.py: the one list of sent metrics, with kind, unit and description.docs/TELEMETRY.mdis generated from it; the old table named six metrics nothing emitted.Reviews send their wall time by target type, and their findings by persona, severity and status.
AI calls count, as they happen, by provider, model, server and serving backend:
Dashboards: active backends and spend by backend now come from sent counters.
Not verified in the cluster
The collector values were parsed in a test, not deployed. After merge:
k8s/otel/values.yaml.devops telemetry connect).Tests
tests/test_telemetry_instruments.pycovers:test_docsnow checks the generated table against the list.uv run devops ci --force: 13/13 gates pass.Closes #564