Skip to content

add OTel span links for MQTT pubsub tracing #3101

Closed
Umang01-hash wants to merge 4 commits intodevelopmentfrom
mqtt/span_links
Closed

add OTel span links for MQTT pubsub tracing #3101
Umang01-hash wants to merge 4 commits intodevelopmentfrom
mqtt/span_links

Conversation

@Umang01-hash
Copy link
Copy Markdown
Member

@Umang01-hash Umang01-hash commented Mar 5, 2026

Pull Request Template

Description:

MQTT 3.1.1 Limitation:

Unlike Kafka, SQS, and Google PubSub — which carry trace context in message headers/attributes — MQTT 3.1.1 has no user properties mechanism. The traceparent injected on publish cannot be transmitted through the broker to subscribers. As a result, subscriber spans are correctly created as orphan consumer spans (no link to the producer span).

Screenshots:

Screenshot 2026-03-05 at 1 36 53 PM Screenshot 2026-03-05 at 1 35 38 PM

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

@coolwednesday
Copy link
Copy Markdown
Member

MQTT does support metadata that can help facilitate smoother span link additions. However, we should address this after upgrading MQTT or by identifying a simpler approach to achieve proper correlation.

At the moment, adding independent span links does not seem to serve the intended purpose effectively. Hence, I am closing this PR for now.

I request the author to please discuss the proposed approach on the issue ticket first. Once the approach is reviewed and approved, the PR can be reopened or a new PR can be created accordingly.

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.

2 participants