gitlab-exporter
can help you build an observability and analytics solution to
gain insights into your CI pipelines.
It provides the protocol buffer schemas and client implementation
for a gRPC service to record data fetched from the GitLab API.
This allows the data to be exported and stored in various storage backends by
implementing the correspondong gRPC server interface.
The following server implementations are available:
To install gitlab-exporter
you can download a
prebuilt binary that matches your system, e.g.
# download latest release archive
RELEASE_TAG=$(curl -sSfL https://api.github.com/repos/cluttrdev/gitlab-exporter/releases/latest | jq -r '.tag_name')
curl -sSfL -o /tmp/gitlab-exporter.tar.gz \
https://github.com/cluttrdev/gitlab-exporter/releases/download/${RELEASE_TAG}/gitlab-exporter_${RELEASE_TAG}_linux_amd64.tar.gz
# extract executable binary into install dir (must exist)
INSTALL_DIR=$HOME/.local/bin
tar -C ${INSTALL_DIR} -zxof /tmp/gitlab-exporter.tar.gz gitlab-exporter
Alternatively, if you have the Go tools installed on your machine, you can use
go install github.com/cluttrdev/gitlab-exporter@latest
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 configured gRPC server endpoints. 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-api-url | GLE_GITLAB_API_URL |
"https://gitlab.com/api/v4" |
--gitlab-api-token | GLE_GITLAB_API_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.