index.md 3.9 KB
Newer Older
1 2 3
# GitLab Prometheus

>**Notes:**
4 5 6
- Prometheus and the various exporters listed in this page are bundled in the
  Omnibus GitLab package. Check each exporter's documentation for the timeline
  they got added. For installations from source you will have to install
7 8 9 10 11 12 13 14 15 16 17 18
  them yourself. Over subsequent releases additional GitLab metrics will be
  captured.
- Prometheus services are off by default but will be on starting with GitLab 9.0.

[Prometheus] is a powerful time-series monitoring service, providing a flexible
platform for monitoring GitLab and other software products.
GitLab provides out of the box monitoring with Prometheus, providing easy
access to high quality time-series monitoring of GitLab services.

## Overview

Prometheus works by periodically connecting to data sources and collecting their
19 20 21 22
performance metrics via the [various exporters](#prometheus-exporters). To view
and work with the monitoring data, you can either
[connect directly to Prometheus](#viewing-performance-metrics) or utilize a
dashboard tool like [Grafana].
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

## Configuring Prometheus

>**Note:**
Available since Omnibus GitLab 8.16. For installations from source you'll
have to install and configure it yourself.

To enable Prometheus:

1. Edit `/etc/gitlab/gitlab.rb`
1. Find and uncomment the following line, making sure it's set to `true`:

    ```ruby
    prometheus['enable'] = true
    ```

1. Save the file and [reconfigure GitLab][reconfigure] for the changes to
   take effect

By default, Prometheus will run as the `gitlab-prometheus` user and listen on
TCP port `9090` under localhost. If the [node exporter](#node-exporter) service
has been enabled, it will automatically be set up as a monitoring target for
Prometheus.

47
## Viewing performance metrics
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

After you have [enabled Prometheus](#configuring-prometheus), you can visit
`<your_domain_name>:9090` for the dashboard that Prometheus offers by default.

The performance data collected by Prometheus can be viewed directly in the
Prometheus console or through a compatible dashboard tool.
The Prometheus interface provides a [flexible query language][prom-query] to work
with the collected data where you can visualize their output.
For a more fully featured dashboard, Grafana can be used and has
[official support for Prometheus][prom-grafana].

## Prometheus exporters

There are a number of libraries and servers which help in exporting existing
metrics from third-party systems as Prometheus metrics. This is useful for cases
where it is not feasible to instrument a given system with Prometheus metrics
directly (for example, HAProxy or Linux system stats). You can read more in the
65
[Prometheus exporters and integrations upstream documentation][prom-exporters].
66 67 68 69 70 71 72

While you can use any exporter you like with your GitLab installation, the
following ones documented here are bundled in the Omnibus GitLab packages
making it easy to configure and use.

### Node exporter

73
The node exporter allows you to measure various machine resources such as
74 75
memory, disk and CPU utilization.

76
[➔ Read more about the node exporter.](node_exporter.md)
77

78 79 80 81 82 83
### Redis exporter

The Redis exporter allows you to measure various Redis metrics.

[➔ Read more about the Redis exporter.](redis_exporter.md)

84 85 86 87 88 89
### Postgres exporter

The Postgres exporter allows you to measure various PostgreSQL metrics.

[➔ Read more about the Postgres exporter.](postgres_exporter.md)

90 91 92 93 94 95
### GitLab monitor exporter

The GitLab monitor exporter allows you to measure various GitLab metrics.

[➔ Read more about the GitLab monitor exporter.](gitlab_monitor_exporter.md)

96 97 98 99 100 101 102
[grafana]: https://grafana.net
[prometheus]: https://prometheus.io
[prom-query]: https://prometheus.io/docs/querying/basics
[prom-grafana]: https://prometheus.io/docs/visualization/grafana/
[scrape-config]: https://prometheus.io/docs/operating/configuration/#%3Cscrape_config%3E
[prom-exporters]: https://prometheus.io/docs/instrumenting/exporters/
[reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure