prometheus / prometheus/prometheus
Add cardinality_limit to scrape config
Open
Nobody has claimed this yet.
component/config
component/scraping
help wanted
kind/feature
priority/P3
- Dominant language
- Go
- Stars
- 66.1k
- Forks
- 10.8k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 131
Description
Proposal
In order to stop targets from overloading label values and also the metric __name__ index, add a scrape config limiter that limits the number of unique label values per scrape.
This will protect, for example:
- When other metric systems are translated to Prometheus incorrectly and tag values become part of the metric name.
- When a piece of data is not filtered and exposed as thousands of label values.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points; begin by locating scrape-config parsing and the scrape path that handles target labels. Clarify the configuration scope and expected behavior, then verify that excessive unique label values are limited per scrape and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100