Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

ekosz
Copy link

@ekosz ekosz commented Nov 9, 2021

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

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.

Fixes DataDog#1680
@ekosz
Copy link
Author

ekosz commented Nov 9, 2021

@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

Copy link
Member

@rochdev rochdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! However, this only works for a very specific usage of the library. Please see #1680 (comment) for more context and a potential alternative solution.

@astuyve astuyve requested a review from a team as a code owner July 18, 2023 20:32
@tlhunter tlhunter requested a review from a team as a code owner August 15, 2023 22:07
@tlhunter tlhunter requested review from jbertran and removed request for a team August 15, 2023 22:07
@tlhunter
Copy link
Member

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
Copy link
Member

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

@tlhunter tlhunter closed this Jan 12, 2024
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.

aws-sdk sqs does not extract trace info when using promises
3 participants