Skip to content

[SDK] Add logger scope configurator #3282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Mar 20, 2025

Conversation

psx95
Copy link
Contributor

@psx95 psx95 commented Feb 20, 2025

Fixes #2641

Adds scope configurator for Loggers.

Similar work was done for Tracers in #3137 and Meters in #3268.

Changes

  • Updates the Logging SDK to add support for LoggerConfigurator as per the spec changes.
  • Adds a LoggerConfig class that can be used to configure a logger's behavior as per spec.

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

Copy link

netlify bot commented Feb 20, 2025

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit 511f7a1
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/67d9c9237cdc7f000843aac5

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 88.23529% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.50%. Comparing base (148cfe9) to head (511f7a1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sdk/src/logs/logger_provider.cc 50.00% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3282      +/-   ##
==========================================
+ Coverage   89.48%   89.50%   +0.03%     
==========================================
  Files         208      210       +2     
  Lines        6497     6522      +25     
==========================================
+ Hits         5813     5837      +24     
- Misses        684      685       +1     
Files with missing lines Coverage Δ
sdk/include/opentelemetry/sdk/logs/logger_config.h 100.00% <100.00%> (ø)
sdk/src/logs/logger.cc 82.23% <100.00%> (+3.28%) ⬆️
sdk/src/logs/logger_config.cc 100.00% <100.00%> (ø)
sdk/src/logs/logger_context.cc 100.00% <100.00%> (ø)
sdk/src/logs/logger_provider.cc 89.14% <50.00%> (-1.77%) ⬇️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@psx95 psx95 force-pushed the add-logger-scope-config branch 2 times, most recently from 0c57591 to 852a3c9 Compare February 27, 2025 04:45
@psx95 psx95 force-pushed the add-logger-scope-config branch from 20904c6 to 7290f73 Compare March 12, 2025 01:38
@psx95 psx95 marked this pull request as ready for review March 12, 2025 02:55
@psx95 psx95 requested a review from a team as a code owner March 12, 2025 02:55
psx95 added 4 commits March 12, 2025 16:11
Comparison of timestamps has been moved from GT to GE since depending on
the machine, the operations may execute within 1 ns, which is lower
than the resolution of time being captured.
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 feature.

@marcalff marcalff merged commit d09bfba into open-telemetry:main Mar 20, 2025
58 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] Add simple scope configuration to Tracer, Meter, Logger
3 participants