Expose gha_available_jobs and gha_acquired_jobs listener metrics#4430
Open
PrateekKumar1709 wants to merge 1 commit intoactions:masterfrom
Open
Expose gha_available_jobs and gha_acquired_jobs listener metrics#4430PrateekKumar1709 wants to merge 1 commit intoactions:masterfrom
PrateekKumar1709 wants to merge 1 commit intoactions:masterfrom
Conversation
The RunnerScaleSetStatistic struct from the scaleset package provides TotalAvailableJobs and TotalAcquiredJobs fields, but these were not being exposed as Prometheus metrics by the listener. This leaves operators without visibility into the job queue depth for their scale sets. Add two new gauge metrics to the ghalistener metrics exporter: - gha_available_jobs: jobs with matching runs-on labels waiting to be acquired by the scale set - gha_acquired_jobs: jobs acquired by the scale set but not yet assigned to a runner These metrics complete the exposure of all RunnerScaleSetStatistic fields and were originally proposed in the metrics ADR (2023-05-08-exposing-metrics.md) but never implemented. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4429
Summary
The
RunnerScaleSetStatisticstruct fromgithub.com/actions/scalesetprovides 7 fields, butRecordStatistics()only exposes 5 as Prometheus gauges. Two fields -TotalAvailableJobsandTotalAcquiredJobs- are silently dropped.These metrics were proposed in the metrics ADR as
available_jobsandacquired_jobsbut never implemented.Changes
gha_available_jobsandgha_acquired_jobsgauge metrics to the listener exporterTestRecordStatisticsExposesAllFields) verifying all 7 statistic fields are emittedvalues.yamlexamples for bothgha-runner-scale-setandgha-runner-scale-set-experimentalWhy
Without these metrics, operators cannot observe job queue depth for their scale sets:
runs-onlabels waiting to be acquiredQueue depth ≈
gha_available_jobs + gha_acquired_jobs