default[:prometheus][:addresses] = {}
default[:prometheus][:exporters] = {}
default[:prometheus][:snmp] = {}
+default[:prometheus][:metrics] = {}
if node[:recipes].include?("prometheus::server")
default[:apt][:sources] |= ["grafana"]
# TYPE chef_tile_parent gauge
chef_tile_parent{name="<%= node[:tilecache][:tile_parent].split(".").first %>"} 1
<% end -%>
+<% node[:prometheus][:metrics].sort.each do |name, details| -%>
+# HELP <%= name %> <%= details[:help] %>
+# TYPE <%= name %> gauge
+<%= name %>{<%= details[:labels].map { |k,v| "#{k}=\"#{v}\"" }.join(",") %>} 1
+<% end -%>
"pdu1" => { :address => "10.0.64.100", :module => "apcups", :labels => { "site" => "dublin" } },
"pdu2" => { :address => "10.0.64.101", :module => "apcups", :labels => { "site" => "dublin" } },
"switch1" => { :address => "184.104.226.97", :module => "if_mib", :labels => { "site" => "dublin" } }
+ },
+ :metrics => {
+ :uplink_interface => {
+ :help => "Site uplink interface name",
+ :labels => { :site => "dublin", :name => "ae50" }
+ }
}
}
)
"pdu1" => { :address => "10.0.48.100", :module => "apcups", :labels => { "site" => "amsterdam" } },
"pdu2" => { :address => "10.0.48.101", :module => "apcups", :labels => { "site" => "amsterdam" } },
"switch1" => { :address => "130.117.76.2", :module => "if_mib", :labels => { "site" => "amsterdam" } }
+ },
+ :metrics => {
+ :uplink_interface => {
+ :help => "Site uplink interface name",
+ :labels => { :site => "amsterdam", :name => "te1/0/1" }
+ }
}
},
:rsyncd => {