OTEL traceId not propagated across kafka #34582
Replies: 4 comments 4 replies
-
/cc @alesj (kafka), @brunobat (opentelemetry,tracing), @cescoffier (kafka), @ozangunalp (kafka), @radcortez (opentelemetry,tracing) |
Beta Was this translation helpful? Give feedback.
-
To clarify I think that the trace ids are not propagated when message publishing to kafka is done on a different thread. Is there any way around it ? |
Beta Was this translation helpful? Give feedback.
-
Question also posted here : https://stackoverflow.com/questions/76654066/quarkus-open-telemetry-distributed-tracing-does-not-carry-over-traceid-across |
Beta Was this translation helpful? Give feedback.
-
I think @Ladicek's answer is correct in the stackoverflow question. The propagation would not work in this case. // get current OpenTelemetry context
var oTelCtx = QuarkusContextStorage.INSTANCE.current();
...
// then using the emitter you'd construct the message with your own TracingMetadata
emitter.emit(KafkaRecord.of(...).addMetadata(TracingMetadata.withCurrent(oTelCtx))); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a micros service architecture of quarkus applications some of which are communicating over kafka.
Quarkus version = 2.16.5Final
What I observe is that the traceId is not getting propagated over kafka.
All applications have the following dependencies added :
implementation 'io.quarkus:quarkus-opentelemetry-exporter-otlp' implementation("io.opentelemetry:opentelemetry-extension-trace-propagators")
and the below properties set :
%dev.quarkus.opentelemetry.enabled=true %dev.quarkus.opentelemetry.tracer.exporter.otlp.endpoint=http://... %dev.quarkus.log.console.format=%d{HH:mm:ss} %-5p traceId=%X{traceId}, parentId=%X{parentId}, spanId=%X{spanId} [%c{2.}] (%t) %s%e%n
I find that the communication over REST is being traced but the tracing is lost when the message goes over kafka.
Is this something that is not supported or do I need to addition configuration ?
Note : Kafka communication is being done via smallrye annotations :
@Channel MutinyEmitter<?> emitter
and being sent viaMutinyEmitter.send()
and received via
@Incoming
(org.eclipse.microprofile.reactive.messaging.Incoming) annotationsBeta Was this translation helpful? Give feedback.
All reactions