I wrote a Spring Boot REST API that uses micrometer to log the traceId & spanId, and I can even obtain this data in my @Service
class through:
<code>@Autowired
private Tracer tracer;
...
tracer.currentTraceContext().context().traceId()
tracer.currentTraceContext().context().spanId()
</code>
<code>@Autowired
private Tracer tracer;
...
tracer.currentTraceContext().context().traceId()
tracer.currentTraceContext().context().spanId()
</code>
@Autowired
private Tracer tracer;
...
tracer.currentTraceContext().context().traceId()
tracer.currentTraceContext().context().spanId()
However, I don’t know how to propagate this data when I call to another REST API.
Any ideas?
Get a concrete answer about how to propagate traceId & spanId between microservices/REST API calls.
New contributor
Rodrigo López Gatica is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1