Aws-xray-sdk-node: Postgres queries fail when using `Submittable` interface

Created on 24 Oct 2020  路  4Comments  路  Source: aws/aws-xray-sdk-node

When capturing postgres is enabled queries made with the Submittable interface cause a TypeError indicating

Client was passed a null or undefined query at Client.query

This makes it so the postgres capture does not work with pg-cursor or pg-query-stream.

bug

All 4 comments

Hi @bryanjcof,

Thanks for raising this issue. It seems like there are two problems: the first is that the arguments to client.query() would not be resolved correctly here for pg-query-stream, since we'd have to access the underlying cursor object instead of accessing the query parameters directly. We'll also have to add some additional logic to call the query function with the original object rather than our reconstructed parameters here. If you'd like to get started on a PR that adds these that would be very helpful, otherwise I'll prioritize this fix when I'm able.

Thanks for looking into it! I didn't dig around enough to have a real idea of what was necessary to resolve the issue. For now the query stream is used in a small subset of the lambda based application I'm working on so the easy road forward was to not call capturePostgres for that specific lambda invocation and to revisit at a later time. Which is to say I'd love to see this fix but I doubt it is high enough priority for me or the team to work on the PR to address it in anything approaching the near future. We appreciate your work on this tool though, thank you!

Hey @bryanjcof ,

We will put this in our backlog and work on it when available. Thanks for the patience.

Hi, i encountered the same issue here, and we use pg-query-stream for it, it would be nice that it can be fixed please
thanks a lot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

agustinhaller picture agustinhaller  路  7Comments

thomasmichaelwallace picture thomasmichaelwallace  路  5Comments

chearmstrong picture chearmstrong  路  6Comments

nicodeg87 picture nicodeg87  路  7Comments

jhecking picture jhecking  路  8Comments