Skip to content

app-sre/gitlab-project-exporter

Repository files navigation

gitlab-project-exporter

Ruff

Prometheus exporter for Gitlab projects using the Uvicorn web server

Metrics exported

Metric name Description
gitlab_remote_mirror_status Gitlab Remote Mirror status

Configuration

Env variable Mandatory Default Description
PROJECT_IDS Yes Gitlab Project IDS, e.g. '[ "user/project" ]'
GITLAB_URL No https://gitlab.com GitLab Base URL
GITLAB_SSL_VERIFY No true Whether to verify SSL certs for GitLab API queries
LOG_LEVEL No INFO Log level for Uvicorn
UVICORN_HOST No 0.0.0.0 Uvicorn host
UVICORN_PORT No 8080 Uvicorn port
UVICORN_RELOAD No false Uvicorn watches for files changed to reload

Development

Prepare your dev environment

Create a virtual environment for the project:

$ poetry install

Get a GitLab personal access token

See https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

Start server

export GITLAB_TOKEN="<your-personal-access-token>"
export PROJECT_IDS='["one/project","another/project"]'
./dev.sh

Getting metrics

curl localhost:8080/metrics/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •