Repository navigation
Do not promote resource attributes when Prometheus resource_constant_labels is empty (#9014) - #9015
Open
rooks-ns wants to merge 1 commit into
Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-11-07 05:29 UTC Investigate required status check failures. Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9015 +/- ##
============================================
+ Coverage 90.35% 90.37% +0.01%
- Complexity 10984 11025 +41
============================================
Files 1019 1021 +2
Lines 30072 30129 +57
Branches 3927 3934 +7
============================================
+ Hits 27173 27229 +56
- Misses 1939 1942 +3
+ Partials 960 958 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rooks-ns
marked this pull request as ready for review
November 7, 2026 05:28
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9014
Problem
In declarative configuration,
$defs.IncludeExcludeallows an empty object (resource_constant_labels: {}). When parsed,PrometheusComponentProviderunconditionally forwarded(null, null)toIncludeExcludePredicate.createPatternMatching(null, null). BecauseIncludeExcludePredicatedefaults(null, null)tos -> true(match all), this erroneously promoted every resource attribute onto all Prometheus metric time-series instead of none.Solution
Only register
allowedResourceAttributesFilteron the builder whenincluded != null || excluded != null. If both are absent, the builder retainsallowedResourceAttributesFilter = null(no-op), ensuring zero resource attributes are converted to metric labels.Testing
PrometheusComponentProviderTestcovering default behavior, empty{}config, whitelist, blacklist, and validation errors.MetricReaderFactoryTestverifying declarative config model parity with emptyIncludeExcludeModel../gradlew :exporters:prometheus:check :sdk-extensions:declarative-config:check.