Skip to content

fix(monitoring): the roadmap Service alerts count the first value of a new series and see a lane of a new pod #2505

Description

@dan-petty

Problem Description

A review of pull request #2496 found two gaps in the alert rule group roadmap-service in k8s/monitoring/prometheus-values.yaml. A check of the same rules found a third.

  1. RoadmapServiceGitHubRequestsHigh and RoadmapServiceModelRequestsHigh use sum(increase(...[1h])). Only the OTLP export sends these series. The collector's deltatocumulative processor (max_stale: 1h) starts a stream at its first flush, with no zero sample before it, and increase() does not count that first value. A stream starts again when the Service comes back after more than 1 hour, when a series is idle for more than 1 hour, when the collector restarts, and when a new label set appears. The alert then misses a real overrun of 450 GitHub requests or 352 model requests in one hour.
  2. RoadmapServiceLaneStalled cannot fire for a lane that starts no job after the pod is replaced. devops_cli_service_job_start_timestamp_seconds comes only from the scrape of the pod, and the Service sets it first in RepoWorker._execute_batch. After a rollout the series of the old pod goes stale, and the new pod has no series for a lane until the lane starts a job. The alert has no input, and it stays silent while a replica is available and no job starts for more than 2 hours. RoadmapServiceRestarted does not cover this case, because a rollout makes a new pod and does not restart a container.
  3. The correction in RoadmapServiceJobsFailing (offset 1h * 0 or min_over_time(...)) reads the series 1 hour ago with the 5-minute lookback. An error series that has no sample in those 5 minutes is read as new, and the rule adds its full value. The rule also gives no result for a new series with one sample, because increase() needs two samples.

Prometheus does not add a zero sample at the start of these series. On 2026-10-28, devops_cli_github_requests_total series that started after the created-timestamp-zero-ingestion flag and export_created_metric were live (#2039) start at 1, and Prometheus has no devops_cli_*_created series.

Reproduction Steps

Run promtool 3.15.0 (devops install-tools --tool promtool) as promtool test rules with the group roadmap-service and these tests:

  • Interval 5m, devops_cli_github_requests_total{job="roadmap-service", resource="graphql"} with values _x12 300+20x11. At 115m, 520 requests are in the last hour. Expected RoadmapServiceGitHubRequestsHigh; got no alert. increase() gives about 240.
  • Interval 5m, devops_cli_ai_requests_total{job="roadmap-service", cached="false"} with values _x12 250+15x11. At 115m, 415 model requests are in the last hour. Expected RoadmapServiceModelRequestsHigh; got no alert.
  • Interval 1m, devops_cli_service_job_start_timestamp_seconds{job="roadmap-service", instance="192.0.2.10:8000", repo="example/app", lane="model"} with values 0x30 stale, and kube_deployment_status_replicas_available{namespace="devops", deployment="roadmap-service"} with values 1x220. At 200m, expected RoadmapServiceLaneStalled; got no alert.
  • Interval 10m, devops_cli_service_jobs_total{job="roadmap-service", repo="example/app", lane="model", result="error"} with values _x5 5 _ 6 _ _ _ 7. Two jobs failed in the hour before 120m. Expected no alert; got RoadmapServiceJobsFailing with "8 model jobs of example/app failed in the last hour".
  • Interval 10m, the same error series with values _x6 3. At 65m, expected RoadmapServiceJobsFailing; got no alert.

Expected vs Actual Behavior

Expected: each volume rule and the failed-jobs rule count the first value of a series that starts in the hour, and never count the value of a series that was there before the hour. A lane of a new pod that starts no job for 2 hours raises RoadmapServiceLaneStalled.

Actual: the rules miss the first value of a new stream, count the full value of a sparse old error series, and see no lane of a new pod before its first job.

Source: #2496

Activity

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

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The alert rules produce wrong results: they miss new series values, miscount sparse old series, and stay silent on a new pod lane.
    • Priority: P2-Medium. Three alert rules miss real overruns and stalled lanes, but the Service still runs and no data is lost.
    • Value: Medium. Operators lose visibility into GitHub and model request overruns and stalled lanes, which delays response to real problems.
    • Effort: Medium. Three rules need different fixes in one file, each requiring correct Prometheus range-vector semantics.
    • Related: feat(monitoring): the roadmap Service's identity refusals, failing and stalled jobs, restarts, and GitHub and model request volume raise alerts #2472, which asks for a different change. Both work on the roadmap-service alert rules in k8s/monitoring/prometheus-values.yaml; #2472 created the rules, the candidate corrects three gaps in their logic.
  3. added
    priority/p2-medium
    on Oct 28, 2026
  4. removed
    status/new
    on Oct 30, 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-mediumsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions