Support for passing targets to prometheus.exporter.blackbox from discovery.file or discovery.relabel #4468
Replies: 1 comment
-
I agree with Daniel that the multi-target prometheus.exporter components (like snmp and blackbox) would really benefit from some way of feeding a SD / file or whatever multi-target solution. Just "feeding" the components with a: The workaround to query the agent.internal:12345 address with __param_target set to the node to query and the __param_module to define the module AND the metrics_path set to the api path as Daniel mentions (to be customized to your solution) is extremely cumbersome. @danielpanzich : thanks for your post: it got me on the workaround track ! |
Beta Was this translation helpful? Give feedback.
-
There seems to be two approaches to supporting dynamic targets, neither of which I am able to get to work using the grafana agent.
Approach 1 - Define the targets in prometheus.exporter.blackbox component
prometheus.exporter.blackbox requires the targets to be defined within the configuration file, and can't seem to be passed via another component such as discovery.file or discovery.relabel.
Approach 2 - Define params in prometheus.scrape and pass to prometheus.exporter.blackbox
prometheus.scrape params block cannot handle multiple targets. When passing multiple targets the component concatenates the targets into a single metrics URL, leaving you to define one scrape per target:
i.e api/v0/component/prometheus.exporter.blackbox.icmp/metrics?module=icmp_test&target=grafana.com&target=football.com&target=yahoo.com
This approach appears to be the standard prometheus guided method, however I feel it doesn't align with the pipelines approach.
I am still learning the nuances of river, so this may actually be possible but if not it would be great to be able to configure a targets array within the prometheus.exporter.blackbox looking where the target_name is populated using __param_target, address is populated using __param_target and module is populated with __param_module.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions