Skip to content

fix(telemetry): key the project gauges by repository - #4804

Merged
dan-petty merged 2 commits into
mainfrom
fix/4690-project-gauges-repo-label
Nov 11, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4690-project-gauges-repo-label

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The metrics row of the Service sends the project snapshot of each managed repository from one process, but the devops_cli_project_* series had no repo label. So the repositories overwrote each other's series, and the stars and release panels showed the value of the repository that wrote last. The item counts also sent 0 for the label sets of the repository before.

Each point of a devops_cli_project_* instrument now carries the casefolded owner/name of its report as repo (ADR 0022), and the 0 for an item label set that goes away is kept per repository. devops gh metrics --emit-telemetry refuses --milestone and a --limit other than the default, before any request, so no filtered snapshot enters the series. The dashboard queries aggregate over the new label until the project-metrics dashboard item adds the filter.

Closes #4690

Change: openspec/changes/archive/2026-11-11-4690-key-the-project-gauges-by-repository/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/telemetry OpenTelemetry tracing spans, Prometheus metrics, and Jaeger labels Nov 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main (head f78e22b6, before the rebase onto e8d1e53): 11 tests fail on the base, and all 117 tests of the 3 changed test files pass with the change.

Failed on the base:

  • tests/github/test_github_metrics.py: test_each_project_gauge_holds_one_series_for_each_repository, test_a_report_sends_no_zero_for_the_label_sets_of_another_repository, test_a_label_set_that_leaves_a_repository_is_sent_as_zero_for_it_once, test_the_command_refuses_a_filtered_snapshot_for_telemetry[milestone], [limit], test_the_command_sends_the_snapshot_with_the_default_limit[no limit], [default limit], test_a_report_without_traffic_sends_no_traffic_series
  • tests/roadmap/test_roadmap_run_metrics.py: test_the_metrics_job_walks_the_version_tags_of_its_own_clone, test_the_metrics_job_of_the_app_asks_no_traffic_endpoint
  • tests/telemetry/test_telemetry_instruments.py: test_each_project_instrument_names_the_repo_label

Focused run: uv run devops ci test tests/github/test_github_metrics.py tests/telemetry/test_telemetry_instruments.py tests/roadmap/test_roadmap_run_metrics.py tests/commands/test_gh_cmd.py: 186 passed. uv run devops ci docs and uv run devops openspec check pass.

Measurements before the change

Prometheus, read on 2026-11-11 (instant queries):

  • changes(devops_cli_project_stars{job="roadmap-service"}[24h]): 265, one series
  • changes(devops_cli_project_releases{job="roadmap-service"}[24h]): 234, one series
  • count(count by (repo) (last_over_time(devops_cli_project_items{job="roadmap-service"}[1h]))): 1, so the items series hold no repo label

Live steps after the rollout

No ConfigMap, Secret or manifest changes. The change takes effect when the Service runs an image that holds it.

24 h after the rollout, run these queries in Grafana Explore on the Prometheus data source:

  1. count(count by (repo) (last_over_time(devops_cli_project_items{job="roadmap-service"}[1h]))): expect the number of entries of service.repos (7 today).
  2. max_over_time(sum(last_over_time(devops_cli_project_items{job="roadmap-service", repo="dan-petty/devops-cli"}[1h]))[24h:5m]) / min_over_time(sum(last_over_time(devops_cli_project_items{job="roadmap-service", repo="dan-petty/devops-cli"}[1h]))[24h:5m]): expect a value below 1.2.
  3. last_over_time(devops_cli_project_stars{job="roadmap-service", repo="dan-petty/devops-cli"}[1h]): expect the value of uv run devops gh api repos/dan-petty/devops-cli --jq .stargazers_count.

Until the project-metrics dashboard item adds the job and repo filters, the panels of project-metrics.json show a max or a sum over the repositories, and the old series with no repo label stay in the 30-day range until they age out.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 21:48
@dan-petty
dan-petty enabled auto-merge (squash) November 11, 2026 21:48
The metrics row sends the project snapshot of each managed repository
from one process, but the devops_cli_project_* series had no repo label,
so the repositories overwrote each other's series. Each point now
carries the casefolded owner/name of its report as repo, and the 0 for
an item label set that goes away is kept per repository.

devops gh metrics --emit-telemetry refuses --milestone and a --limit
other than the default, so no filtered snapshot enters the series.

Closes #4690
@dan-petty
dan-petty force-pushed the fix/4690-project-gauges-repo-label branch from 67ebb66 to a22a428 Compare November 11, 2026 21:55
@dan-petty

Copy link
Copy Markdown
Owner Author

The first push failed one test in Tests & Coverage (shard 2 of 4) and in Service Image Tests (shard 1 of 6): tests/docs/test_docs.py::test_doc_generator_telemetry_docs. The new sentence of docs/TELEMETRY.md named devops gh metrics --emit-telemetry a second time, and the test requires one mention. The sentence now says "With --emit-telemetry, devops gh metrics refuses ...". The fix is in the first commit, and the archive stays the last commit.

Local run after the rebase onto 2eeb814: uv run devops ci test tests/github/test_github_metrics.py tests/telemetry/test_telemetry_instruments.py tests/roadmap/test_roadmap_run_metrics.py tests/docs/test_docs.py: 164 passed. uv run devops docs generate --sync-readme leaves no change.

@dan-petty
dan-petty merged commit 9f0e0c8 into main Nov 11, 2026
26 checks passed
@dan-petty
dan-petty deleted the fix/4690-project-gauges-repo-label branch November 11, 2026 22:12
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.114.0](v0.113.0...v0.114.0)
(2026-11-11)


### Features

* **k8s:** add cert-manager and the Barman Cloud plugin
([#4789](#4789))
([cd6fb76](cd6fb76))
* **roadmap:** collect the git facts of a project review window
([#4794](#4794))
([21d1bc0](21d1bc0))
* **roadmap:** consolidate has a read-only MCP mirror
([#4807](#4807))
([2ec561d](2ec561d))


### Bug Fixes

* **ai:** devops ai agents detects the project manifest
([#4790](#4790))
([e8d1e53](e8d1e53))
* **mcp:** bound the gh resources longer than a GitHub read
([#4844](#4844))
([7f09921](7f09921))
* **roadmap:** run stage before refine on the model lane
([#4841](#4841))
([96c9bee](96c9bee))
* **roadmap:** stop refusing test paths in base docstrings
([#4826](#4826))
([1bbfce0](1bbfce0))
* **telemetry:** key the project gauges by repository
([#4804](#4804))
([9f0e0c8](9f0e0c8))


### Performance Improvements

* **ci:** run the in-image suite nightly and on image pull requests
([#4828](#4828))
([a2cfd9a](a2cfd9a))

---
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

scope/telemetry OpenTelemetry tracing spans, Prometheus metrics, and Jaeger type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(telemetry): key the project gauges by repository

1 participant