prometheus / prometheus/prometheus
Scrape limit on series before relabeling
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 66.1k
- Forks
- 10.8k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 131
Description
Proposal
A situation where an exporter is unexpectedly generating millions of metrics but Prometheus is configured to drop them via relabelling, can result in excessive memory usage because all dropped series go into a cache per target.
Prometheus allows a limit on the number of series after relabeling, but you can't directly set a limit on the number of series in a scrape.
You can put a limit on the number of bytes in a scrape, but this is somewhat indirect.
My proposal is to add scraped_sample_limit or perhaps something like sample_limit_before_relabelling.
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
No files, tests, or entry points are named. Start by tracing the existing scrape byte limit, post-relabel series limit, and relabeling flow to determine where a pre-relabel sample limit belongs; done means an agreed configuration and behavior for limiting scraped series before relabeling.
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
- Mostly clear
- Newbie friendliness
- 35/100