-
Notifications
You must be signed in to change notification settings - Fork 57
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
Handle pg pool clients #272
Handle pg pool clients #272
Conversation
Not sure why circle ci is sad. Doesn't look like it anything from this PR though. |
Thanks for the contribution @markgaylard - we'll review and get back to you ASAP. I'm not sure why CI failed, it looks to be from an unrelated test that timed out. I've triggered the CI to run again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3 the test cases, super helpful! Mostly LGTM, just a couple small asks.
We found an issue when calling the promise returning version of
query
on a pg-pool client. These clients seem to behave a bit differently to both the query method on bothpg.Pool
andpg.Client
. Both of those create a callback function before the the instrumentation is invoked, but in our case, the callback is created after instrumentation. The upshot is that no callback is passed to the query function instrumented by beeline, so even though the spans are started, they are never finished.This PR adds a wrapper to promises returned by the query function to fix this issue. It also expands on the tests for the pg instrumentation by asserting that the results returned by the wrapped functions are correct. I've also added a bit to the README file to explain how to run the pg tests.