Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Relationship between "receive" and "process" spans in Kafka consumers #1966

Open
vasilkosturski opened this issue Mar 6, 2025 · 0 comments

Comments

@vasilkosturski
Copy link

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 ChildOf receive, 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.
@vasilkosturski 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Need triage
Development

No branches or pull requests

1 participant