[Metrics] Exclude list for tags on Metrics#7373
Merged
Merged
Conversation
…elated updates - Introduced ExcludedTagKeys property in MetricStreamConfiguration to specify optional tag keys to exclude from metrics. - Updated AggregatorStore to handle excluded tag keys during metric updates. - Enhanced MetricStreamIdentity to include excluded tag keys. - Implemented validation logic to ensure TagKeys and ExcludedTagKeys are mutually exclusive. - Added tests to verify behavior of excluded tag keys in metric views.
…lyFilteredTagCollection
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7373 +/- ##
==========================================
- Coverage 90.33% 90.21% -0.13%
==========================================
Files 289 289
Lines 15745 15820 +75
==========================================
+ Hits 14224 14272 +48
- Misses 1521 1548 +27
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Contributor
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Contributor
Author
Decisions that require review
|
| State | Behavior | New in PR? |
|---|---|---|
Both null |
All tags preserved | No |
TagKeys = [] |
All measurements collapse to zero-tag metric point | No |
ExcludedTagKeys = [] |
All tags preserved (identical to default, but goes through exclude code path) | Yes |
Both non-null (including both []) |
Validate() throws, view is dropped with a logged warning (event ID 41), instrument falls back to default behavior |
Yes |
Order sensitivity in ExcludedTagKeys
ExcludedTagKeys uses element-wise comparison (same as TagKeys). ["a","b"] and ["b","a"] produce different MetricStreamIdentity values even though the filtering behavior is identical. This is a known limitation inherited from the pre-existing TagKeys behavior.
nabutabu
marked this pull request as ready for review
June 16, 2026 19:03
Co-authored-by: Martin Costello <martin@martincostello.com>
Kielek
reviewed
Jun 18, 2026
Kielek
reviewed
Jun 18, 2026
This was referenced Jul 17, 2026
Merged
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 #4427
Design discussion issue open-telemetry/opentelemetry-specification#4188
Changes
Adds an exclude list to MetricStreamConfiguration and
FindMetricAggregatorsExcludeTagmethod that returns the correct list for the current viewMerge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes