group "root"
mode "750"
end
+
+node.default[:prometheus][:exporters][443] = {
+ :name => "community",
+ :address => "#{node[:prometheus][:address]}:443",
+ :sni => "community.openstreetmap.org"
+}
if exporter.is_a?(Hash)
name = exporter[:name]
address = exporter[:address]
+ sni = exporter[:sni]
metric_relabel = exporter[:metric_relabel] || []
else
name = key
address = exporter
+ sni = nil
metric_relabel = []
end
jobs[name] ||= []
jobs[name] << {
:address => address,
+ :sni => sni,
:instance => client.name.split(".").first,
:metric_relabel => metric_relabel
}
replacement: 127.0.0.1:9219
<% @jobs.sort.each do |name, targets| -%>
- job_name: <%= name %>
+<% if targets.first[:sni] -%>
+ tls_config:
+ server_name: <%= targets.first[:sni] %>
+ relabel_configs:
+ - target_label: __scheme__
+ replacement: https
+<% end -%>
static_configs:
<% targets.each do |target| -%>
- targets: