SpringBoot3+Micrometer: Missing traceId when handling exception #36353
Labels
for: external-project
For an external project and not something we can fix
status: invalid
An issue that we don't feel is valid
Context:
springboot version: 3.0.0 and 3.1.1
I upgraded my projected to springboot 3 and use micrometer as traceability. In most flows, the traceId is attached in MDC. But at some exception handling scenarios, the traceId is missing. Also the same test scenario use at spirngboot2 + sleuth, the traceId remains.
my configs and code:
(BTW i upload my test project with unit test at https://github.com/gecan123/tracing-test, you may click in my project and see all error scenarios in unit test. Also the test report is in github actions artifact, please read README.md)
when i call
/error
endpoint directly, i get response with traceId.when i call
/path-not-exist
and request will redirect to/error
endpoint, but response without traceId.Then i put more scenarios in my repo:
/error
, response without traceId./error
, response without traceId.I have found the issue may raised by the class in spring is ServerHttpObservationFilter, but no idea why it run another time after exception is thrown.
Thank you and look forward to your reply!
The text was updated successfully, but these errors were encountered: