I have one QuarkusMain
app which calls a Quarkus API through RestClient
I annotated my run()
method with @WithSpan
and was able to get a spanId and a traceId in my QuarkusMain app:
@Override
@WithSpan
public int run(String... args) {
// my business logic
}
The run
method calls a REST service in another quarkus application through a RestClient
interface.
The issue is that I am not able to get the same traceId in my Quarkus API.
I saw here: https://quarkus.io/guides/opentelemetry that the context was automatically propagated. Am I missing something ?
Edit 1 with additional infos:
For instance, the log in my Quarkus main tells:
{"spanId":"1e0a6b40db4a3e24","traceId":"d9a4bc00ab3b2f576223de16f1026fc7","sampled":"true"}
The log in my Quarkus API:
{"spanId":"6b490589e3a7650d","parentId":"d7b1d6a2ab520e84","traceId":"079089560b1a4d0af84252a86bfa0e74","sampled":"true"}
And finally the traceparent
header received by my API:
00-079089560b1a4d0af84252a86bfa0e74-d7b1d6a2ab520e84-01
We can see that the traceparent header matches the log in API level. So my conclusion is something is happening between the log in my main class and the call to the API. It seems that others spanId/traceId are generated before calling my api.
Edit 2 with resources and config:
Quarkus version: 2.16.4.Final
Dependency:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-opentelemetry</artifactId>
</dependency>
Config:
quarkus.opentelemetry.enabled=true