Skip to content

Comments

feat(layers/prometheus_client): Add disable_label_root to allow skip root label in metrics#6071

Merged
Xuanwo merged 3 commits intoapache:mainfrom
flaneur2020:allow-disable-high-cardinality-labels
Apr 21, 2025
Merged

feat(layers/prometheus_client): Add disable_label_root to allow skip root label in metrics#6071
Xuanwo merged 3 commits intoapache:mainfrom
flaneur2020:allow-disable-high-cardinality-labels

Conversation

@flaneur2020
Copy link
Contributor

Which issue does this PR close?

none

Rationale for this change

currently the root label might have high cardinality in certain systems, like users may have thousands of different root values for something like stages.

What changes are included in this PR?

this pr addes a enable_high_cardinality_labels method to PrometheusClientLayerBuilder, if this method set as false, the root label will not be rendered in the labels encoding.

Are there any user-facing changes?

adds a enable_high_cardinality_labels in PrometheusClientLayerBuilder. the default behaviour is not changed

@flaneur2020 flaneur2020 requested a review from Xuanwo as a code owner April 21, 2025 04:31
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Apr 21, 2025
@Xuanwo Xuanwo changed the title feat(metrics): allow disable high cardinality labels in prometheus client feat(layers/prometheus_client): Add disable_label_root to allow skip root label in metrics Apr 21, 2025
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @flaneur2020 for adding this feature.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 21, 2025
@Xuanwo Xuanwo merged commit e4cf8f2 into apache:main Apr 21, 2025
242 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants