End-to-end traceId
One request, five entry points, the same traceId.
Where it comes from
The trace id is written into MDC by Micrometer Tracing (OTel bridge) and is the only source of trace ids in the whole framework. Do not build your own and do not add a custom trace header.
How to read it
MiniMaoContextHolder.getTraceId()
- The response body carries a
traceIdfield directly; the front end reads it from there, with no custom response header. - Cross-service propagation uses the standard
traceparentonly.
Five entry points, one value
| Entry point | Notes |
|---|---|
| HTTP request | created by the trace entry filter |
| Scheduled task | continued at the task entry point |
| Message consumption | continued at the consumption entry point |
| Thread-pool task | use the framework executor; context propagates automatically |
| Async call | context and MDC propagate together and are restored afterwards |
Warning: new Thread and self-built thread pools are banned: context cannot cross them and the traceId breaks.
How to read an empty value
[] in the log means the line is not inside any request (startup, first servlet initialization, non-HTTP entry point), not that the chain was lost. If access logs appear "sometimes missing", check this first.
Last updated 2026-10-09Edit this page →