Skip to content

feat(monitoring): the roadmap Service's identity refusals, failing and stalled jobs, restarts, and GitHub and model request volume raise alerts - #2496

Merged
dan-petty merged 4 commits into
mainfrom
feat/2472-roadmap-service-alerts
Oct 28, 2026
Merged

dan-petty merged 4 commits into
mainfrom
feat/2472-roadmap-service-alerts

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The roadmap Service gets the Prometheus rule group roadmap-service in k8s/monitoring/prometheus-values.yaml. Before this change, no rule selected a devops_cli_ series: on 2026-10-11 the Service logged 551 job errors with no alert, and a refused identity stops every round while /healthz stays healthy.

  • Critical: RoadmapServiceIdentityRefused fires while the refusal counter of the Service is above 0, which is until the pod restarts. RoadmapServiceGitHubThrottled fires for 15 minutes after one throttle sample.
  • Warning: RoadmapServiceJobsFailing fires at 3 or more failed jobs of one repository and lane in 1 hour, and counts the first value of an error series that starts in the hour. RoadmapServiceLaneStalled fires when no job of a lane started for 2 hours while a replica is available (for 10m). RoadmapServiceRestarted and RoadmapServiceUnavailable (for 10m) read kube-state-metrics. RoadmapServiceGitHubRequestsHigh fires above 450 GitHub requests in 1 hour, 90% of the default budget. RoadmapServiceModelRequestsHigh fires above 352 model requests in 1 hour that the cache did not answer.
  • Each devops_cli_ selector has job="roadmap-service". The scrape of /metrics and the OTLP export both give the series of the Service that job, so the same series of a workstation (job="devops-cli") and the old kubernetes-pods series do not count. Each kube-state-metrics selector names namespace devops and the deployment or its pods.
  • "Roadmap service", "Alerts" in k8s/README.md says what to do for each alert, and each description points there.
  • tools.lock pins promtool 3.15.0, the version of the Prometheus server of the cluster, and the CI test job installs it. tests/test_k8s_monitoring_alerting.py runs promtool check rules over every alert rule, and promtool test rules over tests/fixtures/prometheus_rules/roadmap_service_tests.yaml: each alert fires on a sample series and stays quiet on a normal series and on the same series of another job.

Four expressions are not the ones that the issue writes. The archived design gives the evidence from the live Prometheus: the refusal counter starts at 1, so increase() does not see a refusal; a new error series also starts at 1, so increase() alone found 1 of 16 failing lanes on 2026-10-10; the chart keeps the available replica count and not the ready count; and an answer from the cache is not a model request.

No alert leaves the cluster until the receiver Secret exists. That is a step for the owner, and the route is Mattermost (#1391, #1392). #1392 plans a rule with the same name, RoadmapServiceJobsFailing, and changes this rule when it is built.

Closes #2472

@dan-petty

Copy link
Copy Markdown
Owner Author

Test record for this pull request:

  • promtool did not run in the agent workspace: auto mode refused the download of the Prometheus release archive there. The two promtool tests skipped locally, as their live mark says.
  • The CI test job installed promtool 3.15.0 from tools.lock in 2 s and ran the suite: 11765 passed and 44 skipped, against 11757 passed and 44 skipped for the base commit 0c2cba6. The change adds 8 tests (7 in tests/test_k8s_monitoring_alerting.py, 1 in tests/test_workflow_contracts.py), and the count of skipped tests did not change. Thus test_promtool_accepts_every_alert_rule and test_each_roadmap_service_rule_fires_on_a_sample_and_stays_quiet_on_a_normal_series ran and passed: each of the 8 alerts fired on its sample series with the pinned labels and annotations, and stayed quiet on its normal series.
  • Local runs: uv run devops ci test tests/test_k8s_monitoring_alerting.py tests/test_workflow_contracts.py tests/test_tools_lock.py tests/test_install_tools.py tests/test_ci.py, the ratchet and invariant tests, the k8s and dashboard tests, uv run mypy src, uv run devops docs check and uv run devops openspec check passed.
  • Live checks, read-only through the Grafana MCP tools on 2026-10-28: the expressions of RoadmapServiceJobsFailing and RoadmapServiceLaneStalled found no series at 2026-10-10T20:00:00Z, when 16 repository and lane pairs ran normally. At 2026-10-10T23:05:00Z, when every round failed, the expression of RoadmapServiceJobsFailing found 16 pairs, and a plain increase() found 1.

@dan-petty
dan-petty marked this pull request as ready for review October 28, 2026 18:58
@dan-petty
dan-petty merged commit 0137f23 into main Oct 28, 2026
17 checks passed
@dan-petty
dan-petty deleted the feat/2472-roadmap-service-alerts branch October 28, 2026 18:59
dan-petty added a commit that referenced this pull request Oct 28, 2026
…s in the hour, and a lane of a new pod can stall (#2514)

A review of #2496 found that the rule group `roadmap-service` misses
real incidents, and a check of the same rules found a false alert.

- `RoadmapServiceJobsFailing`, `RoadmapServiceGitHubRequestsHigh` and
`RoadmapServiceModelRequestsHigh` count each series of the last hour in
one way: `(last_over_time(x[1h]) unless last_over_time(x[1h] offset 1h))
or increase(x[1h])`. A series with no sample in the hour before started
in the hour, so its last value is all of its count. Prometheus gets no
zero sample at the start of a series (#2506), and `increase()` does not
count the first value. Before this change, the two request rules missed
a stream that the collector starts again, for example when the Service
comes back after an hour: 520 GitHub requests and 415 model requests in
an hour gave no alert.
- The old correction of `RoadmapServiceJobsFailing` read the series one
hour ago with the 5-minute lookback. A sparse error series from before
the hour added all of its count ("8 model jobs" for 2 failed jobs), and
a new series with one sample gave no result. The new count reads neither
of these wrongly. On the samples of the cluster for 30 days, the old and
the new expressions fire at the same steps, and at the incident of
2026-10-10 both find the 16 failing repository and lane pairs.
- `RepoWorker.start` sets the gauge
`devops_cli_service_job_start_timestamp_seconds` of its lane to the time
the worker starts. Before this change, a lane of a new pod had no series
until its first job, so `RoadmapServiceLaneStalled` stayed silent after
a rollout when the lane started no job.
- `k8s/README.md`, "Roadmap service", "Alerts", says how the counts read
a new series and when the 2 hours of a new pod start.
- `tests/fixtures/prometheus_rules/roadmap_service_tests.yaml` has a
promtool case for each gap, `tests/test_k8s_monitoring_alerting.py` pins
the expressions, and `tests/test_server_service.py` checks the gauge at
the start of a worker.

Closes #2505
dan-petty pushed a commit that referenced this pull request Oct 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.11.0](v0.10.1...v0.11.0)
(2026-10-28)


### Features

* **monitoring:** the roadmap Service's identity refusals, failing and
stalled jobs, restarts, and GitHub and model request volume raise alerts
([#2496](#2496))
([0137f23](0137f23)),
closes [#2472](#2472)
* **service:** roadmap-service runs at one replica, and each model call
in the cluster is sent at most two times
([#2500](#2500))
([2d32dae](2d32dae)),
closes [#2494](#2494)


### Bug Fixes

* **cli:** every command reports a DevOpsCLIError through one exit seam
([#2502](#2502))
([eadd55f](eadd55f)),
closes [#2487](#2487)
* **github:** pr monitor waits until the checks settle and names every
blocker, and pr ready reads the merge-readiness verdict
([#2498](#2498))
([43326ea](43326ea))
* **k8s:** a pod that does not call the Kubernetes API mounts no service
account token
([#2522](#2522))
([305d3ba](305d3ba))
* **k8s:** the cloudflared tunnel replicas prefer different nodes and
keep one up through a drain
([#2499](#2499))
([d4edaf6](d4edaf6)),
closes [#1023](#1023)
* **k8s:** the grafana, prometheus, argo cd and loki clients dial
through the egress-checked factory, and their pre-flight address checks
go ([#2497](#2497))
([e7ca1d5](e7ca1d5))
* **monitoring:** the roadmap Service alerts count a series that starts
in the hour, and a lane of a new pod can stall
([#2514](#2514))
([c7692b2](c7692b2)),
closes [#2505](#2505)
* **review:** a review's scanners leave out the rules that never gave a
valid finding here
([#2508](#2508))
([fe953ac](fe953ac))
* **roadmap:** a refine round leaves an outside account issue to a
person, and refine neutralizes comment openers, www links and
cross-repository references
([#2507](#2507))
([e6230dc](e6230dc)),
closes [#2478](#2478)
* **sandbox:** the metrics scrape and the whitelist NetworkPolicy
resolve each host one time, through the egress check
([#2521](#2521))
([7c01426](7c01426))
* **security:** the subprocess environment guard refuses the zsh and
interpreter keys that make a child run code
([#2510](#2510))
([459621a](459621a))
* **service:** a restart keeps the halt, the budget window and the
failure ledger, and a rate limit or a suspended installation stops every
worker ([#2515](#2515))
([3630de1](3630de1)),
closes [#2474](#2474)


### Code Refactoring

* **config:** settings resolve in one declared order through
pydantic-settings sources
([#2518](#2518))
([6a5447a](6a5447a)),
closes [#2445](#2445)

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(monitoring): the roadmap Service's identity refusals, failing and stalled jobs, restarts, and GitHub and model request volume raise alerts

1 participant