Skip to content

Resolve "Allow for optionall exposing the gitlab runner metrics server for Prometheus monitoring"

Closes #16 (closed)

Work includes:

  • Adds a runner_listen_address input variable for adding output of Prometheus-ready metrics from runner on host:port for the Prometheus server (or ":" only to allow any IP; warning: security vulnerability)
  • Adds a configure_gitlab_runner function to the configuration bash scripting that currently sets the listen address for the runner via the config.toml. Tried to use the gitlab-runner run --listen-address method but this is a blocking call, which won't work for IaC provisioning
  • Moves gitlab-runner start command out from install_gitlab_runner function to start_gitlab_runner function and refactors to use this separate function at the appropriate time.
  • Expands example to include this monitoring capability via the insecure :9252 method for all servers to curl http://<gitlab runner ip>:9252/metrics to test runner monitoring metrics

My testing:

  • Used example to spin up gitlab-runner with the 9252 port open for the HTTP Prometheus-ready metrics server for all IP addresses (:9252)
  • Was able to curl the runner and get the metrics in stdout, successfully.

Merge request reports