Skip to content

aws-sdk sqs does not extract trace info when using promises  #1680

@ekosz

Description

@ekosz

At Lattice, we've been having issues with DD distributed traces and AWS SQS. Even though we see all of the aws.request spans created, none of them are connected to parent spans or the trace that created them in the first place. Finally after some digging / tracing I think I may know what it is.

We use sqs-consumer for managing our SQS queues. Looking the SQS dd-trace-js code, the extraction of the trace info happens at responseExtract. And that is ever called from wrapCb. And that is only called when there is a callback to wrap. But sqs-consumer uses the .promise() style of making requests to AWS. Which, as far as I can tell, makes it so the cb is undefined and makes it so we never call responseExtract.

Do you think I got that right? And if so do you know of another library that has this pattern that I could try and copy from to open a PR to fix?

Cheers!
Eric

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions