feat(kafka): add span links for pub/sub tracing#2952
feat(kafka): add span links for pub/sub tracing#2952coolwednesday merged 10 commits intogofr-dev:developmentfrom
Conversation
6abc11b to
bac2358
Compare
|
Please fix the title of the PR. |
bac2358 to
8e7e2af
Compare
|
@coolwednesday , have renamed the title |
a628f22 to
f387d98
Compare
Thanks ! Will review. |
coolwednesday
left a comment
There was a problem hiding this comment.
The tracer name is currently set to "gofr". It would be better to use a constant or a more specific package-level name (for example, gofr.dev/pkg/gofr/datasource/pubsub/kafka). This makes it easier for users to filter and identify traces by the source library.
Verifying span links with GoFr + Jaeger (Docker)
To validate your span link implementation:
- Jaeger stores spans with links and converts those links into references (typically
FOLLOWS_FROM). - You can inspect these in the Jaeger UI at
localhost:16686under span details. - Jaeger does not show a dedicated “span link” label — links appear as normal references.
If you see additional FOLLOWS_FROM references, it indicates your span links are being exported correctly.
f0a8b8d to
495e1f4
Compare
|
@VIDHITTS, Also, Please do add screenshot. |
495e1f4 to
3b58e83
Compare
3b58e83 to
8271e43
Compare
|
Hi @coolwednesday and @Umang01-hash, Thank you for reviewing and merging the Kafka implementation! Since the Kafka phase is finalized, I am ready to generalize this approach for the remaining pub/sub backends (Google Pub/Sub, NATS, SQS, etc.) to fully close out this issue. How would you prefer I handle the remaining implementations? Raise one combined PR for all remaining backends? Raise individual, separate PRs for each backend? |
Implement OpenTelemetry span links for SQS pub/sub tracing following the same pattern established in the Kafka implementation (PR gofr-dev#2952). - Add attributeCarrier implementing propagation.TextMapCarrier for SQS MessageAttributes - Inject trace context into message attributes during Publish - Extract trace context from message attributes during Subscribe and create span links to the producer span - Request 'All' MessageAttributeNames in ReceiveMessage to ensure trace context attributes are returned - Add comprehensive unit tests for carrier, injection, extraction, and span creation Fixes gofr-dev#3015
Implement OpenTelemetry span links for Google Cloud Pub/Sub tracing following the same pattern established in the Kafka implementation (PR gofr-dev#2952). - Add attributeCarrier implementing propagation.TextMapCarrier for GCP PubSub message Attributes (map[string]string) - Inject trace context into message attributes during Publish - Extract trace context from message attributes during Subscribe and create span links to the producer span - Move span creation in Subscribe to after message receipt so headers are available for link extraction - Add comprehensive unit tests for carrier, injection, extraction, and span creation Fixes gofr-dev#3011

Description:
Breaking Changes (if applicable):
Additional Information:
go.opentelemetry.io/otelfor trace context propagationChecklist:
goimportandgolangci-lint.Thank you for your contribution!