influxdata / influxdata/influxdb
Allow adding tag(s) to scrapers to distinguish targets
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__Proposal:__
Allow a way to distinguish targets for scrapers of the same exporter when the exporter does not add identifying tags by itself to its metrics.
__Current behavior:__
Not all Prometheus exporters add hostname as a tag to their metrics. When I configure a batch of remote node_exporters as scrapes in InfluxDB and make them dump all in the same bucket, there is no way to distinguish between metrics from different hosts.
__Desired behavior:__
Ideally each scraper auto-creates a tag containing the target URL which it appends to each metric.
Alternatively, allow for setting tag(s) which will be applied to each metric for a scrape target. This way a user can add his own identifier for the scrape target.
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.
__Alternatives considered:__
You could dump the data of each scrape target of the same type of exporter into separate buckets. However, this would inflate bucket count. Also, queries that operate on all targets of the same exporter would increase in complexity.
__Use case:__
Getting data in from existing exporters would become easier.
Contributor guide
Research direction
Start by locating the scraper configuration and the path where scraped metrics are assigned to a target. Review how per-target tags could be configured or generated, then verify that metrics from multiple targets remain distinguishable without requiring separate buckets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100