X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/446ed4c549cb8c21d10ddd007ff1c122c4a7afa4..9c6f24be91afa44069f9e43e338fa6272e76b668:/cookbooks/prometheus/templates/default/chef.prom.erb?ds=sidebyside diff --git a/cookbooks/prometheus/templates/default/chef.prom.erb b/cookbooks/prometheus/templates/default/chef.prom.erb index 4b0df7fbe..8d6506eae 100644 --- a/cookbooks/prometheus/templates/default/chef.prom.erb +++ b/cookbooks/prometheus/templates/default/chef.prom.erb @@ -1,10 +1,15 @@ # HELP chef_network_interface Information about network interfaces # TYPE chef_network_interface gauge -<% node.interfaces do |interface| -%> -chef_network_interface{name="<%= interface[:interface] %>",role="<%= interface[:role].to_s %>",family="<%= interface[:family].to_s %>"} 1 +<% node.interfaces.each do |interface| -%> +chef_network_interface{name="<%= interface[:interface] %>",role="<%= interface[:role].to_s %>"} 1 <% end -%> # HELP chef_role Information about chef roles # TYPE chef_role gauge <% node[:roles].sort.each do |role| -%> chef_role{name="<%= role %>"} 1 <% end -%> +<% node[:prometheus][:metrics].sort.each do |name, details| -%> +# HELP <%= name %> <%= details[:help] %> +# TYPE <%= name %> gauge +<%= name %>{<%= Hash(details[:labels]).map { |k,v| "#{k}=\"#{v}\"" }.join(",") %>} <%= details[:metric] || 1 %> +<% end -%>