- Prometheus and the various exporters listed in this page are bundled in the
- 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 them yourself. Over subsequent releases additional GitLab metrics will be captured.
Omnibus GitLab package. Check each exporter's documentation for the timeline
they got added. For installations from source you will have to install them
yourself. Over subsequent releases additional GitLab metrics will be captured.
- Prometheus services are on by default with GitLab 9.0.
- Prometheus services are on by default with GitLab 9.0.
- Prometheus and its exporters do not authenticate users, and will be available to anyone who can access them.
- Prometheus and its exporters do not authenticate users, and will be available
to anyone who can access them.
[Prometheus] is a powerful time-series monitoring service, providing a flexible
[Prometheus] is a powerful time-series monitoring service, providing a flexible
platform for monitoring GitLab and other software products.
platform for monitoring GitLab and other software products.
...
@@ -22,9 +25,12 @@ dashboard tool like [Grafana].
...
@@ -22,9 +25,12 @@ dashboard tool like [Grafana].
## Configuring Prometheus
## Configuring Prometheus
>**Note:**
>**Note:**
-For installations from source you'll have to install and configure it yourself.
For installations from source you'll have to install and configure it yourself.
Prometheus and it's exporters are on by default, starting with GitLab 9.0. Prometheus will run as the `gitlab-prometheus` user and listen on `http://localhost:9090`. Each exporter will be automatically be set up as a monitoring target for Prometheus, unless individually disabled.
Prometheus and it's exporters are on by default, starting with GitLab 9.0.
Prometheus will run as the `gitlab-prometheus` user and listen on
`http://localhost:9090`. Each exporter will be automatically be set up as a
monitoring target for Prometheus, unless individually disabled.
To disable Prometheus and all of its exporters, as well as any added in the future:
To disable Prometheus and all of its exporters, as well as any added in the future:
...
@@ -88,12 +94,15 @@ Sample Prometheus queries:
...
@@ -88,12 +94,15 @@ Sample Prometheus queries:
## Configuring Prometheus to monitor Kubernetes
## Configuring Prometheus to monitor Kubernetes
>**Note:**
> Introduced in GitLab 9.0.
This feature was introduced in GitLab 9.0.
If your GitLab server is running within Kubernetes, an option is now available to monitor the health of each node in the cluster. This is particularly helpful if your CI/CD environments run in the same cluster, and you would like enable [Prometheus integration][] to monitor them.
If your GitLab server is running within Kubernetes, an option is now available
to monitor the health of each node in the cluster. This is particularly helpful
if your CI/CD environments run in the same cluster, and you would like enable
[Prometheus integration][] to monitor them.
When enabled, the bundled Prometheus server monitors Kubernetes and automatically [collects metrics](prometheus-cadvisor-metrics) from each Node in the cluster.
When enabled, the bundled Prometheus server monitors Kubernetes and automatically
[collects metrics][prometheus-cadvisor-metrics] from each Node in the cluster.
@@ -150,9 +150,13 @@ On a very active server (10,000 active users) the Sidekiq process can use 1GB+ o
...
@@ -150,9 +150,13 @@ On a very active server (10,000 active users) the Sidekiq process can use 1GB+ o
## Prometheus and its exporters
## Prometheus and its exporters
As of GitLab 9.0, [Prometheus](https://prometheus.io) and its related exporters are enabled by default, to enable easy and in depth monitoring of GitLab. Approximately 200MB of memory will be consumed by these processes, with default settings.
As of Omnibus GitLab 9.0, [Prometheus](https://prometheus.io) and its related
exporters are enabled by default, to enable easy and in depth monitoring of
GitLab. Approximately 200MB of memory will be consumed by these processes, with
default settings.
If you would like to disable Prometheus and it's exporters, simply set `prometheus['disable_all']=true` in `gitlab.rb`. More information is available in [the documentation](https://docs.gitlab.com/ce/doc/administration/monitoring/prometheus/index.html).
If you would like to disable Prometheus and it's exporters or read more information
about it, check the [Prometheus documentation](../administration/monitoring/prometheus/index.md).
[configuring the Prometheus project service in GitLab](#configuration-in-gitlab).
[configuring the Prometheus project service in GitLab](##configuration-in-gitlab).
### Configuring your own Prometheus server within Kubernetes
### Configuring your own Prometheus server within Kubernetes
...
@@ -156,18 +158,30 @@ The queries utilized by GitLab are shown in the following table.
...
@@ -156,18 +158,30 @@ The queries utilized by GitLab are shown in the following table.
## Monitoring CI/CD Environments
## Monitoring CI/CD Environments
Once configured, GitLab will attempt to retrieve performance metrics for any environment which has had a successful deployment. If monitoring data was successfully retrieved, a metrics button will appear on the environment's detail page.
Once configured, GitLab will attempt to retrieve performance metrics for any
environment which has had a successful deployment. If monitoring data was
successfully retrieved, a metrics button will appear on the environment's
detail page.
![Environment Detail with Metrics](img/prometheus_environment_detail_with_metrics.png)
![Environment Detail with Metrics](img/prometheus_environment_detail_with_metrics.png)
Clicking on the metrics button will display a new page, showing up to the last 8 hours of performance data. It may take a minute or two for data to appear after initial deployment.
Clicking on the metrics button will display a new page, showing up to the last
8 hours of performance data. It may take a minute or two for data to appear
after initial deployment.
## Troubleshooting
## Troubleshooting
If the metrics button is not appearing, then one of a few issues may be occurring:
If the metrics button is not appearing, then one of a few issues may be
- GitLab is not able to reach the Prometheus server. A test request can be sent to the Prometheus server from the [Prometheus Service](#configuration-in-gitlab) configuration screen.
occurring:
- GitLab is not able to reach the Prometheus server. A test request can be sent
to the Prometheus server from the [Prometheus Service](#configuration-in-gitlab)
configuration screen.
- No successful deployments have occurred to this environment.
- No successful deployments have occurred to this environment.
- Prometheus does not have performance data for this environment, or the metrics are not labeled correctly. To test this, connect to the Prometheus server and run a [query](#gitlab-prometheus-queries), replacing $CI_ENVIRONMENT_SLUG with the name of your environment.
- Prometheus does not have performance data for this environment, or the metrics
are not labeled correctly. To test this, connect to the Prometheus server and
[run a query](#gitlab-prometheus-queries), replacing `$CI_ENVIRONMENT_SLUG`