Skip to content

Add Runner Name to Prometheus metrics

What does this MR do?

Adds a new label, runner_name, to the following Prometheus metrics:

gitlab_runner_limit
gitlab_runner_api_request_statuses_total
gitlab_runner_request_concurrency
gitlab_runner_request_concurrency_exceeded_total

Eg.

gitlab_runner_api_request_statuses_total{endpoint="request_job",runner="Tp7YdgyU",runner_name="My-Runner-Name",status="204"} 1
gitlab_runner_limit{runner="Tp7YdgyU",runner_name="My-Runner-Name"} 0
gitlab_runner_request_concurrency{runner="Tp7YdgyU",runner_name="My-Runner-Name"} 1
gitlab_runner_request_concurrency_exceeded_total{runner="Tp7YdgyU",runner_name="My-Runner-Name"} 0

Why was this MR needed?

As mentioned in #26660, we have a naming convention for runners used to describe their purpose. We have dashboards setup to see usage of the different types of runners, but we have to remember the runner IDs. This change allows us to see those names in dashboards and also consolidate on certain naming patterns.

What's the best way to test this MR?

Start the Gitlab Runner with the metrics enabled. Going to the metrics page (http://localhost:9252/metrics) will show the above metrics with the runner_name label.

What are the relevant issue numbers?

#26660

Merge request reports

Loading