Skip to content

[CONFIGURATION] Apply metric view attribute filters - #4385

Merged
dbarker merged 11 commits into
open-telemetry:mainfrom
iamhaseebn:fix-configuration-attribute-keys
Aug 11, 2026
Merged

dbarker merged 11 commits into
open-telemetry:mainfrom
iamhaseebn:fix-configuration-attribute-keys

Conversation

@iamhaseebn

Copy link
Copy Markdown
Contributor

Fixes #3546

Changes

  • Build the existing metric view attribute processors from attribute_keys configuration.
  • Support include-only, exclude-only, and combined filters.
  • Apply exclusions after inclusions, as documented.
  • Preserve all attributes when attribute_keys contains neither list.

Testing

  • AppleClang maintainer-mode build with WITH_CONFIGURATION=ON
  • Focused CreateAttributesProcessor regression test
  • SDK builder and YAML metrics tests: 58 passed
  • Full configured suite: 1,046 passed, with 4 repository-disabled tests not run

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed - no public API changes

@iamhaseebn
iamhaseebn requested a review from a team as a code owner August 8, 2026 22:45
@codecov

codecov Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.35%. Comparing base (04a8ddd) to head (7a4b0d8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4385      +/-   ##
==========================================
+ Coverage   82.18%   82.35%   +0.17%     
==========================================
  Files         501      502       +1     
  Lines       19847    19877      +30     
==========================================
+ Hits        16310    16368      +58     
+ Misses       3537     3509      -28     
Files with missing lines Coverage Δ
...ntelemetry/sdk/metrics/view/attributes_processor.h 92.11% <ø> (+7.90%) ⬆️
sdk/src/configuration/sdk_builder.cc 58.35% <100.00%> (+0.77%) ⬆️
sdk/src/metrics/view/attributes_processor.cc 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mateenali66 mateenali66 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

exact-key matching works, but the config schema defines these as wildcard patterns, see inline

Comment thread sdk/src/configuration/sdk_builder.cc Resolved

@lalitb lalitb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks.

@dbarker dbarker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for PR! Please see feedback below.

Comment thread sdk/src/configuration/sdk_builder.cc Resolved

@dbarker dbarker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the changes. Please see requested changes below to cover the case when a user enters an empty included: field (all attributes must be retained).

Comment thread sdk/src/configuration/sdk_builder.cc Resolved

@dbarker dbarker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the feature!

@dbarker
dbarker merged commit f1e1c9c into open-telemetry:main Aug 11, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SDK] MetricFilter needs a new AttributeProcessor to handle IncludeExclude

5 participants