pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

[fix][client] Fix incorrect topic in OTel spans for multi-topic consumers

Open void-ptr974 opened this issue 6 months ago • 0 comments

Fixes #25895

Motivation

OTel consumer spans for multi-topic consumers used the internal dummy consumer topic, so traces could show span names and destination attributes like MultiTopicsConsumer-* instead of the actual message topic.

Modifications

Use the message topic when setting the consumer span destination, and keep the consumer topic only as a fallback for messages or callbacks that do not carry a topic.

Verifications

  • ./gradlew :pulsar-client-original:compileJava
  • ./gradlew :pulsar-broker:test --tests org.apache.pulsar.broker.service.OpenTelemetryTracingIntegrationTest.testMultiTopicConsumerTracing

void-ptr974 avatar May 30 '26 04:05 void-ptr974