Skip to content

fix(monitoring): mark the metric window that lost samples in #6439 #6457

Closed

Description

@dan-petty

Problem Description

From 2026-11-15T23:26Z to the rollout of the fix of #6439, Prometheus refused part of the remote-write samples of Alloy. It also kept only the first sample of a label set inside one batch and dropped the rest with no signal. The stored series of that window are wrong, and nothing marks them:

  • The gateway families litellm_deployment_* are too low. On 2026-11-19, one day held 10,454 stored requests against 35,342 real ones. sum(increase(litellm_deployment_total_requests_total[1d])) / sum(increase(litellm_llm_api_latency_metric_count[1d])) gives 0.16 to 0.53 in the window, against about 1.0 to 1.6 before 2026-11-15.
  • Targets with no fault have gaps. In 2 h to 2026-11-19T14:50Z, roadmap-service kept 60.5 of 120 up samples and valkey-devops 79 of 120 (the table of fix(monitoring): stop the gateway labeldrop losing samples #6439).

These readers cover the window: k8s/monitoring/dashboards/llm-stack.json, k8s/monitoring/dashboards/ai-spend.json, devops ai gateway load and the measures of #4624. The status audit of #4624 already read one gap of valkey-devops as a stopped scrape. Prometheus cannot add the dropped samples back. Retention (retention: 30d, k8s/monitoring/prometheus-values.yaml:11) removes the window about 30 days after the rollout.

Reproduction Steps

  1. In Grafana Explore on the Prometheus data source, run the ratio query above over a range from 2026-11-12 to 2026-11-19.
  2. Run sum by(job)(count_over_time(up[2h])) / on(job) group_left count by(job)(max_over_time(up[2h])) at 2026-11-19T14:50Z.

Expected vs Actual Behavior

  • Expected: a reader of a dashboard or a measure that covers the window sees that its values are wrong, and why.
  • Actual: no annotation, note or measure marks the window, so a reader can take the low values and the gaps as real.

Environment Diagnostics

  • DevOps CLI Version: origin/main fda0478
  • Prometheus: the prometheus-server of the prometheus chart, retention 30d

Logs, Traces, or Terminal Output

ts=2026-11-19T14:44:40.782Z level=error msg="non-recoverable error" component_id=prometheus.remote_write.localprometheus failedSampleCount=2000 err="server returned HTTP status 400 Bad Request: duplicate sample for timestamp 1795099476547"

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Acceptance Criteria

Dependencies

Blocked by the merge and the Argo CD sync of the fix of #6439, which sets the end of the window. Related: #4624, #5261 (deploy and incident annotations).

Source: https://github.com/dan-petty/devops-cli/blob/fda047828/k8s/llm/gateway/servicemonitor.yaml#L20-L24

Alternatives check of 2026-11-19: in-use.
The repository already uses this tool.
Tool: grafana/grafana (https://github.com/grafana/grafana), AGPL-3.0, last activity 2026-11-19, maintained.
Reason: Searches found Grafana's built-in region annotations, which mark the window on every panel of the affected dashboards, but no tool writes the same note into the CLI measure output, so the need is only partly covered.

Covers:

  • Region annotation drawn across every dashboard panel
  • Start, end and link text in one annotation
  • Held in dashboard JSON that the dashboard tests read

Lacks:

Proposed design

Problem statement

Mark the #6439 sample window in the two dashboards and in the devops ai gateway load measure. The end of the window waits on the Argo CD sync of #6439. Prometheus dropped remote-write samples of Alloy from 2026-11-15T23:26Z until the fix of #6439 rolled out. Dashboards and measures show the low values and the gaps as real. The change marks the window in each affected reader.

Acceptance criteria

Requirement: LLM stack dashboard annotation

The LLM stack dashboard SHALL hold a Grafana region annotation from 2026-11-15T23:26Z to the Argo CD sync time of the fix of #6439, with a link to #6439 and the reason that remote-write samples were dropped.

Scenario: K8s check validates the LLM stack annotation

Requirement: AI spend dashboard annotation

The AI spend dashboard SHALL hold the same Grafana region annotation, with the start, the end, the #6439 link and the dropped-sample reason.

Scenario: K8s check validates the AI spend annotation

Requirement: Gateway load measure window note

The devops ai gateway load output SHALL hold a note with the start 2026-11-15T23:26Z, the Argo CD sync time of the fix of #6439, a link to #6439 and the reason that remote-write samples were dropped.

Scenario: Gateway load note test

Existing Tool Considered

The alternatives check records grafana/grafana as in-use; see the alternatives block in the issue body for what it covers and lacks. The repository already uses Grafana, so the dashboard region annotation uses it. The proposal adds the missing note in the devops ai gateway load measure code. The #4624 measures are deferred.

Key questions

  • How should the dashboards mark the window?: Add one Grafana region annotation to each affected dashboard JSON. Use start 2026-11-15T23:26Z, end at the Argo CD sync of the fix of fix(monitoring): stop the gateway labeldrop losing samples #6439, a fix(monitoring): stop the gateway labeldrop losing samples #6439 link and the dropped-sample reason. (best practice) [sources: k8s/monitoring/dashboards/llm-stack.json, tests/grafana/test_grafana_dashboards.py]
    • Chosen: Grafana region annotation. Grafana provides it, it shows on every panel, and the dashboard tests read the JSON.
    • Rejected: Custom text panel. It adds code and does not follow the dashboard time range.
    • Rejected: Prometheus recording rule. It can not restore dropped samples or show a note on a dashboard.
  • Should the item mark the window or close as not planned?: Mark the window. The readers still show the wrong values, and the mark tells a reader why. (best practice) [sources: k8s/monitoring/prometheus-values.yaml:11, k8s/monitoring/dashboards/llm-stack.json]
    • Chosen: Mark the window. The affected dashboards and measures are in use, and the window is still queryable.
    • Rejected: Close as not planned. Retention removes the data later, but readers need the warning now.

Fit

Fits in one pull request.

Suspected block

The end of the window waits on the Argo CD sync of the fix of #6439.

Dependencies

#6439

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • k8s/llm/gateway/servicemonitor.yaml

Activity

  1. added
    type/bug
    source/agent
    status/new
    value/medium
    on Nov 19, 2026
  2. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor
  3. added
    effort/low
    scope/monitoring
    priority/p2-medium
    on Nov 19, 2026
  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  5. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • open source tool annotate Prometheus metric gaps and dropped samples on dashboards, results: 5
    • Grafana dashboard region annotation mark a time window in dashboard JSON, results: 5
    • grafana annotation CLI tool github, results: 5
    • Grafana annotations documentation dashboard time range region, results: 5
    • prometheus alert annotation stale data gap, results: 5
    • grafana annotations, results: 5
    • grafana dashboard annotations region query time range docs, results: 5
    • grafana http api annotations create annotation documentation, results: 5
    • grafana.com/docs annotations dashboards, results: 5
    • "grafana" annotation mark time range dashboard panel, results: 5

    Sources:

  6. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  7. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor

    The blocker of this item is gone. The fix of #6439 (PR #6459, merge bc57c1e) is live, so the window now has an end.

    • Start: 2026-11-15T23:26Z.
    • End: 2026-11-19T22:41:49Z. Argo CD synced Application llm at this time. The new gateway pod started at 22:41:48Z.
    • The loss stopped at the end. In the 36 minutes before the end, Alloy lost 248,542 of 2,326,009 samples. In the 36 minutes after it, Alloy lost 0 of 2,082,214. The table is in fix(monitoring): stop the gateway labeldrop losing samples #6439 (comment).
    • Retention is 30 days, so Prometheus removes the start of the window from about 2026-12-15 and the end from about 2026-12-19.

    A 24-hour check of #6439 runs after 2026-11-20T22:42Z and posts its result on #6439.

  8. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    Recommendation: close this item as not planned. A person closes it, as its acceptance criteria say.

  9. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    not planned

  10. removed
    status/new
    on Nov 20, 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/lowpriority/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