Resolve "Allow for optionall exposing the gitlab runner metrics server for Prometheus monitoring"
Closes #16 (closed)
Work includes:
- Adds a
runner_listen_addressinput 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_runnerfunction 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-addressmethod but this is a blocking call, which won't work for IaC provisioning - Moves
gitlab-runner startcommand out frominstall_gitlab_runnerfunction tostart_gitlab_runnerfunction and refactorsuser-data.shto use this separate function at the appropriate time. - Expands example to include this monitoring capability via the insecure
:9252method for all servers tocurl http://<gitlab runner ip>:9252/metricsto 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
curlthe runner and get the metrics in stdout, successfully.