X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/a2fcf073ea11dab5073424d9099420f933bf99d5..5965ce211517c8fb9aa7805c443c088dd4b83e93:/cookbooks/prometheus/templates/default/prometheus.yml.erb?ds=sidebyside diff --git a/cookbooks/prometheus/templates/default/prometheus.yml.erb b/cookbooks/prometheus/templates/default/prometheus.yml.erb index b00c6aaf0..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 -<% @jobs.sort.each do |name, addresses| -%> +<% @jobs.sort.each do |name, targets| -%> - job_name: <%= name %> static_configs: +<% targets.each do |target| -%> - targets: -<% addresses.sort.each do |address| -%> - - <%= address %> + - "<%= target[:address] %>" + labels: + instance: <%= target[:name].split(".").first %> <% end -%> <% end -%>