Skip to content

Conversation

trask
Copy link
Member

@trask trask commented Jul 31, 2025

See alternative in #4612

Some related prior discussions:

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

Here's an example of how it would look like to use both of these in declarative configuration:

file_format: "1.0"

logger_provider:
  processors:
    - minimum_severity_filter:
        severity: "ERROR"
        delegate:
          trace_based_filter:
            delegate:
              batch:
                exporter:
                  otlp:
                    endpoint: "http://localhost:4317"

@trask trask force-pushed the severity-and-trace-based-log-processors branch from ca86d92 to a5e39f1 Compare July 31, 2025 03:59
and return `true` if not available.
* [`OnEmit`](#onemit) - If the log record is associated with a valid span
context that is not sampled, MUST NOT forward it to the delegate. Otherwise, MUST
forward the log record to the delegate.
Copy link
Member

Choose a reason for hiding this comment

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

nit: Could we update the desc of this to make it more obvious that if the log is emitted outside any active spans, then they are not subject to filtering?

Copy link
Member Author

Choose a reason for hiding this comment

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

rewrote, ptal

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Looks good overall! Waiting to undraft!

@trask trask force-pushed the severity-and-trace-based-log-processors branch from 7dc4d37 to f0f47fa Compare July 31, 2025 14:46
@trask
Copy link
Member Author

trask commented Aug 5, 2025

Based on discussion in today's spec SIG meeting, I am going to proceed with #4612 instead

@trask trask closed this Aug 5, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 23, 2025
…ers (#4612)

Alternative to #4611

Some related prior discussions:
-
#4208 (comment)
-
#4207 (comment)

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
```

---------

Co-authored-by: Liudmila Molkova <[email protected]>
Co-authored-by: Robert Pająk <[email protected]>
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.

3 participants