- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1k
 
Closed
Labels
bugSomething isn't workingSomething isn't workingneeds triageNew issue that requires triageNew issue that requires triage
Description
Describe the bug
OpenTelemetryAppender.install iterates through all the loggers to find appenders where it should inject the sdk. When using an async appender though, OpenTelemetryAppender is referenced through the async appender rather than directly from a logger so the sdk does not get installed.
Steps to reproduce
    <appender name="otel-async" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="otel-sync" />
    </appender>
    <appender name="otel-sync" class="io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender">
        <captureExperimentalAttributes>true</captureExperimentalAttributes>
        <captureMarkerAttribute>true</captureMarkerAttribute>
        <captureKeyValuePairAttributes>true</captureKeyValuePairAttributes>
    </appender>
    <root level="DEBUG">
        <appender-ref ref="otel-async"/>
    </root>
Expected behavior
Appender references would be traversed recursively and the sdk installed on appenders that are only referenced from other appenders.
Actual behavior
Only appenders referenced directly from a logger are iterated. The following can workaround the issue, but it's non-obvious.
    <logger name="dummy" level="OFF">
      <appender-ref ref="otel-sync" />
    </logger>
Javaagent or library instrumentation version
2.11
Environment
JDK: 17
OS: Ubuntu 23.10
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds triageNew issue that requires triageNew issue that requires triage