2

I'm trying to setup distributed tracing for my micronaut service with GCP cloud trace. Service is written in kotlin with coroutines and micronaut version is 1.3.7.

When I make a request to my application I can see the traces in the gcp-console. But any http call made by my application to subsequent services ends up as different traces instead of spans within one trace. If I look at the trace headers I can see that it seems to switch trace id when switching threads.

How do I get micronaut to use the same trace-id across threads for the duration of a request?

Sample application: https://github.com/bjor-joh/micronaut-distributed-tracing

This is what it looks like in GCP enter image description here

The one at the top and the two to the right of that is the same request but end up as three individual traces instead of spans within the same one.

0 Answers0