Search before reporting
Read release policy
User environment
- Pulsar Java client with OpenTelemetry tracing enabled
- Partitioned topic producer
- Broker version is not expected to be specific to this issue
Issue Description
The OTel producer interceptor caches the topic from the first producer it processes.
For partitioned producers, the same interceptor can be used by multiple internal partition producers. For example, if the first message is sent to:
persistent://public/default/my-topic-partition-0
the interceptor caches that topic. If a later message is sent to:
persistent://public/default/my-topic-partition-1
the producer span can still be created as:
send persistent://public/default/my-topic-partition-0
and messaging.destination.name can also be reported as:
persistent://public/default/my-topic-partition-0
Expected behavior: OTel producer spans should report the topic of the partition producer that sends the message.
Actual behavior: OTel producer spans can report the topic from a different partition.
Error messages
No error message is produced. The issue is visible in exported OTel span data.
Reproducing the issue
- Create a partitioned topic with multiple partitions.
- Create a Pulsar Java client with OpenTelemetry tracing enabled.
- Create a producer for the partitioned topic.
- Send messages to multiple partitions, for example with round-robin routing and batching disabled.
- Inspect exported producer spans.
Producer spans for later partitions can contain the first cached partition topic in the span name and messaging.destination.name.
Additional information
Related PR: #25896
Are you willing to submit a PR?
Search before reporting
Read release policy
User environment
Issue Description
The OTel producer interceptor caches the topic from the first producer it processes.
For partitioned producers, the same interceptor can be used by multiple internal partition producers. For example, if the first message is sent to:
persistent://public/default/my-topic-partition-0the interceptor caches that topic. If a later message is sent to:
persistent://public/default/my-topic-partition-1the producer span can still be created as:
send persistent://public/default/my-topic-partition-0and
messaging.destination.namecan also be reported as:persistent://public/default/my-topic-partition-0Expected behavior: OTel producer spans should report the topic of the partition producer that sends the message.
Actual behavior: OTel producer spans can report the topic from a different partition.
Error messages
No error message is produced. The issue is visible in exported OTel span data.
Reproducing the issue
Producer spans for later partitions can contain the first cached partition topic in the span name and
messaging.destination.name.Additional information
Related PR: #25896
Are you willing to submit a PR?