Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opentelemetry-spring-boot-starter MDC Instrumentation for logback not injecting trace id #13383

Open
Coupon-King opened this issue Feb 24, 2025 · 0 comments · May be fixed by #13391
Open

opentelemetry-spring-boot-starter MDC Instrumentation for logback not injecting trace id #13383

Coupon-King opened this issue Feb 24, 2025 · 0 comments · May be fixed by #13391
Labels
bug Something isn't working needs triage New issue that requires triage

Comments

@Coupon-King
Copy link

Coupon-King commented Feb 24, 2025

Describe the bug

When integrating opentelemetry-spring-boot-starter version 2.13.1 with Spring Boot 2.7.18, the traceId is not injected into the logs.

Steps to reproduce

Providing the properties I'm using.

otel:
  logs:
    exporter: none
  metrics:
    exporter: none
  traces:
    exporter: none
  instrumentation:
    logback-mdc:
      enabled: true

The Properties of logback
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}%.-3d{Z}:00][%-5level][%mdc][%15.15thread] %40.40C{1} %-4L : [%m]%n</pattern>
In the output log, the content obtained by %mdc is empty.

Expected behavior

In the printed log information, %mdc can obtain the information that contains traceid.

Actual behavior

In the output log, the content obtained by %mdc is empty.

Javaagent or library instrumentation version

opentelemetry-spring-boot-starter 2.13.1

Environment

JDK: JDK17

Additional context

No response

@Coupon-King Coupon-King added bug Something isn't working needs triage New issue that requires triage labels Feb 24, 2025
@laurit laurit linked a pull request Feb 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant