Skip to content

Enable optional creation of k8s Service and ServiceMonitor objects for the integrated Prometheus metrics exporter

Feature Request

Add Helm values controlling the creation of Kubernetes (not GitLab CI) Service and ServiceMonitor objects. Perhaps default to enabled: false in order to provide backwards compatibility.

Example solution showing new values.yaml

  metrics:
    enabled: true
+   service:
+     enabled: true
+   serviceMonitor:
+     enabled: true

Note that knowledge of Prometheus is already baked into the Helm chart in the form of prometheus.io/* annotations.

The widely used prometheus-operator does not support the scrape annotations, and only uses ServiceMonitors.

Current Workaround

Today, we have to deploy a "sidecar" helm chart with every GitLab runner in order to create the Service and ServiceMonitor for the gitlab-runner metrics listener port. This adds overhead, duplication, and complexity which could be eliminated with a simple enhancement to this chart.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information