- node.default[:prometheus][:exporters][new_resource.port] = {
- :name => new_resource.exporter,
- :address => listen_address,
- :metric_relabel => new_resource.metric_relabel
- }
+ node.default[:prometheus][:addresses][new_resource.exporter] = listen_address
+
+ if new_resource.register_target
+ node.default[:prometheus][:exporters][new_resource.port] = {
+ :name => new_resource.exporter,
+ :address => listen_address,
+ :scrape_interval => new_resource.scrape_interval,
+ :scrape_timeout => new_resource.scrape_timeout,
+ :metric_relabel => new_resource.metric_relabel
+ }
+ end