KEMBAR78
Potentially common error when registering log record processors via AutoConfigurationCustomizer? · Issue #6599 · open-telemetry/opentelemetry-java · GitHub
Skip to content

Potentially common error when registering log record processors via AutoConfigurationCustomizer? #6599

@trask

Description

@trask

I only just found that the way I've been registering log processors via AutoConfigurationCustomizer is seriously flawed, and worried other people may be doing the same:

AutoConfigurationCustomizer.addLoggerProviderCustomizer(
            (builder, otelConfig) -> builder.addLogRecordProcessor(...))

Since this will register the log record processor after the BatchLogRecordProcessor, any mutations made by the log record processor may not be exported, although 99.9% (~) of the time the mutations will be exported since they will be made prior to the batch being exported.

One (non-obvious) workaround is to leverage AutoConfigurationCustomizer.addLogRecordProcessorCustomizer().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions