What version of Sleuth are you using? If it's 3.x, please use Sleuth's Tracer
instead of Brave's.
Since Spans are representing operations, the spanId
will be different for every Span
, the parentId
is really mean the Id of the previous (parent) Span
so it is completely normal if the parentId
is not the same for two different Spans (if they don't share the same parent).
Please see the docs: https://docs.spring.io/spring-cloud-sleuth/docs/current/reference/htmlsingle/#getting-started-terminology

The parentId
s of the Spans here are the following:
- Span A: null
- Span B: A
- Span C: B
- Span D: C
- Span E: D
- Span F: C
- Span G: F