Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 21, 2025

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