Skip to content

fix(monitoring): follow the step in the local-savings query windows #5784

Not planned

Description

@devops-cli-service

Split from #4724.

Problem: the local-savings queries of k8s/devops/dashboards/ai-spend.json draw rolling [1h] sums at steps under 1 h (panels 15, 19, 22 and 23). The points overlap and the value is wrong. The 8 savings queries keep the old-label fallback until #2202 (after 2026-11-23). Only their windows change here. Why deferred: tests/fixtures/recorded_queries/ai_spend_local_savings.yaml records the query of the panel 'Local Cloud Savings in Range' as text. tests/prometheus/test_k8s_monitoring_dashboards.py fails when the query changes until a person records it again against live Prometheus. This roadmap cannot read live Prometheus. #2202 rewrites these queries after 2026-11-23, and the window change lands with it. Acceptance criteria: - The 8 local-savings queries use [$__interval] or $__rate_interval in place of each fixed window. - A person re-records tests/fixtures/recorded_queries/ai_spend_local_savings.yaml against live Prometheus. - test_local_cloud_savings_in_range_gives_the_priced_total_of_the_recorded_series passes. - The selectors keep the old-label fallback until #2202.

Activity

  1. added
    source/agent
    type/bug
    scope/monitoring
    status/new
    value/medium
    effort/medium
    on Nov 15, 2026
  2. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    ContributorAuthor
  3. dan-petty commented on Nov 16, 2026

    @dan-petty
    Owner

    Pull request #5931 (for #5914) replaces the 8 local-savings queries of ai-spend.json. They read the gateway token counters now, not devops_cli_ai_tokens_total.

    • Local savings: USD per hour and Local savings by backend server: USD per hour are hourly bars of increase(...[$__interval]) with a Min interval of 1h. The [5m], [1h] and [6h] lines are gone.
    • Local Cloud Savings in Range reads $__range. The savings of each projection read [7d], the baseline of the spend (fix(monitoring): read AI spend from the gateway counter #4724).
    • tests/fixtures/recorded_queries/ai_spend_local_savings.yaml holds a new record against live Prometheus, and test_local_cloud_savings_in_range_gives_the_priced_total_of_the_recorded_series passes.
    • No query keeps the old-label fallback, because no query reads the client series.

    The pull request does not close this item, because two criteria do not apply as written (the [7d] window and the fallback). After the merge, a person can close it as not planned.

  4. dan-petty commented on Nov 26, 2026

    @dan-petty
    Owner

    Closed: the savings queries are gone.

    #5931 replaced them. The savings panels of k8s/devops/dashboards/ai-spend.json now use $__interval and $__range. The recorded query fixture and its test are deleted. Panels 19, 22 and 23 (cache share, gateway attempts, callers) still use [1h] windows: #5922 holds them.

  5. removed
    status/new
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/monitoringsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions