Skip to content

gha_job_execution_duration_seconds Prometheus metrics cannot be used for histograms #3555

Description

@thomassandslyst

Checks

Controller Version

0.9.2

Deployment Method

ArgoCD

Checks

  • This isn't a question or user support case (For Q&A and community support, go to Discussions).
  • I've read the Changelog before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes

To Reproduce

1. Install the gha-runner-scale-set controller and a listener and successfully run jobs.
2. Enable controller and listener metrics.
3. Try and create a histogram of startup or execution time using the standard Prometheus functions

Describe the bug

The labels on both gha_job_execution_duration_seconds and gha_job_startup_duration_seconds metrics mean that a new bucket is created for every run on every job, this means that every bucket will only ever contain a 0 or a 1. You cannot get meaningful information out of these metrics.

Prometheus is unable to aggregate metrics before applying rate() on them to produce histograms, so with the current layout of these metrics it is impossible to produce a histogram of startup or execution durations.

Describe the expected behavior

The gha_job_execution_duration_seconds and gha_job_startup_duration_seconds metrics should have less labels as to reduce cardinality.

Information should be put into buckets based on job_name, organisation, and repository only. Highly unique labels such as runner_id, runner_name, and job_workflow_ref should be removed.

Additional Context

N/A

Controller Logs

It says never to omit but this issue doesn't relate to controller logs.
N/A

Runner Pod Logs

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggha-runner-scale-setRelated to the gha-runner-scale-set modeneeds triageRequires review from the maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions