From 243b18c7ed2bf15d85462c7ad5afcd582d917823 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Sun, 22 Jan 2017 14:00:28 +0100 Subject: Add Prometheus docs Replaces https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1237 Omnibus MR: https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/1227 Omnibus issue: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1481 --- .../monitoring/performance/prometheus.md | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 doc/administration/monitoring/performance/prometheus.md diff --git a/doc/administration/monitoring/performance/prometheus.md b/doc/administration/monitoring/performance/prometheus.md new file mode 100644 index 00000000000..d68d423e387 --- /dev/null +++ b/doc/administration/monitoring/performance/prometheus.md @@ -0,0 +1,97 @@ +# 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 + node_exporter['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 + +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. + +[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 -- cgit v1.2.1 From 73375c18cd97a49dae9c4e8f043f08d17c830430 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Sun, 22 Jan 2017 14:14:46 +0100 Subject: Expose Prometheus docs to the main README [ci skip] --- doc/README.md | 3 ++- doc/administration/monitoring/performance/introduction.md | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/README.md b/doc/README.md index ee69684b53b..fb750ecc9a8 100644 --- a/doc/README.md +++ b/doc/README.md @@ -50,7 +50,8 @@ - [Migrate GitLab CI to CE/EE](migrate_ci_to_ce/README.md) Follow this guide to migrate your existing GitLab CI data to GitLab CE/EE. - [Git LFS configuration](workflow/lfs/lfs_administration.md) - [Housekeeping](administration/housekeeping.md) Keep your Git repository tidy and fast. -- [GitLab Performance Monitoring](administration/monitoring/performance/introduction.md) Configure GitLab and InfluxDB for measuring performance metrics. +- [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. - [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 79904916b7e..8b106e89cc2 100644 --- a/doc/administration/monitoring/performance/introduction.md +++ b/doc/administration/monitoring/performance/introduction.md @@ -12,6 +12,11 @@ documents in order to understand and properly configure GitLab Performance Monit - [InfluxDB Schema](influxdb_schema.md) - [Grafana Install/Configuration](grafana_configuration.md) +>**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). + ## Introduction to GitLab Performance Monitoring GitLab Performance Monitoring makes it possible to measure a wide variety of statistics -- cgit v1.2.1 From 43f0fd1f098b7b61f1fca2c31de7ffe04dfc9543 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Sun, 22 Jan 2017 15:34:09 +0100 Subject: Add information on the dashboard and exporter ports [ci skip] --- doc/administration/monitoring/performance/prometheus.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/administration/monitoring/performance/prometheus.md b/doc/administration/monitoring/performance/prometheus.md index d68d423e387..d8ca531649a 100644 --- a/doc/administration/monitoring/performance/prometheus.md +++ b/doc/administration/monitoring/performance/prometheus.md @@ -43,6 +43,9 @@ 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 @@ -85,7 +88,9 @@ To enable the node exporter: take effect Prometheus it will now automatically begin collecting performance data from -the node exporter. +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 -- cgit v1.2.1