Skip to content

fix(listener): record gha_job_queue_duration_seconds from JobAvailable#25

Open
evanclan wants to merge 1 commit into
mercari:mercari-masterfrom
evanclan:fix/job-queue-duration-from-job-available
Open

fix(listener): record gha_job_queue_duration_seconds from JobAvailable#25
evanclan wants to merge 1 commit into
mercari:mercari-masterfrom
evanclan:fix/job-queue-duration-from-job-available

Conversation

@evanclan
Copy link
Copy Markdown

Summary

  • Fixes gha_job_queue_duration_seconds so it records meaningful values instead of always emitting zero
  • GitHub does not populate QueueTime on JobStarted messages; queue time is now captured when JobAvailable is received and matched by RunnerRequestID when the job starts
  • Adds a unit test covering the queue-duration histogram behavior

This addresses the bug in #19 and implements the approach from closed PR #23 (without the temporary debug logging).

Test plan

  • Added TestJobQueueDurationMetric in cmd/ghalistener/metrics/metrics_test.go
  • CI passes on this PR

Made with Cursor

GitHub does not populate QueueTime on JobStarted messages, so stash the
queue time when JobAvailable is received and emit the histogram when the
matching job starts.

Fixes the broken metric added in mercari#19 and aligns with the approach from
closed PR mercari#23.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant