Resolve "Allow for optionall exposing the gitlab runner metrics server for Prometheus monitoring"
requested to merge 16-allow-for-optionall-exposing-the-gitlab-runner-metrics-server-for-prometheus-monitoring into main
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 thegitlab-runner run --listen-address
method but this is a blocking call, which won't work for IaC provisioning - Moves
gitlab-runner start
command out frominstall_gitlab_runner
function tostart_gitlab_runner
function and refactorsuser-data.sh
to use this separate function at the appropriate time. - Expands example to include this monitoring capability via the insecure
:9252
method for all servers tocurl 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.