From e56f6d23f38afd66745c3ef0af024fd15b156e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Desvaux?= Date: Tue, 21 Mar 2023 16:00:49 +0100 Subject: [PATCH] prometheus add exporter for gitlab --- templates/conf/prometheus.yml.j2 | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/templates/conf/prometheus.yml.j2 b/templates/conf/prometheus.yml.j2 index 54098a6..3ae476b 100644 --- a/templates/conf/prometheus.yml.j2 +++ b/templates/conf/prometheus.yml.j2 @@ -425,3 +425,64 @@ scrape_configs: regex: '(.*):9200' replacement: '${1}' {% endif %} +{% if prometheus_gitlab_exporter_targets is defined %} + # gitlab # + - job_name: gitlab-nginx + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }}:8060 +{% endfor %} + - job_name: gitlab-redis + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }}:9121 +{% endfor %} + - job_name: gitlab-postgres + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }}:9187 +{% endfor %} + - job_name: gitlab-workhorse + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }}:9229 +{% endfor %} + - job_name: gitlab-rails + metrics_path: "/-/metrics" + scheme: https + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }} +{% endfor %} + - job_name: gitlab-sidekiq + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }}:8082 +{% endfor %} + - job_name: gitlab_exporter_database + metrics_path: "/database" + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }}:9168 +{% endfor %} + - job_name: gitlab_exporter_sidekiq + metrics_path: "/sidekiq" + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }}:9168 +{% endfor %} + - job_name: gitaly + static_configs: + - targets: +{% for target in prometheus_gitlab_exporter_targets %} + - {{ target }}:9236 +{% endfor %} +{% endif %}