From 1498786e4a72be103e2b1ffb36836117840caed2 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 8 Feb 2017 11:38:24 +0100 Subject: [PATCH 01/13] Move prometheus docs into their own dir [ci skip] --- doc/README.md | 2 +- .../monitoring/performance/introduction.md | 2 +- .../monitoring/performance/prometheus.md | 103 +----------------- .../monitoring/prometheus/index.md | 102 +++++++++++++++++ 4 files changed, 105 insertions(+), 104 deletions(-) create mode 100644 doc/administration/monitoring/prometheus/index.md diff --git a/doc/README.md b/doc/README.md index 78030ce4e72..1943d656aa7 100644 --- a/doc/README.md +++ b/doc/README.md @@ -56,7 +56,7 @@ - [Housekeeping](administration/housekeeping.md) Keep your Git repository tidy and fast. - [GitLab Pages configuration](administration/pages/index.md) Configure GitLab Pages. - [GitLab performance monitoring with InfluxDB](administration/monitoring/performance/introduction.md) Configure GitLab and InfluxDB for measuring performance metrics. -- [GitLab performance monitoring with Prometheus](administration/monitoring/performance/prometheus.md) Configure GitLab and Prometheus for measuring performance metrics. +- [GitLab performance monitoring with Prometheus](administration/monitoring/prometheus/index.md) Configure GitLab and Prometheus for measuring performance metrics. - [Request Profiling](administration/monitoring/performance/request_profiling.md) Get a detailed profile on slow requests. - [Monitoring uptime](user/admin_area/monitoring/health_check.md) Check the server status using the health check endpoint. - [Debugging Tips](administration/troubleshooting/debug.md) Tips to debug problems when things go wrong diff --git a/doc/administration/monitoring/performance/introduction.md b/doc/administration/monitoring/performance/introduction.md index 8b106e89cc2..17c2b4b70d3 100644 --- a/doc/administration/monitoring/performance/introduction.md +++ b/doc/administration/monitoring/performance/introduction.md @@ -15,7 +15,7 @@ documents in order to understand and properly configure GitLab Performance Monit >**Note:** Omnibus GitLab 8.16 includes Prometheus as an additional tool to collect metrics. It will eventually replace InfluxDB when their metrics collection is -on par. Read more in the [Prometheus documentation](prometheus.md). +on par. Read more in the [Prometheus documentation](../prometheus/index.md). ## Introduction to GitLab Performance Monitoring diff --git a/doc/administration/monitoring/performance/prometheus.md b/doc/administration/monitoring/performance/prometheus.md index 51c63325064..d73ef5d1789 100644 --- a/doc/administration/monitoring/performance/prometheus.md +++ b/doc/administration/monitoring/performance/prometheus.md @@ -1,102 +1 @@ -# GitLab Prometheus - ->**Notes:** -- Prometheus and the node exporter are bundled in the Omnibus GitLab package - since GitLab 8.16. For installations from source you will have to install - 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 -performance metrics. To view and work with the monitoring data, you can either -connect directly to Prometheus or utilize a dashboard tool like [Grafana]. - -## 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. - -## Viewing Performance Metrics - -After you have [enabled Prometheus](#configuring-prometheus), you can visit -`: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 -[Prometheus exporters and integrations documentation][prom-exporters]. - -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 - ->**Note:** -Available since Omnibus GitLab 8.16. For installations from source you'll -have to install and configure it yourself. - -The [node exporter] allows you to measure various machine resources such as -memory, disk and CPU utilization. - -To enable the node exporter: - -1. [Enable Prometheus](#configuring-prometheus) -1. Edit `/etc/gitlab/gitlab.rb` -1. Find and uncomment the following line, making sure it's set to `true`: - - ```ruby - node_exporter['enable'] = true - ``` - -1. Save the file and [reconfigure GitLab][reconfigure] for the changes to - take effect - -Prometheus it will now automatically begin collecting performance data from -the node exporter. You can visit `:9100/metrics` for a real -time representation of the metrics that are collected. Refresh the page and -you will see the data change. - -[grafana]: https://grafana.net -[node exporter]: https://github.com/prometheus/node_exporter -[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 +This document was moved to [monitoring/prometheus](../prometheus/index.md). diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md new file mode 100644 index 00000000000..51c63325064 --- /dev/null +++ b/doc/administration/monitoring/prometheus/index.md @@ -0,0 +1,102 @@ +# GitLab Prometheus + +>**Notes:** +- Prometheus and the node exporter are bundled in the Omnibus GitLab package + since GitLab 8.16. For installations from source you will have to install + 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 +performance metrics. To view and work with the monitoring data, you can either +connect directly to Prometheus or utilize a dashboard tool like [Grafana]. + +## 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. + +## Viewing Performance Metrics + +After you have [enabled Prometheus](#configuring-prometheus), you can visit +`: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 +[Prometheus exporters and integrations documentation][prom-exporters]. + +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 + +>**Note:** +Available since Omnibus GitLab 8.16. For installations from source you'll +have to install and configure it yourself. + +The [node exporter] allows you to measure various machine resources such as +memory, disk and CPU utilization. + +To enable the node exporter: + +1. [Enable Prometheus](#configuring-prometheus) +1. Edit `/etc/gitlab/gitlab.rb` +1. Find and uncomment the following line, making sure it's set to `true`: + + ```ruby + node_exporter['enable'] = true + ``` + +1. Save the file and [reconfigure GitLab][reconfigure] for the changes to + take effect + +Prometheus it will now automatically begin collecting performance data from +the node exporter. You can visit `:9100/metrics` for a real +time representation of the metrics that are collected. Refresh the page and +you will see the data change. + +[grafana]: https://grafana.net +[node exporter]: https://github.com/prometheus/node_exporter +[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 From 5c718b82611131ab206b402fca1d34daff0cef86 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 8 Feb 2017 13:40:11 +0100 Subject: [PATCH 02/13] Split node_exporter to its own page --- .../monitoring/prometheus/index.md | 40 +++++-------------- .../monitoring/prometheus/node_exporter.md | 32 +++++++++++++++ 2 files changed, 43 insertions(+), 29 deletions(-) create mode 100644 doc/administration/monitoring/prometheus/node_exporter.md diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index 51c63325064..f1e4f9442fc 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -1,8 +1,9 @@ # GitLab Prometheus >**Notes:** -- Prometheus and the node exporter are bundled in the Omnibus GitLab package - since GitLab 8.16. For installations from source you will have to install +- 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. - Prometheus services are off by default but will be on starting with GitLab 9.0. @@ -15,8 +16,10 @@ access to high quality time-series monitoring of GitLab services. ## Overview Prometheus works by periodically connecting to data sources and collecting their -performance metrics. To view and work with the monitoring data, you can either -connect directly to Prometheus or utilize a dashboard tool like [Grafana]. +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]. ## Configuring Prometheus @@ -41,7 +44,7 @@ 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. -## Viewing Performance Metrics +## Viewing performance metrics After you have [enabled Prometheus](#configuring-prometheus), you can visit `:9090` for the dashboard that Prometheus offers by default. @@ -59,7 +62,7 @@ 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 -[Prometheus exporters and integrations documentation][prom-exporters]. +[Prometheus exporters and integrations upstream documentation][prom-exporters]. While you can use any exporter you like with your GitLab installation, the following ones documented here are bundled in the Omnibus GitLab packages @@ -67,33 +70,12 @@ making it easy to configure and use. ### Node exporter ->**Note:** -Available since Omnibus GitLab 8.16. For installations from source you'll -have to install and configure it yourself. - -The [node exporter] allows you to measure various machine resources such as +The node exporter allows you to measure various machine resources such as memory, disk and CPU utilization. -To enable the node exporter: - -1. [Enable Prometheus](#configuring-prometheus) -1. Edit `/etc/gitlab/gitlab.rb` -1. Find and uncomment the following line, making sure it's set to `true`: - - ```ruby - node_exporter['enable'] = true - ``` - -1. Save the file and [reconfigure GitLab][reconfigure] for the changes to - take effect - -Prometheus it will now automatically begin collecting performance data from -the node exporter. You can visit `:9100/metrics` for a real -time representation of the metrics that are collected. Refresh the page and -you will see the data change. +[➔ Read more about the node exporter.](node_exporter.md) [grafana]: https://grafana.net -[node exporter]: https://github.com/prometheus/node_exporter [prometheus]: https://prometheus.io [prom-query]: https://prometheus.io/docs/querying/basics [prom-grafana]: https://prometheus.io/docs/visualization/grafana/ diff --git a/doc/administration/monitoring/prometheus/node_exporter.md b/doc/administration/monitoring/prometheus/node_exporter.md new file mode 100644 index 00000000000..d23589192b2 --- /dev/null +++ b/doc/administration/monitoring/prometheus/node_exporter.md @@ -0,0 +1,32 @@ +# Node exporter + +>**Note:** +Available since Omnibus GitLab 8.16. For installations from source you'll +have to install and configure it yourself. + +The [node exporter] allows you to measure various machine resources such as +memory, disk and CPU utilization. + +To enable the node exporter: + +1. [Enable Prometheus](index.md#configuring-prometheus) +1. Edit `/etc/gitlab/gitlab.rb` +1. Find and uncomment the following line, making sure it's set to `true`: + + ```ruby + node_exporter['enable'] = true + ``` + +1. Save the file and [reconfigure GitLab][reconfigure] for the changes to + take effect + +Prometheus it will now automatically begin collecting performance data from +the node exporter. You can visit `:9100/metrics` for a real +time representation of the metrics that are collected. Refresh the page and +you will see the data change. + +[← Back to the main Prometheus page](index.md) + +[node exporter]: https://github.com/prometheus/node_exporter +[prometheus]: https://prometheus.io +[reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure From a28f3f73c612ed28ab72789e2be52f541498aeaa Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 8 Feb 2017 14:29:02 +0100 Subject: [PATCH 03/13] Add Redis exporter to Prometheus docs --- .../monitoring/prometheus/index.md | 6 ++++ .../monitoring/prometheus/redis_exporter.md | 33 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 doc/administration/monitoring/prometheus/redis_exporter.md diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index f1e4f9442fc..5915179e14e 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -75,6 +75,12 @@ memory, disk and CPU utilization. [➔ Read more about the node exporter.](node_exporter.md) +### Redis exporter + +The Redis exporter allows you to measure various Redis metrics. + +[➔ Read more about the Redis exporter.](redis_exporter.md) + [grafana]: https://grafana.net [prometheus]: https://prometheus.io [prom-query]: https://prometheus.io/docs/querying/basics diff --git a/doc/administration/monitoring/prometheus/redis_exporter.md b/doc/administration/monitoring/prometheus/redis_exporter.md new file mode 100644 index 00000000000..aec5279b06d --- /dev/null +++ b/doc/administration/monitoring/prometheus/redis_exporter.md @@ -0,0 +1,33 @@ +# Redis exporter + +>**Note:** +Available since [Omnibus GitLab 8.17][1118]. For installations from source +you'll have to install and configure it yourself. + +The [Redis exporter] allows you to measure various [Redis] metrics. For more +information on what's exported [read the upstream documentation][redis-exp]. + +To enable the Redis exporter: + +1. [Enable Prometheus](index.md#configuring-prometheus) +1. Edit `/etc/gitlab/gitlab.rb` +1. Find and uncomment the following line, making sure it's set to `true`: + + ```ruby + redis-exporter['enable'] = true + ``` + +1. Save the file and [reconfigure GitLab][reconfigure] for the changes to + take effect + +Prometheus will now automatically begin collecting performance data from +the Redis exporter exposed under `localhost:9121`. + +[← Back to the main Prometheus page](index.md) + +[1118]: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1118 +[redis]: https://redis.io +[redis exporter]: https://github.com/oliver006/redis_exporter +[redis-exp]: https://github.com/oliver006/redis_exporter/blob/master/README.md#whats-exported +[prometheus]: https://prometheus.io +[reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure From 20dd13abfd5faf621df5960a1727926d799e634c Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 8 Feb 2017 14:31:12 +0100 Subject: [PATCH 04/13] Use localhost for node_exporter --- doc/administration/monitoring/prometheus/node_exporter.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/administration/monitoring/prometheus/node_exporter.md b/doc/administration/monitoring/prometheus/node_exporter.md index d23589192b2..513621df9fd 100644 --- a/doc/administration/monitoring/prometheus/node_exporter.md +++ b/doc/administration/monitoring/prometheus/node_exporter.md @@ -20,10 +20,8 @@ To enable the node exporter: 1. Save the file and [reconfigure GitLab][reconfigure] for the changes to take effect -Prometheus it will now automatically begin collecting performance data from -the node exporter. You can visit `:9100/metrics` for a real -time representation of the metrics that are collected. Refresh the page and -you will see the data change. +Prometheus will now automatically begin collecting performance data from +the node exporter exposed under `localhost:9100`. [← Back to the main Prometheus page](index.md) From 19a315a42a635f6fe78e294cad69c72e9f185790 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 8 Feb 2017 14:40:28 +0100 Subject: [PATCH 05/13] Add postgres exporter to Prometheus docs --- .../monitoring/prometheus/index.md | 6 ++++ .../prometheus/postgres_exporter.md | 30 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 doc/administration/monitoring/prometheus/postgres_exporter.md diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index 5915179e14e..86c8cb4f874 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -81,6 +81,12 @@ The Redis exporter allows you to measure various Redis metrics. [➔ Read more about the Redis exporter.](redis_exporter.md) +### Postgres exporter + +The Postgres exporter allows you to measure various PostgreSQL metrics. + +[➔ Read more about the Postgres exporter.](postgres_exporter.md) + [grafana]: https://grafana.net [prometheus]: https://prometheus.io [prom-query]: https://prometheus.io/docs/querying/basics diff --git a/doc/administration/monitoring/prometheus/postgres_exporter.md b/doc/administration/monitoring/prometheus/postgres_exporter.md new file mode 100644 index 00000000000..07a74222a57 --- /dev/null +++ b/doc/administration/monitoring/prometheus/postgres_exporter.md @@ -0,0 +1,30 @@ +# Postgres exporter + +>**Note:** +Available since [Omnibus GitLab 8.17][1131]. For installations from source +you'll have to install and configure it yourself. + +The [postgres exporter] allows you to measure various PostgreSQL metrics. + +To enable the postgres exporter: + +1. [Enable Prometheus](index.md#configuring-prometheus) +1. Edit `/etc/gitlab/gitlab.rb` +1. Add or find and uncomment the following line, making sure it's set to `true`: + + ```ruby + postgres-exporter['enable'] = true + ``` + +1. Save the file and [reconfigure GitLab][reconfigure] for the changes to + take effect + +Prometheus will now automatically begin collecting performance data from +the postgres exporter exposed under `localhost:9187`. + +[← Back to the main Prometheus page](index.md) + +[1131]: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1131 +[postgres exporter]: https://github.com/wrouesnel/postgres_exporter +[prometheus]: https://prometheus.io +[reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure From 4049783d8887edab0dd30e7c3709ab96743d48d8 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 8 Feb 2017 15:44:56 +0100 Subject: [PATCH 06/13] Add GitLab monitor exporter docs --- .../prometheus/gitlab_monitor_exporter.md | 30 +++++++++++++++++++ .../monitoring/prometheus/index.md | 6 ++++ 2 files changed, 36 insertions(+) create mode 100644 doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md diff --git a/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md b/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md new file mode 100644 index 00000000000..fd6111b065b --- /dev/null +++ b/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md @@ -0,0 +1,30 @@ +# GitLab monitor exporter + +>**Note:** +Available since [Omnibus GitLab 8.17][1132]. For installations from source +you'll have to install and configure it yourself. + +The [GitLab monitor exporter] allows you to measure various GitLab metrics. + +To enable the GitLab monitor exporter: + +1. [Enable Prometheus](index.md#configuring-prometheus) +1. Edit `/etc/gitlab/gitlab.rb` +1. Find and uncomment the following line, making sure it's set to `true`: + + ```ruby + gitlab_exporter['enable'] = true + ``` + +1. Save the file and [reconfigure GitLab][reconfigure] for the changes to + take effect + +Prometheus will now automatically begin collecting performance data from +the GitLab monitor exporter exposed under `localhost:9168`. + +[← Back to the main Prometheus page](index.md) + +[1132]: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1132 +[GitLab monitor exporter]: https://gitlab.com/gitlab-org/gitlab-monitor +[prometheus]: https://prometheus.io +[reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index 86c8cb4f874..63d0644423f 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -87,6 +87,12 @@ The Postgres exporter allows you to measure various PostgreSQL metrics. [➔ Read more about the Postgres exporter.](postgres_exporter.md) +### 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) + [grafana]: https://grafana.net [prometheus]: https://prometheus.io [prom-query]: https://prometheus.io/docs/querying/basics From 1bde5d11e318cc39a69a77ff506eca8c01862346 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Wed, 8 Feb 2017 15:45:43 +0100 Subject: [PATCH 07/13] Use underscores instead of dashes in gitlab.rb [ci skip] --- doc/administration/monitoring/prometheus/postgres_exporter.md | 2 +- doc/administration/monitoring/prometheus/redis_exporter.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/administration/monitoring/prometheus/postgres_exporter.md b/doc/administration/monitoring/prometheus/postgres_exporter.md index 07a74222a57..8e2d3162f88 100644 --- a/doc/administration/monitoring/prometheus/postgres_exporter.md +++ b/doc/administration/monitoring/prometheus/postgres_exporter.md @@ -13,7 +13,7 @@ To enable the postgres exporter: 1. Add or find and uncomment the following line, making sure it's set to `true`: ```ruby - postgres-exporter['enable'] = true + postgres_exporter['enable'] = true ``` 1. Save the file and [reconfigure GitLab][reconfigure] for the changes to diff --git a/doc/administration/monitoring/prometheus/redis_exporter.md b/doc/administration/monitoring/prometheus/redis_exporter.md index aec5279b06d..9d3702fa182 100644 --- a/doc/administration/monitoring/prometheus/redis_exporter.md +++ b/doc/administration/monitoring/prometheus/redis_exporter.md @@ -14,7 +14,7 @@ To enable the Redis exporter: 1. Find and uncomment the following line, making sure it's set to `true`: ```ruby - redis-exporter['enable'] = true + redis_exporter['enable'] = true ``` 1. Save the file and [reconfigure GitLab][reconfigure] for the changes to From c803254e38bdcd6e01c7b2f684f1cb8a80e7c19c Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 9 Feb 2017 09:44:05 +0100 Subject: [PATCH 08/13] Add changes from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8764 --- .../monitoring/prometheus/index.md | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index 63d0644423f..94815419f03 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -7,6 +7,8 @@ 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 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 platform for monitoring GitLab and other software products. @@ -40,14 +42,21 @@ To enable Prometheus: 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 +`http://localhost:9090`. If the [node exporter](#node-exporter) service has been enabled, it will automatically be set up as a monitoring target for Prometheus. ## Viewing performance metrics After you have [enabled Prometheus](#configuring-prometheus), you can visit -`:9090` for the dashboard that Prometheus offers by default. +`http://localhost:9090` for the dashboard that Prometheus offers by default. + +>**Note:** +If SSL has been enabled on your GitLab instance, you may not be able to access +Prometheus on the same browser as GitLab due to [HSTS][hsts]. We plan to +[provide access via GitLab][multi-user-prometheus], but in the interim there are +some workarounds: using a separate browser for Prometheus, resetting HSTS, or +having [Nginx proxy it][nginx-custom-config]. The performance data collected by Prometheus can be viewed directly in the Prometheus console or through a compatible dashboard tool. @@ -56,6 +65,13 @@ 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]. +Sample Prometheus queries: + +- **% Memory used:** `(1 - ((node_memory_MemFree + node_memory_Cached) / node_memory_MemTotal)) * 100` +- **% CPU load:** `1 - rate(node_cpu{mode="idle"}[5m])` +- **Data transmitted:** `irate(node_network_transmit_bytes[5m])` +- **Data received:** `irate(node_network_receive_bytes[5m])` + ## Prometheus exporters There are a number of libraries and servers which help in exporting existing @@ -94,9 +110,12 @@ The GitLab monitor exporter allows you to measure various GitLab metrics. [➔ Read more about the GitLab monitor exporter.](gitlab_monitor_exporter.md) [grafana]: https://grafana.net +[hsts]: https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security +[multi-user-prometheus]: https://gitlab.com/gitlab-org/multi-user-prometheus +[nginx-custom-config]: https://docs.gitlab.com/omnibus/settings/configuration.html#inserting-custom-nginx-settings-into-the-gitlab-server-block [prometheus]: https://prometheus.io +[prom-exporters]: https://prometheus.io/docs/instrumenting/exporters/ [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 From a114f7cbc789be2ae2cf84c4559bf8aac5fc834b Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 9 Feb 2017 09:48:03 +0100 Subject: [PATCH 09/13] Add link to issue where HSTS is discussed [ci skip] --- doc/administration/monitoring/prometheus/index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index 94815419f03..86427d232f7 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -56,7 +56,8 @@ If SSL has been enabled on your GitLab instance, you may not be able to access Prometheus on the same browser as GitLab due to [HSTS][hsts]. We plan to [provide access via GitLab][multi-user-prometheus], but in the interim there are some workarounds: using a separate browser for Prometheus, resetting HSTS, or -having [Nginx proxy it][nginx-custom-config]. +having [Nginx proxy it][nginx-custom-config]. Follow issue [#27069] for more +information. The performance data collected by Prometheus can be viewed directly in the Prometheus console or through a compatible dashboard tool. @@ -119,3 +120,4 @@ The GitLab monitor exporter allows you to measure various GitLab metrics. [prom-grafana]: https://prometheus.io/docs/visualization/grafana/ [scrape-config]: https://prometheus.io/docs/operating/configuration/#%3Cscrape_config%3E [reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure +[#27069]: https://gitlab.com/gitlab-org/gitlab-ce/issues/27069 From 614f371989e9c2f4f9450cddfc9c3f505f977b89 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 9 Feb 2017 10:03:01 +0100 Subject: [PATCH 10/13] Fix GitLab monitor Omnibus setting [ci skip] --- .../monitoring/prometheus/gitlab_monitor_exporter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md b/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md index fd6111b065b..5e7d9b6ab89 100644 --- a/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md +++ b/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md @@ -13,7 +13,7 @@ To enable the GitLab monitor exporter: 1. Find and uncomment the following line, making sure it's set to `true`: ```ruby - gitlab_exporter['enable'] = true + gitlab_monitor_exporter['enable'] = true ``` 1. Save the file and [reconfigure GitLab][reconfigure] for the changes to From 419bbbf80d7568640eb7c35b6fa6720191e503a0 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 9 Feb 2017 10:20:30 +0100 Subject: [PATCH 11/13] Add info on changing the default address/port Prometheus listens on Reported in https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1905 [ci skip] --- .../monitoring/prometheus/index.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index 86427d232f7..bb8928f16f3 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -46,6 +46,29 @@ By default, Prometheus will run as the `gitlab-prometheus` user and listen on has been enabled, it will automatically be set up as a monitoring target for Prometheus. +## Changing the port Prometheus listens on + +>**Note:** +The following change was added in [GitLab Omnibus 8.17][1261]. Although possible, +it's not recommended to change the default address and port Prometheus listens +on as this might affect or conflict with other services running on the GitLab +server. Proceed at your own risk. + +To change the address/port that Prometheus listens on: + +1. Edit `/etc/gitlab/gitlab.rb` +1. Find and add/uncomment the following line: + + ```ruby + prometheus['listen_address'] = 'localhost:9090' + ``` + + Replace `localhost:9090` with the address/port you want Prometheus to + listen on. + +1. Save the file and [reconfigure GitLab][reconfigure] for the changes to + take effect + ## Viewing performance metrics After you have [enabled Prometheus](#configuring-prometheus), you can visit @@ -121,3 +144,4 @@ The GitLab monitor exporter allows you to measure various GitLab metrics. [scrape-config]: https://prometheus.io/docs/operating/configuration/#%3Cscrape_config%3E [reconfigure]: ../../restart_gitlab.md#omnibus-gitlab-reconfigure [#27069]: https://gitlab.com/gitlab-org/gitlab-ce/issues/27069 +[1261]: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1261 From 52313cfb14063cdec5872c908f328fcb8fefd470 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 9 Feb 2017 10:24:50 +0100 Subject: [PATCH 12/13] Change to direct link for Omnibus Nginx docs [ci skip] --- doc/administration/monitoring/prometheus/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index bb8928f16f3..b8ba8fee878 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -136,7 +136,7 @@ The GitLab monitor exporter allows you to measure various GitLab metrics. [grafana]: https://grafana.net [hsts]: https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security [multi-user-prometheus]: https://gitlab.com/gitlab-org/multi-user-prometheus -[nginx-custom-config]: https://docs.gitlab.com/omnibus/settings/configuration.html#inserting-custom-nginx-settings-into-the-gitlab-server-block +[nginx-custom-config]: https://docs.gitlab.com/omnibus/settings/nginx.html#inserting-custom-nginx-settings-into-the-gitlab-server-block [prometheus]: https://prometheus.io [prom-exporters]: https://prometheus.io/docs/instrumenting/exporters/ [prom-query]: https://prometheus.io/docs/querying/basics From 6ad99168332370008e8c55fd3587af3ae1d07ab0 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Thu, 9 Feb 2017 10:28:12 +0100 Subject: [PATCH 13/13] Consider existing installations where the setting is not in gitlab.rb [ci skip] --- .../monitoring/prometheus/gitlab_monitor_exporter.md | 2 +- doc/administration/monitoring/prometheus/index.md | 4 ++-- doc/administration/monitoring/prometheus/node_exporter.md | 2 +- doc/administration/monitoring/prometheus/redis_exporter.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md b/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md index 5e7d9b6ab89..86ef9d167e2 100644 --- a/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md +++ b/doc/administration/monitoring/prometheus/gitlab_monitor_exporter.md @@ -10,7 +10,7 @@ To enable the GitLab monitor exporter: 1. [Enable Prometheus](index.md#configuring-prometheus) 1. Edit `/etc/gitlab/gitlab.rb` -1. Find and uncomment the following line, making sure it's set to `true`: +1. Add or find and uncomment the following line, making sure it's set to `true`: ```ruby gitlab_monitor_exporter['enable'] = true diff --git a/doc/administration/monitoring/prometheus/index.md b/doc/administration/monitoring/prometheus/index.md index b8ba8fee878..3a394c561db 100644 --- a/doc/administration/monitoring/prometheus/index.md +++ b/doc/administration/monitoring/prometheus/index.md @@ -32,7 +32,7 @@ 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`: +1. Add or find and uncomment the following line, making sure it's set to `true`: ```ruby prometheus['enable'] = true @@ -57,7 +57,7 @@ server. Proceed at your own risk. To change the address/port that Prometheus listens on: 1. Edit `/etc/gitlab/gitlab.rb` -1. Find and add/uncomment the following line: +1. Add or find and uncomment the following line: ```ruby prometheus['listen_address'] = 'localhost:9090' diff --git a/doc/administration/monitoring/prometheus/node_exporter.md b/doc/administration/monitoring/prometheus/node_exporter.md index 513621df9fd..aef7758a88f 100644 --- a/doc/administration/monitoring/prometheus/node_exporter.md +++ b/doc/administration/monitoring/prometheus/node_exporter.md @@ -11,7 +11,7 @@ To enable the node exporter: 1. [Enable Prometheus](index.md#configuring-prometheus) 1. Edit `/etc/gitlab/gitlab.rb` -1. Find and uncomment the following line, making sure it's set to `true`: +1. Add or find and uncomment the following line, making sure it's set to `true`: ```ruby node_exporter['enable'] = true diff --git a/doc/administration/monitoring/prometheus/redis_exporter.md b/doc/administration/monitoring/prometheus/redis_exporter.md index 9d3702fa182..d54d409dbb6 100644 --- a/doc/administration/monitoring/prometheus/redis_exporter.md +++ b/doc/administration/monitoring/prometheus/redis_exporter.md @@ -11,7 +11,7 @@ To enable the Redis exporter: 1. [Enable Prometheus](index.md#configuring-prometheus) 1. Edit `/etc/gitlab/gitlab.rb` -1. Find and uncomment the following line, making sure it's set to `true`: +1. Add or find and uncomment the following line, making sure it's set to `true`: ```ruby redis_exporter['enable'] = true