You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My ideal result would be: for each messages that passes through the kafka a span reporting reading from kafka, and a child span to the correct kafka span that represent the http client request.
However when I run the application with a lot of messages in the Kafka, the child spans are randomly aggregated to be children of some of the spans that represent the kafka consumer, without a correct correlation between them.
Am I doing something wrong? is there a way to structure my code so my operations will be associated with the correct kafka consumer span?
Working with buffers
As a next step, I am performing some batch aggregations, and the code looks something like this:
For me, the ideal result here would be two types of traces:
a trace that is similar to the one in the first section (a kafka consume span -> an http client span)
a trace representing the batched operation, which has one span of an http client from the myAsyncOperation function, with links to all the traces that was buffered in the buffer.
I know that for this one I would have to do some manual instrumentation, and I was looking for some guidance. My best attempt so far was to add a map step before the buffer to add the current SpanContext to the messages and then create a span after the buffer named "batch" with links to the different contexts in the buffer, but again the async operation got associated with randomly wrong batch spans, not the correct ones (may be the same behavior as in the first section)
If anyone can shed some light on how the reactor instrumentation is expected to work and clues to help me get to the desired behavior i'd be grateful!
Here is a repository with a full reproduction + automatic setup of Kafka & Jaeger for your convenience: https://github.com/almogtavor/spring-boot-reactor-kafka-example
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all, I am trying to instrument a reactor kafka pipeline and have a few questions:
Connecting child spans of operations to the correct kafka consume span
My initial code looks something like this:
My ideal result would be: for each messages that passes through the kafka a span reporting reading from kafka, and a child span to the correct kafka span that represent the http client request.
However when I run the application with a lot of messages in the Kafka, the child spans are randomly aggregated to be children of some of the spans that represent the kafka consumer, without a correct correlation between them.
Am I doing something wrong? is there a way to structure my code so my operations will be associated with the correct kafka consumer span?
Working with buffers
As a next step, I am performing some batch aggregations, and the code looks something like this:
For me, the ideal result here would be two types of traces:
myAsyncOperation
function, with links to all the traces that was buffered in the buffer.I know that for this one I would have to do some manual instrumentation, and I was looking for some guidance. My best attempt so far was to add a map step before the buffer to add the current
SpanContext
to the messages and then create a span after the buffer named "batch" with links to the different contexts in the buffer, but again the async operation got associated with randomly wrong batch spans, not the correct ones (may be the same behavior as in the first section)If anyone can shed some light on how the reactor instrumentation is expected to work and clues to help me get to the desired behavior i'd be grateful!
Here is a repository with a full reproduction + automatic setup of Kafka & Jaeger for your convenience:
https://github.com/almogtavor/spring-boot-reactor-kafka-example
Beta Was this translation helpful? Give feedback.
All reactions