Open dcfranca opened 1 year ago
Anyone?
Hello! I've shared this ticket with the Serverless team at Datadog who previously created that support in Python/NodeJS. It sounds like this isn't currently supported today directly, but they'll be noting down this as a feature request. If you'd like to attach your orgs information to that feature request feel free to open a ticket with Datadog Support
@purple4reina @nhulston If I'm not mistaken, PR #2917 should fulfil this request.
@purple4reina @nhulston If I'm not mistaken, PR #2917 should fulfil this request.
@darccio This PR only injects trace context for SQS/SNS producers. There is no logic in dd-trace-go for SQS/SNS consumers to extract trace context. This is all we need to get distributed tracing to work in Lambda, since trace extraction in Lambda is handled by the Datadog Lambda Extension.
This will not fully work in non-serverless cases, since consumer code isn't implemented yet.
To get distributed tracing support in Lambda, users will need to wrap their function handler and call AppendMiddleware
:
import (
awstrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go-v2/aws"
)
func main() {
lambda.Start(ddlambda.WrapFunction(FunctionHandler, nil))
}
func FunctionHandler(ctx context.Context, input LambdaInput) (int, error) {
cfg, err := config.LoadDefaultConfig(ctx)
if err == nil {
awstrace.AppendMiddleware(&cfg)
}
}
@nhulston Thanks for the clarification!
@dcfranca Does it the provided fulfil your request?
I see that this feature is supported on Python and NodeJS, is it supported in Go?
There is a similar issue closed on the dd-trace-js: https://github.com/DataDog/dd-trace-js/issues/1280 And the documentation mentions Python and NodeJS: https://www.datadoghq.com/blog/aws-serverless-tracing-datadog-apm/
I have an application that I'm trying to implement a distributed tracing for the same scenario:
I'm wrapping the SNS client in DD AWS Trace
Then, passing the context:
And then wrapping the SQS client, and receiving the context
However, the trace stops at publishing to SNS, doesn't follow the e2e process as I would like to
So, in the tracing I can see the request flowing from the http request to the SNS publishing, but nothing else.
The body of the message looks like this:
And nothing on the message attributes
Is it possible to implement it in Go? If so, how?