From db1f492198f1070903e9a21d329ad834cbd27b60 Mon Sep 17 00:00:00 2001 From: Konstantin Hontar Date: Tue, 15 Aug 2017 16:34:29 +0300 Subject: [PATCH] Add Jenkins to Prometheus targets Change-Id: Ie9853b9860b34536ded4a7583c48c735e75bb7b7 --- prometheus/files/prometheus.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/prometheus/files/prometheus.yml b/prometheus/files/prometheus.yml index 445c476..25c9832 100644 --- a/prometheus/files/prometheus.yml +++ b/prometheus/files/prometheus.yml @@ -243,3 +243,10 @@ scrape_configs: port: {{ target.port }} {%- endfor %} {%- endif %} + +{%- if grains.get('jenkins_plugins', {}).get('prometheus', {}).get('version', False) %} + - job_name: jenkins + metrics_path: '/prometheus' + static_configs: + - targets: ['{{ pillar.get('jenkins').get('client').get('master').get('host') }}:{{ pillar.get('jenkins').get('client').get('master').get('port') }}'] +{%- endif %}