You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(github): github api request and throttle counters for the devops-cli dashboard #814
priority/p3-lowPriority P3: a small improvementscope/githubGitHub Projects v2, Views, Milestones, Labels, and PR automationscope/telemetryOpenTelemetry tracing spans, Prometheus metrics, and Jaegertype/featureType feature: a new function
The GitHub rate limiter keeps its total requests, throttles and wait seconds in a local JSON file (src/devops_cli/github/rate_limiter.py:320-345), so no dashboard can see API use or throttling.
Scope & Deliverables
Deliverable:
Add to INSTRUMENTS (src/devops_cli/telemetry/instruments.py:96-105): a counter devops_cli_github_requests_total by resource, a counter devops_cli_github_throttles_total, and a histogram of throttle wait seconds.
Add a panel to devops-cli.json.
Acceptance criteria:
A throttled request sends one throttle increment and one wait observation.
The panel queries pass tests/test_telemetry_instruments.py, and their series sit inside rate( or increase(.
Constraint: INSTRUMENTS supports only counters and histograms (instruments.py:17-21). Remaining quota would be a gauge from short-lived processes, so it stays out of scope.
Strategic Alignment
Milestone: Backlog
Depends on: none
Update 2026-10-08: refinement
The Constraint no longer holds: gauges exist (#1253), and the Service has /metrics. Built here, once: devops_cli_github_graphql_remaining from each round's budget read (roadmap/run.py:926), spent points by repo, and devops_cli_service_paused_until_seconds (server/service.py:74).
A round sets the gauge and adds its spend; a refused round sets the pause gauge, reset by the next.
Premise update (2026-10-08): the Constraint "INSTRUMENTS supports only counters and histograms ... Remaining quota would be a gauge from short-lived processes, so it stays out of scope" no longer holds.
Request counts don't track GraphQL cost. About 300 gh calls spent about 4,850 points in the first window, while a quiet hour ran 158 calls for about 158 points.
Suggested amendment: bring into scope, for the service, a GraphQL points-left gauge and a points-spent counter by repo, read from the rateLimit that GitHub returns. #1361 adds only a per-round spend log line and leaves these metrics to this item.
The pull request for this item builds the request counter, the throttle wait histogram and a GraphQL points counter, with a "GitHub API" row in devops-cli.json. It does not build three parts of the 2026-10-08 update, because a newer project direction removes their source.
The gauge of the GraphQL points left and the spend by repository of each Service round. Both come from the GraphQL budget read of the board store (GitHubRoadmapStore.graphql_spend, src/devops_cli/roadmap/board_read.py). The owner decided on 2026-10-28 that labels and milestones hold the roadmap state and that no roadmap job reads or writes the project board (feat(roadmap): labels and milestones hold each item's status, priority, value and effort, and no roadmap job reads or writes the project board #2399). The board reads were the GraphQL cost of the Service. The new counter devops_cli_github_graphql_points_total counts the GraphQL cost of every process, the Service included.
Evidence checked on origin/main bb46660. The pull request closes this item with the parts above left out. A new item can add a Service gauge when the Service runs again under #1647.
priority/p3-lowPriority P3: a small improvementscope/githubGitHub Projects v2, Views, Milestones, Labels, and PR automationscope/telemetryOpenTelemetry tracing spans, Prometheus metrics, and Jaegertype/featureType feature: a new function
Activity
dan-petty commentedon Oct 8, 2026
Premise update (2026-10-08): the Constraint "INSTRUMENTS supports only counters and histograms ... Remaining quota would be a gauge from short-lived processes, so it stays out of scope" no longer holds.
InstrumentKind.GAUGEhas existed since v0.2.27 (fix(telemetry): classify project metrics and upstream status snapshot instruments as gauges #1253,telemetry/instruments.py:17-22).devops servewith github webhooks, a polling tick and per-repo job queues #752) is a long-lived process on the machine account. It used up the whole 5,000-point GraphQL window by itself twice: on 2026-10-07 (writing from 22:29 to 22:43Z) and on 2026-10-08 (writing from 00:57 to 01:08Z). No Prometheus series showed it.Suggested amendment: bring into scope, for the service, a GraphQL points-left gauge and a points-spent counter by repo, read from the
rateLimitthat GitHub returns. #1361 adds only a per-round spend log line and leaves these metrics to this item.dan-petty commentedon Oct 28, 2026
The pull request for this item builds the request counter, the throttle wait histogram and a GraphQL points counter, with a "GitHub API" row in
devops-cli.json. It does not build three parts of the 2026-10-08 update, because a newer project direction removes their source.GitHubRoadmapStore.graphql_spend,src/devops_cli/roadmap/board_read.py). The owner decided on 2026-10-28 that labels and milestones hold the roadmap state and that no roadmap job reads or writes the project board (feat(roadmap): labels and milestones hold each item's status, priority, value and effort, and no roadmap job reads or writes the project board #2399). The board reads were the GraphQL cost of the Service. The new counterdevops_cli_github_graphql_points_totalcounts the GraphQL cost of every process, the Service included.devops_cli_service_paused_until_seconds. The Service pauses only after a GraphQL budget refusal (service_pause_until,src/devops_cli/roadmap/run.py). The Service does not run now (replicas: 0, chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562). The owner decided on 2026-10-28 that the Service acts as thedevops-roadmapGitHub App (feat(service): the roadmap jobs act as a github app installation on an organization-owned board, so the service runs again without the suspended machine account #1647) and drops the board (feat(roadmap): labels and milestones hold each item's status, priority, value and effort, and no roadmap job reads or writes the project board #2399), which changes its identity and its GraphQL use.Evidence checked on origin/main bb46660. The pull request closes this item with the parts above left out. A new item can add a Service gauge when the Service runs again under #1647.
feat(github): send GitHub request, throttle and GraphQL point metrics…