Skip to content

fix(telemetry): the project velocity dashboard reads the latest snapshot of each gauge, and the project gauges drop the _total suffix #974

Closed

Description

@dan-petty

Problem (re-scoped 2026-10-25)

The Project & Engineering Velocity dashboard (k8s/monitoring/dashboards/project-metrics.json) shows no data on most panels.

State of main (28c1607), checked on 2026-10-25:

Proposed remedy

  • Each gauge panel reads the latest snapshot with last_over_time(<metric>[$__range]), grouped by the same labels as now. The stat panels drop or vector(0), so a panel with no snapshot shows no data instead of 0.
  • The 13 project gauges drop _total: devops_cli_project_releases, devops_cli_project_commits, devops_cli_project_prs, devops_cli_project_ci_runs, devops_cli_project_items, devops_cli_project_traffic_views, devops_cli_project_traffic_views_uniques, devops_cli_project_traffic_clones, devops_cli_project_traffic_clones_uniques, devops_cli_project_traffic_referrers, devops_cli_project_traffic_paths, devops_cli_project_stars and devops_cli_project_forks. Pre-1.0, nothing is kept for compatibility.
  • The dashboard invariant reads each series by its kind, in every devops-cli dashboard with no exception: a counter through rate( or increase(, a gauge through last_over_time(, a histogram through either. A second invariant: a gauge name never ends in _total, and a counter name always does.

Moved out

Acceptance criteria

  • Each series of each devops-cli dashboard is read through the function of its kind, and a test fails for a gauge read with no range.
  • No gauge name ends in _total, and every counter name does; a test checks each instrument.
  • docs/TELEMETRY.md names the gauges by their new names.
  • uv run devops ci passes.

Activity

  1. added this to the v0.2.26 milestone on Oct 2, 2026
  2. added
    scope/telemetry
    scope/github
    priority/p2-medium
    on Oct 2, 2026
  3. removed this from the v0.2.26 milestone on Oct 2, 2026
  4. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Scope handed over by #1358 (in review for v0.2.29). Once it merges, the roadmap Service's metrics job walks each repository's own clone, so these paths stop being idle:

    1. Fail closed on git reads. A failed git tag read (_get_git_tag_entries, github/metrics.py:144-157) should raise, and the emitter records nothing for that run, as the REST readers will under the criterion absorbed from fix(gh): project metrics read every page and fail closed instead of reporting zero #931. fix(roadmap): the metrics job walks release tags in each repository's own clone, and a missing or type-less labels.yml stops intake as a configuration error before any model call #1358 makes a clone failure fail the job, but a failed tag or REST read still only warns.
    2. A repo label on every project instrument, stars, forks and traffic included (telemetry/instruments.py:168-215). With eight repositories and no repo label:
      • devops_cli_project_releases_total changes from run to run with whichever repository ran last;
      • per-release commits_total and prs_total{release=...} from different repositories land in the same series, and tag names collide (v0.1.0 exists in more than one repository);
      • each RepoWorker is its own thread, and _record_releases_breakdown runs clear_metric then one set_gauge per release, each under the lock but not as one step, so two repositories finishing together can leave the union of their release series in a scrape.
    3. The release-interval histogram double counts. PROJECT_RELEASE_INTERVAL_DAYS is an OTLP histogram (metrics.py:556), and every run re-observes every release interval, so _count and _sum grow every 15 minutes for the same data. One gauge per release, as proposed here, removes that.
    4. Cost of the tag walk. get_release_cadence_metrics runs two git processes per tag for all tags, then keeps the last 10 (metrics.py:222-245): about 68 git processes per run for this repository. Slicing to the last 10 tags before the walk avoids that.
    5. devops gh metrics --repo X from a checkout of another repository should fail and name both, instead of reporting the checkout's tags under X.
  5. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Addition from #1400 (in review for v0.2.29): #1400 logs the Service's round pause and each round's GraphQL spend, but Prometheus has no series for either, so alerting on a paused Service needs Loki. Since this item makes state metrics gauges, include two: devops_cli_service_paused_until_seconds, set by the Service's round pause (0 when none), and devops_cli_github_graphql_remaining, set from each round's closing budget read. Folded here instead of a new issue because the agent filing quota (#1153) is spent for this cycle.

  6. added this to the milestone on Oct 21, 2026
  7. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Proposal needs splitting into 2 items at 6c713ee (see proposed design in issue body).

  8. removed this from the milestone on Oct 23, 2026
  9. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

    A read-only probe on 2026-10-23 ran every panel query of this dashboard. 6 of 20 panels have data. Two causes empty the rest:

    • Native histograms. The CLI exports devops_cli_project_release_interval_days as a native histogram since fix(telemetry): delta metrics from one process can reach the collector out of order #792, and Prometheus stores it under the bare name. Panels 3, 4 and 5 still query _bucket, _sum and _count. These forms return data: panel 3 histogram_avg(sum(last_over_time(devops_cli_project_release_interval_days[$__range]))), panel 4 histogram_quantile(0.5, sum(last_over_time(devops_cli_project_release_interval_days[$__range]))) (and 0.95), panel 5 histogram_avg(sum by (release) (last_over_time(devops_cli_project_release_interval_days[$__range]))).
    • Gauges read without a range function. The gauges are written rarely (the last manual emission was at 2026-10-21T22:15Z, and roadmap-service is held at 0 replicas, chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562). Panels 7, 8, 10, 11, 13, 14, 19 and 20 read them as plain selectors, so a sample shows only in the 5-minute lookback after an emission. sum by (release) (last_over_time(devops_cli_project_commits_total[$__range])) returns 28 series at the 30-day default range. Panels 25 to 27 already use this form. Stats 16 to 18, 22 and 23 show a false 0 from or vector(0).

    telemetry/instruments.py maps a histogram to the classic names in its series property, so the tests pass with the stale names. #1955 fixes that mapping for the devops-cli dashboard; this item keeps the Project dashboard queries.

  10. dan-petty commented on Oct 25, 2026

    @dan-petty
    OwnerAuthor

    This item cannot be built as written. PR #1253 already reclassified the inventory instruments as gauges. PR #792 and PR #1958 established that devops_cli_project_release_interval_days is an exponential native histogram. Panels 3 through 5 already use histogram_avg and histogram_quantile. The live series keep the _total suffix.

    The roadmap service runs the periodic metrics collection in roadmap/run.py. The maintainer recorded on 2026-10-22 that this proposal needs a split into two items. The on-use command trigger is no longer needed. Rule 2 forbids compensating code when an item cannot be built as written. We return this item to New for refinement.

  11. changed the title [-]fix(telemetry): project metrics are gauges emitted when devops gh or pr is used, and the velocity dashboard reads the latest snapshot[/-] [+]fix(telemetry): the project velocity dashboard reads the latest snapshot of each gauge, and the project gauges drop the _total suffix[/+] on Oct 25, 2026
  12. added
    type/bug
    and removed 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

    priority/p2-mediumscope/githubscope/telemetrytype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions