gitlab_metrics.md 3.0 KB
Newer Older
1 2 3
# GitLab Prometheus metrics

>**Note:**
4 5
Available since [Omnibus GitLab 9.3][29118]. Currently experimental. For
installations from source you'll have to configure it yourself.
6 7 8 9 10 11 12 13 14 15

To enable the GitLab Prometheus metrics:

1. Log into GitLab as an administrator, and go to the Admin area.
1. Click on the gear, then click on Settings.
1. Find the `Metrics - Prometheus` section, and click `Enable Prometheus Metrics`
1. [Restart GitLab][restart] for the changes to take effect

## Collecting the metrics

16 17 18
GitLab monitors its own internal service metrics, and makes them available at the
`/-/metrics` endpoint. Unlike other [Prometheus] exporters, in order to access
it, the client IP needs to be [included in a whitelist][whitelist].
19

20 21 22 23
Currently the embedded Prometheus server is not automatically configured to
collect metrics from this endpoint. We recommend setting up another Prometheus
server, because the embedded server configuration is overwritten once every
[reconfigure of GitLab][reconfigure]. In the future this will not be required.
24 25 26 27 28

## Metrics available

In this experimental phase, only a few metrics are available:

B
Ben Kochie 已提交
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| Metric                            | Type      | Description |
| --------------------------------- | --------- | ----------- |
| db_ping_timeout                   | Gauge     | Whether or not the last database ping timed out |
| db_ping_success                   | Gauge     | Whether or not the last database ping succeeded |
| db_ping_latency_seconds           | Gauge     | Round trip time of the database ping |
| filesystem_access_latency_seconds | Gauge     | Latency in accessing a specific filesystem |
| filesystem_accessible             | Gauge     | Whether or not a specific filesystem is accessible |
| filesystem_write_latency_seconds  | Gauge     | Write latency of a specific filesystem |
| filesystem_writable               | Gauge     | Whether or not the filesystem is writable |
| filesystem_read_latency_seconds   | Gauge     | Read latency of a specific filesystem |
| filesystem_readable               | Gauge     | Whether or not the filesystem is readable |
| http_requests_total               | Counter   | Rack request count |
| http_request_duration_seconds     | Histogram | HTTP response time from rack middleware |
| rack_uncaught_errors_total        | Counter   | Rack connections handling uncaught errors count |
| redis_ping_timeout                | Gauge     | Whether or not the last redis ping timed out |
| redis_ping_success                | Gauge     | Whether or not the last redis ping succeeded |
| redis_ping_latency_seconds        | Gauge     | Round trip time of the redis ping |
B
Ben Kochie 已提交
46
| user_session_logins_total         | Counter   | Counter of how many users have logged in |
47 48 49 50 51 52

[← Back to the main Prometheus page](index.md)

[29118]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29118
[Prometheus]: https://prometheus.io
[restart]: ../../restart_gitlab.md#omnibus-gitlab-restart
53 54
[whitelist]: ../ip_whitelist.md
[reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure