Add utility to extract Datadog trace context from serialized TextMapCarrier in AWS message attributes (e.g., SQS, SFN, SNS) #3510
u-kai
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Package Name
aws (contrib/aws/aws-sdk-go-v2)
Package Version(s)
current stable
Describe the feature you'd like
Datadog provides an official way to inject span context into a TextMapCarrier, which many users then serialize (e.g., via json.Marshal(carrier)) and store into a message attribute (like AWS SQS/SNS/SFN).
https://github.com/DataDog/dd-trace-go/blob/d17f78d5628b079ba3877d0e6915179bc699a3a6/contrib/aws/aws-sdk-go-v2/internal/sqs/sqs.go#L26C1-L106C2
However, there is no matching utility to extract this context from the message attribute.
Users are forced to implement manual deserialization and context extraction, which is repetitive and easy to get wrong.
I would like to request a standard utility to go from a TextMapCarrier string back to a SpanContext.
Apologies if this is already supported in some way and I’ve missed it—please feel free to point me in the right direction if so!
Is your feature request related to a problem?
Yes. Currently, we must repeatedly implement the logic to decode JSON strings and convert them into TextMapCarrier for extraction via
tracer.Extract
.Describe alternatives you've considered
No response
Additional context
This pattern is used in:
SQS, SNS, and SFN messaging etc...
Beta Was this translation helpful? Give feedback.
All reactions