dd-trace-js icon indicating copy to clipboard operation
dd-trace-js copied to clipboard

Fix aws-sdk distributed tracing when using .promise()

Open ekosz opened this issue 3 years ago • 1 comments

What does this PR do?

When using .promise() there is no callback for dd-trace-js to wrap. Before this change, that meant we never called tracer.extract on any incoming requests.

This changes the functionality by creating a "fake" callback for us to wrap and then immediately calling it.

Motivation

We use the sqs-consumer library that uses sqs.receiveMessage({}).promise(). Meaning we currently don't get any distributed traces currently.

Plugin Checklist

Additional Notes

Fixes #1680

ekosz avatar Nov 09 '21 18:11 ekosz

@rochdev The code here is pretty messy still. More of a POC than anything else ATM. Happy to clean it up / add additional tests still

ekosz avatar Nov 09 '21 18:11 ekosz

Is this a feature that you'd still be interested in working on? Looks like there are some conflicts and that Roch had some concerns.

tlhunter avatar Dec 20 '23 00:12 tlhunter

I'll close this PR for now but we can consider reopening it in the future.

tlhunter avatar Jan 12 '24 17:01 tlhunter