prometheus / prometheus/prometheus

Add cardinality_limit to scrape config

Open
#11,061 15 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.