Monitoring


Monitoring

GitLab ships with Prometheus

Grafana was removed in 16.3.0 (August 2023)

All components expose metrics

GitLab includes Prometheus exporters for all components

GitLab provides custom dashboards for import into Grafana

How Prometheus works

Exporter providers an HTTP endpoint with metrics

Prometheus scrapes metrics from exporter regularly


Hands-On

  1. Start Grafana next to GitLab

     cd ../170_monitoring
     docker compose \
         --project-name gitlab \
         --file ../100_reverse_proxy/compose.yml \
         --file ../135_integrations/compose.yml \
         --file ../160_runner/compose.yml \
         --file ./compose.yml \
         up -d
    
  2. Create datasource of type Prometheus with URL http://gitlab:9090

  3. Import dashboard with ID 5774 (more dashboards )

  4. Add link to Grafana: Admin Area Settings Metrics and profiling Metrics - Grafana

  5. Find link under: Admin Area Monitoring Metrics Dashboard


Authenticate Grafana against GitLab

Use GitLab as authentication provider in Grafana

This requires TLS to work

  1. Create application in GitLab
    • Name: Grafana
    • Redirect URI: https://grafana.seatN.inmylab.de/login/gitlab
    • Scopes: openid, profile, email
  2. Configure Grafana
    • URL: http://gitlab:80
    • Client ID: <ID>
    • Client Secret: <Secret>
    • Auth URL: https://gitlab.seatN.inmylab.de/oauth/authorize
    • Token URL: https://gitlab.seatN.inmylab.de/oauth/token

GitLab CI Pipelines Exporter (GCPE)

Prometheus exporter for pipelines collecting…

Meant to run as daemon

Regularly checks configured projects

Regularly discovers new projects