Commit 12d98ec0 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Properly indent codeblocks

parent c1ae5bc0
...@@ -24,7 +24,7 @@ dashboard tool like [Grafana]. ...@@ -24,7 +24,7 @@ dashboard tool like [Grafana].
## Configuring Prometheus ## Configuring Prometheus
>**Note:** 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 and it's exporters are on by default, starting with GitLab 9.0.
...@@ -47,7 +47,7 @@ To disable Prometheus and all of its exporters, as well as any added in the futu ...@@ -47,7 +47,7 @@ To disable Prometheus and all of its exporters, as well as any added in the futu
### Changing the port and address Prometheus listens on ### Changing the port and address Prometheus listens on
>**Note:** NOTE: **Note:**
The following change was added in [GitLab Omnibus 8.17][1261]. Although possible, The following change was added in [GitLab Omnibus 8.17][1261]. Although possible,
it's not recommended to change the port Prometheus listens it's not recommended to change the port Prometheus listens
on as this might affect or conflict with other services running on the GitLab on as this might affect or conflict with other services running on the GitLab
...@@ -89,43 +89,46 @@ To use an external Prometheus server: ...@@ -89,43 +89,46 @@ To use an external Prometheus server:
1. Edit `/etc/gitlab/gitlab.rb`. 1. Edit `/etc/gitlab/gitlab.rb`.
1. Disable the bundled Prometheus: 1. Disable the bundled Prometheus:
```ruby ```ruby
prometheus['enable'] = false prometheus['enable'] = false
``` ```
1. Set each bundled service's [exporter](#bundled-software-metrics) to listen on a network address, for example: 1. Set each bundled service's [exporter](#bundled-software-metrics) to listen on a network address, for example:
```ruby ```ruby
gitlab_monitor['listen_address'] = '0.0.0.0' gitlab_monitor['listen_address'] = '0.0.0.0'
gitlab_monitor['listen_port'] = '9168' gitlab_monitor['listen_port'] = '9168'
gitaly['prometheus_listen_addr'] = "0.0.0.0:9236" gitaly['prometheus_listen_addr'] = "0.0.0.0:9236"
node_exporter['listen_address'] = '0.0.0.0:9100' node_exporter['listen_address'] = '0.0.0.0:9100'
redis_exporter['listen_address'] = '0.0.0.0:9121' redis_exporter['listen_address'] = '0.0.0.0:9121'
postgres_exporter['listen_address'] = '0.0.0.0:9187' postgres_exporter['listen_address'] = '0.0.0.0:9187'
``` ```
1. Install and set up a dedicated Prometheus instance, if necessary, using the [official installation instructions](https://prometheus.io/docs/prometheus/latest/installation/). 1. Install and set up a dedicated Prometheus instance, if necessary, using the [official installation instructions](https://prometheus.io/docs/prometheus/latest/installation/).
1. Add the Prometheus server IP address to the [monitoring IP whitelist](../ip_whitelist.html). For example: 1. Add the Prometheus server IP address to the [monitoring IP whitelist](../ip_whitelist.html). For example:
```ruby ```ruby
gitlab_rails['monitoring_whitelist'] = ['127.0.0.0/8', '192.168.0.1'] gitlab_rails['monitoring_whitelist'] = ['127.0.0.0/8', '192.168.0.1']
``` ```
1. [Reconfigure GitLab][reconfigure] to apply the changes 1. [Reconfigure GitLab][reconfigure] to apply the changes
1. Edit the Prometheus server's configuration file. 1. Edit the Prometheus server's configuration file.
1. Add each node's exporters to the Prometheus server's [scrape target configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Cscrape_config%3E). For example, a sample snippet using `static_configs`: 1. Add each node's exporters to the Prometheus server's
[scrape target configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#%3Cscrape_config%3E).
```yaml For example, a sample snippet using `static_configs`:
scrape_configs:
- job_name: 'gitlab_exporters' ```yaml
static_configs: scrape_configs:
- targets: ['1.1.1.1:9168', '1.1.1.1:9236', '1.1.1.1:9236', '1.1.1.1:9100', '1.1.1.1:9121', '1.1.1.1:9187'] - job_name: 'gitlab_exporters'
static_configs:
- job_name: 'gitlab_metrics' - targets: ['1.1.1.1:9168', '1.1.1.1:9236', '1.1.1.1:9236', '1.1.1.1:9100', '1.1.1.1:9121', '1.1.1.1:9187']
metrics_path: /-/metrics
static_configs: - job_name: 'gitlab_metrics'
- targets: ['1.1.1.1:443'] metrics_path: /-/metrics
``` static_configs:
- targets: ['1.1.1.1:443']
```
1. Restart the Prometheus server. 1. Restart the Prometheus server.
## Viewing performance metrics ## Viewing performance metrics
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment