prometheus_exporter "fastly_healthcheck" do
port 9696
+ scrape_interval "1m"
environment "FASTLY_API_TOKEN" => tokens["fastly"]
end
name = exporter[:name]
address = exporter[:address]
sni = exporter[:sni]
+ scrape_interval = exporter[:scrape_interval]
metric_relabel = exporter[:metric_relabel] || []
else
name = key
address = exporter
sni = nil
+ scrape_interval = nil
metric_relabel = []
end
:address => address,
:sni => sni,
:instance => client.name.split(".").first,
+ :scrape_interval => scrape_interval,
:metric_relabel => metric_relabel
}
end
property :options, :kind_of => [String, Array]
property :environment, :kind_of => Hash, :default => {}
property :service, :kind_of => String
+property :scrape_interval, :kind_of => String
property :metric_relabel, :kind_of => Array
property :register_target, :kind_of => [TrueClass, FalseClass], :default => true
node.default[:prometheus][:exporters][new_resource.port] = {
:name => new_resource.exporter,
:address => listen_address,
+ :scrape_interval => new_resource.scrape_interval,
:metric_relabel => new_resource.metric_relabel
}
end
replacement: 127.0.0.1:9219
<% @jobs.sort.each do |name, targets| -%>
- job_name: <%= name %>
+<% if targets.first[:scrape_interval] -%>
+ scrape_interval: <%= targets.first[:scrape_interval] %>
+<% end -%>
<% if targets.first[:sni] -%>
tls_config:
server_name: <%= targets.first[:sni] %>