Exposes metrics for your repositories from the Gitlab API, to a Prometheus compatible endpoint.
This exporter is setup to take input from environment variables. All variables are optional:
GROUPS
If supplied, the exporter will enumerate all repositories for that group. Expected in the format "group1, group2".REPOS
If supplied, The repos you wish to monitor, expected in the format "group/repo1, group/repo2". Can be across different Gitlab users/orgs.GITLAB_TOKEN
- gitlab authentication token that allows the API to be queried. If none supplied, the exporter will only have access to public repos. The token must haveread_api
access.GITLAB_TOKEN_FILE
If supplied instead ofGITLAB_TOKEN
, enables the user to supply a path to a file containing a gitlab authentication token.API_URL
Gitlab API URLLOG_LEVEL
The level of logging the exporter will run with, defaults todebug
Build a docker image:
docker build -t <image-name> .
docker tag <built_image_hash> gitlab-exporter:latest