Skip to content

test(telemetry): verify the metrics row cost over two rollouts #3794

Closed

Description

@devops-cli-service

Split from #3634.

The metrics row must stay near its level before #3601 over a period with two rollouts. The code change can be built and tested offline. The live check waits on two deployments after merge, so this part is deferred. Acceptance criteria: run two rollouts with the new code; record sum by (row)(increase(devops_cli_github_requests_total[1h])) with row metrics; show that the row stays near its pre-#3601 level of about 222 to 305 requests an hour; and state the result in a comment on the fix issue.

Proposed design

Problem statement

The metrics row of the roadmap poll must not cost more GitHub requests than it did before #3601. The live level needs two deployments of the fix after merge, so a pull request cannot measure it. This issue pins the five-request baseline of one metrics-row round with an offline test. A separate issue records the two-rollout measurement.

Acceptance criteria

Requirement: Row label on the GitHub request counter

The metrics row MUST record each GitHub request that it makes under the row label value metrics on devops_cli_github_requests_total.

Scenario: One metrics-row round through the due table

  • WHEN a test runs the metrics row through run_due_jobs with the fake GitHub edges and a fresh store
  • THEN the counter samples with row="metrics" sum to the exact number of requests that the round made

Requirement: Request budget of one metrics-row round

The test MUST assert that one metrics-row round with one page of each listing makes at most five GitHub requests, and fail with the recorded count and the budget when it makes more.

Scenario: One more page of open items

  • WHEN the test runs one metrics-row round as the GitHub App against a fake that returns one more page of open items than the budget allows
  • THEN the test fails and reports the recorded request count and the budget constant of five

Requirement: The test gates the merge

The request-count test MUST run in the Tests & Coverage check that gates merges into main.

Scenario: Pull request check run

  • WHEN CI runs the Tests & Coverage check on a pull request
  • THEN the check collects the metrics-row request-count test and fails on an excess request

Existing Tool Considered

No alternatives check has run: the item type is test, a skip class, so the check gives not-applicable; alternatives is null. Prometheus is open and maintained and covers the live measurement with sum by (row)(increase(devops_cli_github_requests_total[1h])), and the repository already runs it, but it cannot assert a request count offline. pytest is open and maintained and, with the existing fake GitHub edges (GitHubFake and GitHubApiFake), covers the offline assertion. The change builds no new code and adds no library.

Key questions

  • How does the change verify the metrics row request cost without a live deployment?: Add an offline test that runs one metrics-row round as the GitHub App against the fake GitHub edges and asserts the count against a budget constant of five. The two-rollout live measurement goes to a separate blocked issue. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, tests/github/test_github_api_metrics.py, tests/roadmap/test_roadmap_run.py:1344, tests/roadmap/test_roadmap_run.py:1500]
    • Chosen: Offline request-count test. It runs in CI on every pull request, needs no deployment (ADR 0004), and pins the five-request baseline.
    • Rejected: Live measurement only. It needs two deployments after merge, and no pull request can run it.
    • Rejected: Manual dashboard inspection. It is not repeatable and it gates no merge.
  • Which label carries the roadmap row on the GitHub request counter?: The row label. The metrics row runs in request_scope(row="metrics"), and the measurement query groups by row. [sources: src/devops_cli/roadmap/run.py:1348, docs/TELEMETRY.md:90, tests/github/test_github_api_metrics.py:141]
  • What value does the offline test use as the per-round request budget?: A named constant of five: the every-issue listing, the Actions runs, the milestones, the open-issue listing and the repository metadata of one round with one page per listing. The four traffic reads are skipped under the App, and the /rate_limit read is not counted. The test seeds one page per listing and a warm age cache, so a second page of open items makes six and fails. (best practice) [sources: src/devops_cli/github/metrics.py:829, src/devops_cli/github/metrics.py:833, src/devops_cli/github/metrics.py:834, src/devops_cli/github/metrics.py:835, src/devops_cli/github/metrics.py:836, src/devops_cli/github/metrics.py:761, src/devops_cli/github/metrics.py:622, src/devops_cli/github/metrics.py:348, src/devops_cli/github/metrics.py:417, src/devops_cli/config/defaults.py:767, k8s/monitoring/dashboards/devops-cli.json:1040, src/devops_cli/roadmap/run.py:1476]
    • Chosen: Named constant of five. It is the exact count of the five reads of one pre-feat(telemetry): measure how long roadmap items wait in each state #3601 round with one page per listing, so any extra request or page fails offline in CI.
    • Rejected: Value read from a live Prometheus query. CI has no production Prometheus access, and the live series needs two deployments after merge.
    • Rejected: No budget, count only. A count with no bound fails on no regression and gates nothing.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-08: not-applicable.
Class: test, no search.
Tool: none found.

Activity

  1. added
    source/agent
    type/test
    scope/telemetry
    status/new
    value/medium
    effort/low
    on Nov 6, 2026
  2. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    ContributorAuthor

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

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/telemetry. The (telemetry) scope of the title gives the scope.
    • Priority: P2-Medium. It confirms a shipped fix but depends on two future deployments, so it is not urgent.
    • Value: Medium. It proves the fix holds in production and prevents a silent regression of the GitHub budget.
    • Effort: Low. The work is two rollouts and one Prometheus query; no new code is needed.
    • Related: fix(telemetry): the age metrics keep their reads across pods #3634, which asks for a different change. Both target the metrics row cost after #3601, but #3634 fixes the per-pod cache and the candidate verifies the fix over two rollouts.
  3. added
    priority/p2-medium
    status/ready
    and removed
    status/new
    on Nov 6, 2026
  4. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    ContributorAuthor

    Status set to Ready at 8436734 (see proposed design in issue body).

    Moved to new items: #3996.

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

    @devops-cli-service
    ContributorAuthor

    Alternatives check: not-applicable

    Class: test. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.

  6. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 14, 2026
  7. removed
    status/in-review
    on Nov 14, 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/telemetrysource/agenttype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions