X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/524d90d022751710980613df6b943291fc1498d6..ac279eeeae75039bf84ffffdbb849b37bf554a75:/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 60345ef52..c6ace499b 100644 --- a/cookbooks/prometheus/templates/default/prometheus.yml.erb +++ b/cookbooks/prometheus/templates/default/prometheus.yml.erb @@ -11,11 +11,16 @@ 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 -%> + +# remote_write: +# - url: "http://localhost:9201/write"