]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/templates/default/prometheus.yml.erb
Merge remote-tracking branch 'github/pull/358' into master
[chef.git] / cookbooks / prometheus / templates / default / prometheus.yml.erb
index 60345ef5258ee95577605a9b4901843154413e7c..46d241905d46fd17b22d72870a64d9439135168e 100644 (file)
@@ -11,11 +11,13 @@ scrape_configs:
     static_configs:
       - targets:
           - localhost:9090
-<% @clients.each do |client| -%>
-  - job_name: <%= client.name %>
+<% @jobs.sort.each do |name, targets| -%>
+  - job_name: <%= name %>
     static_configs:
+<% targets.each do |target| -%>
       - targets:
-<% client[:prometheus][:exporters].sort.each do |_,address| -%>
-          - <%= address %>
+          - "<%= target[:address] %>"
+        labels:
+          instance: <%= target[:name].split(".").first %>
 <% end -%>
 <% end -%>