The listener histograms gha_job_execution_duration_seconds and gha_job_startup_duration_seconds have extremely high cardinality.
After less than a week and ~800 jobs executed they are the top 2 highest cardinality metrics in my prometheus deployment, with more series than the next 4 metrics combined.
Specifically the runner_id and runner_name labels effectively results in a new unique histogram metric for every single job the scale set runs.
This would be a problem even if the metrics were just counters, but because they're histograms you actually get
(46 bucket metrics + sum + count) * 2 (execution+startup) + 2 (gha_started_jobs_total / gha_completed_jobs_total) = 96 new unique metrics for every executed job.
Only 1 of which is useful (sum) because actually you're only recording a single number, how many seconds it took for that unique job to run.
The job_workflow_ref is also problematic especially when running jobs on the PR event as the PR numeric ID is included and will create a unique job_workflow_ref label.
Finally job_name is also a potential issue, it is effectively 'user-controlled' and jobs using matrices can and will blow this up massively.
As these histograms also persist per-listener pod the number of samples scraped (and time/cpu required) also grows forever.
If your listener pod has been running for a week you'll still be scraping the ingesting the unique metric from the first job run on that scale set a week ago.
After about a week I was ingesting 80k samples per-scrape in around 0.5s.
Restarting all the listeners dropped that to 400 samples and around 10ms.
These labels should at minimum not be enabled by default as they will eventually break any prometheus deployment that doesn't take extra action to clean them up.
This graph shows the effect on cardinality of removing the various labels

Note this is just for gha_job_execution_duration_seconds_count, you have to multiply by 96 for the actual total number of unique series.
Partial workaround is to add a metric_relabeling config to your prometheus setup like:
- source_labels: [__name__]
regex: gha_job_(execution|startup)_duration_seconds_bucket
action: drop
This will prevent scraping of the bucket and while it won't stop the sum and count metrics it should keep things under control, you'll probably want to periodically restart the listener pods as well.
The listener histograms
gha_job_execution_duration_secondsandgha_job_startup_duration_secondshave extremely high cardinality.After less than a week and ~800 jobs executed they are the top 2 highest cardinality metrics in my prometheus deployment, with more series than the next 4 metrics combined.
Specifically the
runner_idandrunner_namelabels effectively results in a new unique histogram metric for every single job the scale set runs.This would be a problem even if the metrics were just counters, but because they're histograms you actually get
(46 bucket metrics + sum + count) * 2 (execution+startup) + 2 (gha_started_jobs_total / gha_completed_jobs_total) = 96 new unique metrics for every executed job.
Only 1 of which is useful (sum) because actually you're only recording a single number, how many seconds it took for that unique job to run.
The
job_workflow_refis also problematic especially when running jobs on the PR event as the PR numeric ID is included and will create a uniquejob_workflow_reflabel.Finally
job_nameis also a potential issue, it is effectively 'user-controlled' and jobs using matrices can and will blow this up massively.As these histograms also persist per-listener pod the number of samples scraped (and time/cpu required) also grows forever.
If your listener pod has been running for a week you'll still be scraping the ingesting the unique metric from the first job run on that scale set a week ago.
After about a week I was ingesting 80k samples per-scrape in around 0.5s.
Restarting all the listeners dropped that to 400 samples and around 10ms.
These labels should at minimum not be enabled by default as they will eventually break any prometheus deployment that doesn't take extra action to clean them up.
This graph shows the effect on cardinality of removing the various labels

Note this is just for
gha_job_execution_duration_seconds_count, you have to multiply by 96 for the actual total number of unique series.Partial workaround is to add a metric_relabeling config to your prometheus setup like:
This will prevent scraping of the bucket and while it won't stop the sum and count metrics it should keep things under control, you'll probably want to periodically restart the listener pods as well.