Skip to content

Conversation

trask
Copy link
Member

@trask trask commented Aug 1, 2025

Alternative to #4611

Some related prior discussions:

Java POC @ open-telemetry/opentelemetry-java#7529

Declarative config for this is a bit nicer than in #4611, also supports applying different minimum severity levels to different loggers:

file_format: "1.0"

logger_provider:
  logger_configurator/development:
    default_config:
      minimum_severity: WARN
      trace_based: true
    loggers:
      - name: "com.example.app.*"
        config:
          minimum_severity: INFO
      - name: "com.example.db.*"
        config:
          minimum_severity: ERROR

@pellared
Copy link
Member

pellared commented Aug 1, 2025

This does not support having different minimum severity levels for different processors (processing pipelines).
Isn't this can be critical/very important for OTel Collector?

From open-telemetry/opentelemetry-go-contrib#7549:

opentelemetry-collector enables users to configure its internal telemetry using otelconf. [...] For example, we need to configure leveled logging, which could theoretically be done with the minsev processor

CC @codeboten

It is possible to achieve the functionality of "logger configurator" using processors (e.g. logger filter). The question is whether we need a configuration option that is redundant? Moreover, using processors it is possible to compose more complex pipelines that are not possible using the logger configurator.

It should be possible to "implement" the declarative config of logger configurator using processors. Then the logger configurator would be a facade for configuring some processors.

PS.I think there were some similar/related discussions here #4439

If we are looking into simplicity then another alternative (mainly for default_config) could be setting the minimum severity level on the whole logger provider. This would require even "less config" but it would be not flexible.

@pellared
Copy link
Member

pellared commented Aug 5, 2025

Seems like there is a consensus to go forward with this proposal.

It looks like Collector already handles filtering using filterprocessor.

@pellared
Copy link
Member

pellared commented Aug 7, 2025

We discussed this during Go SIG meeting.
We are fine with the proposal given we want to implement this configuration using (internally) LogRecordProcessors. We do not want to add LoggerConfigurator into the Go Logs SDK, because we find it unnecessary as everything should be achievable using LogRecordProcessor. The experience for the end-user should remain the same.

CC @open-telemetry/go-triagers

Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 15, 2025
@MrAlias MrAlias removed the Stale label Aug 15, 2025
Co-authored-by: Liudmila Molkova <[email protected]>
@trask trask requested review from a team as code owners August 26, 2025 17:36
@carlosalberto
Copy link
Contributor

Is this expected to be stable from the start?

@trask
Copy link
Member Author

trask commented Aug 29, 2025

Is this expected to be stable from the start?

no, I checked and I think most of it is under Development sections already, did find one place where it was missed: c68bba4

Copy link

github-actions bot commented Sep 9, 2025

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@pellared pellared requested a review from Copilot September 9, 2025 17:19
Copilot

This comment was marked as outdated.

@trask trask requested a review from Copilot September 9, 2025 17:20
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 introduces fine-grained logger configuration capabilities by adding minimum_severity and trace_based filtering parameters to the logger configuration system. This allows for more sophisticated log filtering strategies beyond simple enable/disable toggles.

  • Adds two new configuration parameters: minimum_severity for severity-level filtering and trace_based for trace-sampling-based filtering
  • Updates the Enabled method to incorporate the new filtering criteria
  • Defines filtering logic for the Emit a LogRecord operation to ensure consistent behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@carlosalberto
Copy link
Contributor

Maybe have a last look @codeboten @open-telemetry/configuration-approvers ?

@lmolkova lmolkova added this pull request to the merge queue Sep 23, 2025
Merged via the queue into open-telemetry:main with commit 5bc1f13 Sep 23, 2025
7 checks passed
@lmolkova lmolkova deleted the severity-and-trace-based-log-processors-alt branch September 23, 2025 15:17
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.

7 participants