Skip to content

[CONFIGURATION] Implementing minimum_severity and trace_based attributes for LoggerConfig - #4131

Merged
marcalff merged 3 commits into
open-telemetry:mainfrom
om7057:fix/experimental-logger-config
Jun 7, 2026
Merged

marcalff merged 3 commits into
open-telemetry:mainfrom
om7057:fix/experimental-logger-config

Conversation

@om7057

@om7057 om7057 commented Jun 6, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4130

Changes

Description

Implements the missing minimum_severity and trace_based attributes for LoggerConfig in the declarative configuration spec.

Previously, LoggerConfigConfiguration only had an enabled boolean field. This PR adds:

  • minimum_severity (type: SeverityNumber, default: trace) — allows filtering log records by severity level
  • trace_based (type: bool, default: false) — enables/disables trace-based log filtering

These attributes align with the OpenTelemetry specification for logger configuration and enable users to control logging behavior via YAML configuration.

Example YAML usage:

logger_provider:
  logger_configurator/development:
    default_config:
      enabled: true
      minimum_severity: warn
      trace_based: false
    loggers:
      - name: my.noisy.logger
        config:
          minimum_severity: error
          trace_based: true

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

@om7057
om7057 requested a review from a team as a code owner June 6, 2026 07:55
@om7057

om7057 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @marcalff could you please review the changes in this PR, and assign the issue?

@proost

proost commented Jun 6, 2026

Copy link
Copy Markdown
Member

Can you update CHANGELOG.md?

@om7057

om7057 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Can you update CHANGELOG.md?

Yes, I've updated the CHANGELOG.md file as well. Could you please review all my changes and confirm whether this PR resolves the issue #4130 ?

@codecov

codecov Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.02%. Comparing base (e649c7f) to head (887a3da).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4131      +/-   ##
==========================================
+ Coverage   81.94%   82.02%   +0.09%     
==========================================
  Files         385      385              
  Lines       16067    16071       +4     
==========================================
+ Hits        13164    13181      +17     
+ Misses       2903     2890      -13     
Files with missing lines Coverage Δ
sdk/src/configuration/configuration_parser.cc 77.04% <100.00%> (+0.90%) ⬆️

... and 1 file with indirect coverage changes

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

@om7057

om7057 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

I've checked the coverage for the modified code also fixed the required checks of CI, could you please check once
@marcalff and see if the PR is ready to be merged.
Thank you!

@marcalff marcalff changed the title Implementing minimum_severity and trace_based attributes for LoggerConfig [CONFIGURATION] Implementing minimum_severity and trace_based attributes for LoggerConfig Jun 6, 2026
@marcalff

marcalff commented Jun 6, 2026

Copy link
Copy Markdown
Member

LGTM, waiting on CI to complete to merge.

@om7057

om7057 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

LGTM, waiting on CI to complete to merge.

Sure, all checks have passed!

@marcalff
marcalff merged commit af27cc9 into open-telemetry:main Jun 7, 2026
71 checks passed
@marcalff

marcalff commented Jun 7, 2026

Copy link
Copy Markdown
Member

@om7057

Now merged, thanks for the fix.

@om7057

om7057 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@om7057

Now merged, thanks for the fix.

Thank you so much for the merge!
Looking forward to contributing more for otel!

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.

[CONFIGURATION] File configuration - ExperimentalLoggerConfig

3 participants