gitlab-exporter
can help you build an observability and analytics solution to
gain insights into your CI pipelines.
It fetches data from the GitLab API and sends it to one or more recorders. These recorders then can store it in a datastore of their choosing.
The communication between the exporter and recorders is defined as a gRPC service using protocol buffers where the exporter acts as a client and the recorders implement the server interface. This allows the data to be flexibly stored in various storage backends.
There are recorder implementations available for the following datastore backends:
To install gitlab-exporter
you can download a
prebuilt binary that matches your system, e.g.
# download latest release distribution archive
RELEASE_TAG=$(curl -sSfL https://api.github.com/repos/cluttrdev/gitlab-exporter/releases/latest | jq -r '.tag_name')
curl -sSfL \
--output /tmp/gitlab-exporter.tar.gz \
--url https://github.com/cluttrdev/gitlab-exporter/releases/download/${RELEASE_TAG}/gitlab-exporter_${RELEASE_TAG}_linux_amd64.tar.gz
# extract executable binary
tar -zxof /tmp/gitlab-exporter.tar.gz gitlab-exporter
# check
./gitlab-exporter version
docker run -it --rm ghcr.io/cluttrdev/gitlab-exporter:latest
If you want to deploy on Kubernetes there is a Helm chart you can use:
helm pull oci://ghcr.io/cluttrdev/gitlab-exporter
gitlab-exporter
can either run in daemon mode or execute one-off
commands.
To run gitlab-exporter
in daemon mode use:
gitlab-exporter run --config CONFIG_FILE
This will periodically fetch data of the configured projects and send it to a list of recorders. See Configuration for configuration options.
gitlab-exporter
supports a number of commands that can be executed
individually. Use the following to get an overview of available commands:
gitlab-exporter -h
Configuration options can be specified in a config file that is passed to the
application using the --config
command-line flag.
For an overview of available configuration options and their default values, see configs/gitlab-exporter.yaml.
Some options can also be overriden with command-line flags and/or environment variables, where flags take precedence.
Flag | Environment Variable | Default Value |
---|---|---|
# global options | ||
--gitlab-url | GLE_GITLAB_URL |
"https://gitlab.com" |
--gitlab-token | GLE_GITLAB_TOKEN |
required |
# run options | ||
--log-level | GLE_LOG_LEVEL |
"info" |
--log-format | GLE_LOG_FORMAT |
"text" |
This project was inspired by Maxime Visonneau's gitlab-ci-pipeline-exporter.
The project logo is based on the original artwork created by Ashley McNamara.
This project is licensed under the MIT License.