X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/524d90d022751710980613df6b943291fc1498d6..bcc7d3796af2aa1bb18b17c1321f20ed5b17b964:/cookbooks/prometheus/templates/default/prometheus.yml.erb diff --git a/cookbooks/prometheus/templates/default/prometheus.yml.erb b/cookbooks/prometheus/templates/default/prometheus.yml.erb index 60345ef52..46d241905 100644 --- a/cookbooks/prometheus/templates/default/prometheus.yml.erb +++ b/cookbooks/prometheus/templates/default/prometheus.yml.erb @@ -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 -%>