]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/templates/default/prometheus.yml.erb
Configure exim exporter for prometheus
[chef.git] / cookbooks / prometheus / templates / default / prometheus.yml.erb
index b00c6aaf021b8c9275712e54aef6253b60e116c1..46d241905d46fd17b22d72870a64d9439135168e 100644 (file)
@@ -11,11 +11,13 @@ scrape_configs:
     static_configs:
       - targets:
           - localhost:9090
     static_configs:
       - targets:
           - localhost:9090
-<% @jobs.sort.each do |name, addresses| -%>
+<% @jobs.sort.each do |name, targets| -%>
   - job_name: <%= name %>
     static_configs:
   - job_name: <%= name %>
     static_configs:
+<% targets.each do |target| -%>
       - targets:
       - targets:
-<% addresses.sort.each do |address| -%>
-          - <%= address %>
+          - "<%= target[:address] %>"
+        labels:
+          instance: <%= target[:name].split(".").first %>
 <% end -%>
 <% end -%>
 <% end -%>
 <% end -%>