Gitlab-Monitor Metrics "ci_running_builds" has wrong value in "shared_runner" label
Summary
We just activated gitlab monitor metrics on our self-hosted premium ee instance, with an external Prometheus.
I've noticed the following gauge:
What is the current bug behavior?
When getting http://example.gitlab.com:9168/metrics:
...
ci_running_builds{has_minutes="yes",mirror="no",mirror_trigger_builds="no",namespace="",runner="60",scheduled="no",shared_runner="no",triggered="no"} 2
...
Runner number 60 exists, but is "shared" and "locked" as our Admin UI shows. It is not restricted to any project or group and is an instance wide runner, version 11.8.0.
Steps to reproduce
- Create a gitlab-runner, with executor = "docker", on a VM. Runner is configured to accept unprotected branches, and to accept untagged builds.
- Make any pipeline use that runner. The pipeline I used had no
tags:value in the .gitlab-ci.yml - Check http://example.gitlab.com:9168/metrics for "ci_*"
What is the expected correct behavior?
Having label/value: shared_runner="yes".
Others:
- I've noticed
ci_created_builds{has_minutes="yes",namespace="",shared_runners="yes"}. This might be a typo: "shared_runners" (plural) as a label forci_created_builds, but shared_runner (singular) for theci_running_builds -
namespace="": is this normal also? Namespace is usually known. - Gitlab is v11.8.0
- There are a couple other points that might warrant attention.
ci_stale_buildshas no labels for example, but without the help comment from the metrics, I believe we could at least have the "namespace" label.
Misc
What I'm trying to achieve is a Grafana board via Prometheus and GitLab exported metrics to show: Current running, blocked, pending, and created number of jobs.
Edited by 🤖 GitLab Bot 🤖