Skip to content

[API/SDK] add WITH_LOG_FILTERING_PREVIEW option#4160

Open
dbarker wants to merge 5 commits into
open-telemetry:mainfrom
dbarker:add_log_filtering_preview_option
Open

[API/SDK] add WITH_LOG_FILTERING_PREVIEW option#4160
dbarker wants to merge 5 commits into
open-telemetry:mainfrom
dbarker:add_log_filtering_preview_option

Conversation

@dbarker

@dbarker dbarker commented Jun 15, 2026

Copy link
Copy Markdown
Member

Follow up to #4079 (comment)

Changes

  • adds WITH_LOG_FILTERING_PREVIEW option to guard the new log record filtering behavior
  • updates tests to cover the option
  • fixes some existing clang-tidy warnings in the impacted tests.

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

@dbarker dbarker changed the title [API/SDK] add log severity filtering preview option and update tests [API/SDK] add log filtering preview option and update tests Jun 15, 2026
@dbarker dbarker changed the title [API/SDK] add log filtering preview option and update tests [API/SDK] add WITH_LOG_FILTERING_PREVIEW preview option Jun 15, 2026
@dbarker dbarker changed the title [API/SDK] add WITH_LOG_FILTERING_PREVIEW preview option [API/SDK] add WITH_LOG_FILTERING_PREVIEW option Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.84%. Comparing base (e8c5f43) to head (3528600).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4160      +/-   ##
==========================================
+ Coverage   82.82%   82.84%   +0.02%     
==========================================
  Files         406      406              
  Lines       16913    16909       -4     
==========================================
  Hits        14007    14007              
+ Misses       2906     2902       -4     
Files with missing lines Coverage Δ
api/include/opentelemetry/logs/logger.h 81.12% <ø> (ø)
sdk/src/logs/logger.cc 90.30% <100.00%> (+0.58%) ⬆️

... and 2 files with indirect coverage changes

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

@dbarker dbarker marked this pull request as ready for review June 15, 2026 20:19
@dbarker dbarker requested a review from a team as a code owner June 15, 2026 20:19

@proost proost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

Comment thread api/include/opentelemetry/logs/logger.h Outdated

@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.

Comment thread api/include/opentelemetry/logs/logger.h Outdated
Co-authored-by: Marc Alff <marc.alff@free.fr>

@marcalff marcalff 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 patch.

See questions, for my own understanding, I don't grasp the rationale behind it.

Comment thread api/include/opentelemetry/logs/logger.h
Comment thread api/CMakeLists.txt
endif()

if(WITH_LOG_FILTERING_PREVIEW)
target_compile_definitions(opentelemetry_api

@dbarker dbarker Jun 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In this case, the flag should be renamed to OPENTELEMETRY_ENABLE_LOG_FILTERING_PREVIEW to avoid polluting the user build, and how to do a build in the user application should be documented with clarity.

@marcalff since all these preview flags are set with INTERFACE they will transit publicly to any targets that link to the opentelemetry-cpp::api target. If we apply a prefix it likely should be applied to all public definitions. Could this be a follow up PR?

@marcalff marcalff 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.

LGTM

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.

4 participants