diff --git a/CLAUDE.md b/CLAUDE.md index 894a213..9267150 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -86,4 +86,4 @@ multi-arch images to GHCR with SLSA provenance attestation on push to ## Conditional requests -`Client.request` keeps each GET URL's last 200 (body, `ETag`, `Link`; bodies over 2 MiB and beyond 4096 URLs are not kept) and sends `If-None-Match` next time. GitHub answers 304 without counting it against the rate limit, and the cached 200 is handed back to the caller, so slow-changing reads (repo list, workflows, alerts, PR counts) are nearly free once seen, and the same URL asked by two collectors (the org stats and the adoption stats both read PR counts) is free the second time. `github_api_requests_total{result}` shows fresh vs not_modified. +`Client.request` keeps each GET URL's last 200 (body, `ETag`, `Link`; bodies over 2 MiB and beyond 4096 URLs are not kept) and sends `If-None-Match` next time. GitHub answers 304 without counting it against the rate limit; measured on the production token: 285 not_modified plus 1 fresh used 23 budget in 9 min. The PAT's budget is per account, so a drop in `github_rate_limit_remaining` that `fresh` doesn't explain is another tool on the same account (a Shields.io OAuth authorization was one). The cached 200 is handed back to the caller, so slow-changing reads (repo list, workflows, alerts, PR counts) are nearly free once seen, and the same URL asked by two collectors (the org stats and the adoption stats both read PR counts) is free the second time. `github_api_requests_total{result}` shows fresh vs not_modified. diff --git a/README.md b/README.md index 0b15adc..20852a3 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ scrape. | `github_rate_limit_remaining` | | Remaining core API budget in the scarcest active window: the one that runs out first | | `github_rate_limit_limit` | | Total core API budget of that window | | `github_rate_limit_window_remaining` | `reset` | Remaining budget per active core window, labelled with its reset time. GitHub counts per region, so one token can have several windows at once, and which one a call counts against depends on the endpoint. A window's series disappears once it resets | -| `github_api_requests_total` | `result` | GitHub API requests: `fresh` (a full 200, counted against the rate limit) and `not_modified` (a 304 answered from the in-memory conditional-request cache, not counted). Rate of `not_modified` over the total is the saving | +| `github_api_requests_total` | `result` | GitHub API requests: `fresh` (a full 200) and `not_modified` (a 304 answered from the in-memory conditional-request cache). GitHub documents 304s as not counted against the rate limit, and that held when measured: 285 304s and 1 fresh request used 23 of the budget over 9 min. The budget is per account, so other tools using the same token (a shields.io authorization did, 72 per 9 min) show up in `github_rate_limit_remaining` too | | `github_repo_open_prs` | `repo` | Number of open pull requests | | `github_repo_ci_last_run_conclusion` | `repo`, `workflow`, `url`, `conclusion` | Always 1 - an "info" metric. `conclusion` is GitHub's own string verbatim (`success`, `failure`, `cancelled`, `skipped`, `neutral`, `timed_out`, `action_required`, `stale`), not collapsed to pass/fail here - what counts as "actually broken" is a dashboard-level call. `url` links to the run on github.com. Absent if the workflow has never run | | `github_repo_ci_last_run_timestamp_seconds` | `repo`, `workflow` | Unix timestamp of that workflow's latest completed run |