GitLab
Prometheus Metrics
GitLab is a comprehensive DevOps platform that exposes Prometheus metrics on dedicated ports for its various components.
Prometheus Metrics
Section titled “Prometheus Metrics”Service Configuration
Section titled “Service Configuration”In GitLab Omnibus installations, Prometheus monitoring is enabled by default. To allow Glouton to scrape metrics from localhost, edit /etc/gitlab/gitlab.rb and ensure the following settings are present:
# Allow local access to metricsgitlab_rails['monitoring_whitelist'] = ['127.0.0.1']
# Ensure Prometheus metrics are enabled (default: true)gitlab_rails['prometheus_monitoring_enabled'] = trueAfter editing, reconfigure GitLab:
sudo gitlab-ctl reconfigureGitLab exposes metrics on several dedicated ports:
| Component | Endpoint | Default Port |
|---|---|---|
| Puma (Rails) | /-/metrics | 9168 |
| Gitaly | /metrics | 9236 |
| GitLab Workhorse | /metrics | 9229 |
| GitLab Exporter | /metrics | 9168 |
Glouton Configuration
Section titled “Glouton Configuration”The example below targets the Puma/Rails endpoint and Gitaly. You can add more targets for other GitLab components (Workhorse, Sidekiq, etc.) following the same pattern with the appropriate port.
sudo tee /etc/glouton/conf.d/99-gitlab.conf > /dev/null << 'EOF'metric: prometheus: targets: - url: "http://localhost:9168/-/metrics" name: "gitlab" allow_metrics: - "http_requests_total" - "ruby_process_resident_memory_bytes" - "gitlab_transaction_duration_seconds*" - "gitlab_sql_duration_seconds*" - url: "http://localhost:9236/metrics" name: "gitaly" allow_metrics: - "gitaly_connections_total" - "gitaly_*"EOFCreate or edit C:\ProgramData\glouton\conf.d\99-gitlab.conf:
metric: prometheus: targets: - url: "http://localhost:9168/-/metrics" name: "gitlab" allow_metrics: - "http_requests_total" - "ruby_process_resident_memory_bytes" - "gitlab_transaction_duration_seconds*" - "gitlab_sql_duration_seconds*" - url: "http://localhost:9236/metrics" name: "gitaly" allow_metrics: - "gitaly_connections_total" - "gitaly_*"| Metric | Description |
|---|---|
http_requests_total | Total number of HTTP requests handled |
ruby_process_resident_memory_bytes | Resident memory size of the Ruby process |
gitlab_transaction_duration_seconds | Duration of Rails controller transactions |
gitlab_sql_duration_seconds | Time spent on SQL queries |
gitaly_connections_total | Total number of Gitaly connections |