- 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,
+ :metric_relabel => new_resource.metric_relabel
+ }
+ end