How to add tags to scrapers

Hello,

I’m trying out InfluxDB 2.

I’d like to use scrapers to fetch data from multiple node exporters into the same bucket. I tried creating two scrapers, one for an OPNSense instance and the other to the InfluxDB instance.

But, while the OPNSense instance data has a tag with the hostname, the InfluxDB instance data doesn’t.

If scrapers allowed me to add tags, I’d be able to add the hostname. But, since this seems to be impossible, I don’t understand how I can distinguish the data scraped from multiple sources when not all of them define the hostname tag themselves.

Please advise. Thank you!

Regards,
Nuno

Hello @nununo ,
Welcome!
You could write the data to separate buckets to distinguish the data scraped from multiple sources. Then you could use tasks to further process the data (add tags, combine data into one bucket, etc).

Prometheus adds a ‘instance’ label to each scrape which contains the socket of the exporter it polled. This allows to distinguish and extract the hostname when exporters like node_exporter doesn’t supply hostname as tag/label.

So when I point InfluxDB to a bunch of node_exporters and make them dump all in the same bucket, there doesn’t seem to be a way to distinguish between hosts.

Is it worth a feature request to request that InfluxDB adds the target url of a scraper as a label?