Skip to content

Conversation

nikhilbhatia08
Copy link
Contributor

@nikhilbhatia08 nikhilbhatia08 commented Sep 8, 2025

Fixes #3546

Changes

Created a new Attribute processor for exclude list as filter only partially exists for allowed list

This is the doc of spec - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#stream-configuration

Please provide a brief description of the changes here.

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

@nikhilbhatia08 nikhilbhatia08 requested a review from a team as a code owner September 8, 2025 13:46
Copy link

codecov bot commented Sep 8, 2025

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.04%. Comparing base (79d43fc) to head (0f3bf65).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ntelemetry/sdk/metrics/view/attributes_processor.h 88.89% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3633      +/-   ##
==========================================
- Coverage   90.05%   90.04%   -0.00%     
==========================================
  Files         220      220              
  Lines        7081     7097      +16     
==========================================
+ Hits         6376     6390      +14     
- Misses        705      707       +2     
Files with missing lines Coverage Δ
...ntelemetry/sdk/metrics/view/attributes_processor.h 86.49% <88.89%> (+0.78%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lalitb lalitb requested a review from Copilot September 8, 2025 18:16
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a new FilteringExcludeAttributesProcessor class that filters out specified attributes from metrics, complementing the existing include-list functionality. The implementation follows the OpenTelemetry specification for stream configuration attribute filtering.

Key changes:

  • Added FilteringExcludeAttributesProcessor class with exclude-list functionality
  • Implemented corresponding unit tests to validate the new processor behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
sdk/include/opentelemetry/sdk/metrics/view/attributes_processor.h Adds new FilteringExcludeAttributesProcessor class implementation
sdk/test/metrics/attributes_processor_test.cc Adds unit tests for the new exclude-list attribute processor

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

Thanks.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

Thanks for the fix.

The code looks ok, but the tests are inconclusive, and could be much stronger.

See comments.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@marcalff marcalff merged commit a025766 into open-telemetry:main Sep 11, 2025
66 checks passed
@nikhilbhatia08 nikhilbhatia08 deleted the metric_filter branch September 16, 2025 15:54
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
4 participants