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
Context:
I'm implementing OpenTelemetry tracing for a Kafka-based system (using Python) and need clarification on how to structure spans correctly for a consumer.
Kafka instrumentation auto-generates a receive span when the consumer picks up a message. This span is a child of the send span from the producer, though this is somewhat debatable as the proper producer->consumer relation seems to be FollowsFrom, done with a Link rather than ChildOf (see this issue for discussion). However, this is out of the scope of this question.
I manually create a process span when processing the message.
Question:
Should process be a ChildOfreceive, should it use FollowsFrom, or should they be independent siblings?
ChildOf implies receive depends on process, but receive just marks message pickup from the Kafka broker. So it doesn't seem to be the right relation.
FollowsFrom seems to make more sense as process always follows receive and receive is a prerequisite for process.
Or should they be independent siblings under the send span from the producer? This would be the default behavior as receive is automatically generated by the instrumentation, and I'm manually creating the process span attaching the send context from the producer via the TraceContextTextMapPropagator.
The text was updated successfully, but these errors were encountered:
vasilkosturski
changed the title
[Question] Relationship Between "receive" and "process" Spans in Kafka Consumers
[Question] Relationship between "receive" and "process" spans in Kafka consumers
Mar 6, 2025
Context:
I'm implementing OpenTelemetry tracing for a Kafka-based system (using Python) and need clarification on how to structure spans correctly for a consumer.
Kafka instrumentation auto-generates a
receive
span when the consumer picks up a message. This span is a child of thesend
span from the producer, though this is somewhat debatable as the proper producer->consumer relation seems to beFollowsFrom
, done with a Link rather thanChildOf
(see this issue for discussion). However, this is out of the scope of this question.I manually create a
process
span when processing the message.Question:
Should
process
be aChildOf
receive
, should it useFollowsFrom
, or should they be independent siblings?ChildOf
impliesreceive
depends onprocess
, butreceive
just marks message pickup from the Kafka broker. So it doesn't seem to be the right relation.FollowsFrom
seems to make more sense asprocess
always followsreceive
andreceive
is a prerequisite forprocess
.send
span from the producer? This would be the default behavior asreceive
is automatically generated by the instrumentation, and I'm manually creating theprocess
span attaching thesend
context from the producer via theTraceContextTextMapPropagator
.The text was updated successfully, but these errors were encountered: