Skip to content

fix(service): count each GitHub request with its HTTP status - #3686

Merged
dan-petty merged 9 commits into
mainfrom
fix/3497-cut-unchanged-github-reads
Nov 5, 2026
Merged

dan-petty merged 9 commits into
mainfrom
fix/3497-cut-unchanged-github-reads

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The Service spends most of its GitHub budget on reads, and the request counter does not show whether an answer is a 304 or a 200. So the share of answers that find no change is not known. The rate limiter also logs its pace lines at INFO, and these lines wrote 53.6% of a log sample.

Each paced attempt now counts once, and its status label holds the HTTP status of the answer. An attempt with no answer and a gh command count with status none. The counter keeps its name and its total. The two pace lines log at DEBUG. The limiter keeps the charge of a 304, because no measure shows that GitHub does not count it.

This delivers criteria 1, 5 and 9 of the issue. The other criteria moved to #3667, #3670, #3671 and #3672.

Closes #3497

Change: openspec/changes/archive/2026-11-05-3497-cut-unchanged-github-reads/

Plan the first slice of #3497: a status label on the request counter and DEBUG pace lines.
The request counter names the status of each answer, so a 304 is told
from a 200. Each paced attempt of the session counts after its answer,
and a gh command or an attempt with no answer counts with status none.
The two pace lines of the rate limiter log at DEBUG.
The first slice of #3497 is live: the request counter names the HTTP status, and the pace lines log at DEBUG. The later slices stay open.
This reverts commit 1e01066b01fd53b366d2942420ab9401baa170a2.
The token of a GitHub App is minted when it is read, so the read waits
until the request has its turn on the ledger. A refused mint still
counts the paced attempt, with status none, and the refusal reaches the
caller. The count of a 304 keeps its one sample.
The docstrings of the request counter, the session pacing and the
tests now say what the status label holds. The description of
devops_cli_github_requests_total and docs/TELEMETRY.md say that the
status is none for a gh command or for an attempt with no answer.
The change documents now use short sentences. The premise is checked
at origin/main d254410. The Workflow follow-up lists each slice that
stays open on #3497. The task that makes the App token read after the
pace is ticked, since its code is in the commit before.
The session sends a lost GET again (#3506). The count of the request
status holds for each attempt of that loop. The Service guide names the
status label.
The first slice of #3497 is live in the tree: the request counter
names the HTTP status, and the pace lines log at DEBUG. The later
slices stay open on #3497.
@dan-petty dan-petty added type/bug Defect, regression, or incorrect runtime behavior scope/service The long-running devops Service and its lanes labels Nov 5, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Results of the local runs.

Fail-to-pass. uv run devops ci fail-to-pass --base origin/main at 30a5cce: exit 0. 11 tests fail on the base, and 211 pass on the base (tests/github/test_github_api_metrics.py, tests/github/test_github_app_identity.py, tests/github/test_github_rate_limiter.py).

Full gate. uv run devops ci at b6f5e5cf: 18895 passed, 4 failed, 2 skipped. All steps other than test and coverage passed. The 4 failures are known host failures that also fail on origin/main: tests/crypto/test_ssh.py, tests/telemetry/test_config_env_overrides.py, tests/commands/test_devcontainer_install_tools_dry_run.py and tests/ai/test_tool_executor_contract.py (#3585). The test step took 9m 9s (#3593). The coverage step did not give a value, because the test step failed.

After that run. origin/main moved by 4 commits, and #3680 conflicted in k8s/README.md. The resolution keeps the text of #3680 and adds the status phrase. The full gate did not run again on 30a5cce. These narrow runs did run there: the 3 test files above (222 passed), tests/prometheus/test_k8s_monitoring_alerting.py and tests/telemetry/test_service_counter_series.py (58 passed), and uv run devops ci docs (up to date).

Moved criteria. #3667 holds criteria 2, 3, 4 and 10. #3670 holds criterion 6. #3671 holds criterion 7. #3672 holds criterion 8. The live sum query against the baseline of 39248 is in #3667, so this change does not measure it.

@dan-petty
dan-petty marked this pull request as ready for review November 5, 2026 19:09
@dan-petty
dan-petty merged commit b39dcba into main Nov 5, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/3497-cut-unchanged-github-reads branch November 5, 2026 19:15
dan-petty pushed a commit that referenced this pull request Nov 5, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.63.0](v0.62.7...v0.63.0)
(2026-11-05)


### Features

* **roadmap:** let a negative search verify check more than one name
([#3678](#3678))
([5a4364c](5a4364c))
* **telemetry:** count the tool calls of the stage planner by outcome
([#3679](#3679))
([45da6dd](45da6dd))


### Bug Fixes

* **ci:** count tests and specs as hardening guardrails
([#3684](#3684))
([1d75506](1d75506))
* **security:** mask the user name of a URL with no password
([#3676](#3676))
([bc1cd9c](bc1cd9c))
* **service:** count each GitHub request with its HTTP status
([#3686](#3686))
([b39dcba](b39dcba))
* **telemetry:** Service counters read true across pods and repos
([#3680](#3680))
([05544ab](05544ab))

---
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/service The long-running devops Service and its lanes type/bug Defect, regression, or incorrect runtime behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(service): the rows stop repeating reads that find no change

1 participant