Skip to content

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

Open
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:fix-otel-consumer-topic
Open

[fix][client] Fix incorrect topic in OTel spans for multi-topic consumers#25894
void-ptr974 wants to merge 1 commit into
apache:masterfrom
void-ptr974:fix-otel-consumer-topic

Conversation

@void-ptr974
Copy link
Copy Markdown
Contributor

@void-ptr974 void-ptr974 commented May 30, 2026

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 void-ptr974 changed the title Fix OTel consumer destination topic [fix][client] Fix OTel consumer destination topic May 30, 2026
@void-ptr974 void-ptr974 changed the title [fix][client] Fix OTel consumer destination topic [fix][client] Use actual topic in OTel consumer spans May 30, 2026
@void-ptr974 void-ptr974 changed the title [fix][client] Use actual topic in OTel consumer spans [fix][client] Fix incorrect topic in OTel consumer spans May 30, 2026
@void-ptr974 void-ptr974 force-pushed the fix-otel-consumer-topic branch from 2f7ea38 to 08eca2b Compare May 30, 2026 05:11
@void-ptr974 void-ptr974 force-pushed the fix-otel-consumer-topic branch from 08eca2b to 39e8441 Compare May 30, 2026 06:06
@void-ptr974 void-ptr974 changed the title [fix][client] Fix incorrect topic in OTel consumer spans [fix][client] Fix incorrect topic in OTel spans for multi-topic consumers May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] OTel consumer spans use incorrect topic for multi-topic consumers

1 participant