Skip to content

GitHubAppRateLimitRemaining metric is not recorded for the exact call that gets rate-limited #5425

Closed

Description

@atsikham

Description

isJobQueued and createJitConfig (in github-runner.ts) both call metricGitHubAppRateLimit(response.headers, appIndex) right after a successful GitHub API call, using the rate-limit headers on that response. If the call itself fails because the app is rate-limited, that line is never reached, since it comes after the await that just threw.

Impact

The GitHubAppRateLimitRemaining CloudWatch metric (enabled via ENABLE_METRIC_GITHUB_APP_RATE_LIMIT) never gets a data point for the exact call that hit the rate limit — the one moment the metric exists to catch. A dashboard built on this metric can show budget trending down over time but will miss the specific blocked calls, making it harder to correlate "which call got blocked and when" with what else was happening.

Proposed fix

Catch the error in both places, pull the same rate-limit headers off the failed response if present, and record the metric before re-raising or moving on — the headers are already there on a 403/429 response, they're just not being read.

See PR (to follow) for the implementation.

Activity

  1. added a commit that references this issue on Sep 17, 2026
    5026cd9
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions