Reputation: 59
Let's say a request landed at the backend and we got the traceid. Now for some reasons, we need to push a message to the rabbit and that message will be read after a few minutes. How can I do that processing in that same traceid.
That message sent has a field in which we preserved the previous trace and span id.
We are using Spring 3 with micrometer.
POM:
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
<version>1.0.3</version>
</dependency>
Upvotes: 0
Views: 1132
Reputation: 59221
I don't think a trace is meant to cover processing that is scheduled for later execution in an event-based system.
In this case, you should consider creating a different trace in the rabbitMQ message processing but Link to the previous span: both spans aren't technically parent/child but a Link can materialize this relationship.
Upvotes: 0