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

[aws-xray-sdk-mysql] Handle operations that return a promise instead of an event emitter (mysql2) #328

Merged
merged 1 commit into from
Sep 8, 2020

Conversation

TuckerWhitehouse
Copy link
Contributor

Issue #, if available:
https://github.com/aws/aws-xray-sdk-node/issues?q=mysql2

Description of changes:
The mysql2 package returns a promise instead of a wrapped object with an event emitter. Fortunately, the two events this package relies on (end, error) can be mapped to the promise being resolved or rejected.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@willarmiros willarmiros left a comment

Choose a reason for hiding this comment

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

Awesome improvement @TuckerWhitehouse! I know that workarounds existed to support mysql2 with our existing mysql patcher, but after this change are there any further changes you think are required for complete support?

@willarmiros willarmiros merged commit a8e29ef into aws:master Sep 8, 2020
@TuckerWhitehouse
Copy link
Contributor Author

Hey @willarmiros - thanks! I've branch deployed with this code a couple of times just to validate things and can confirm I'm seeing xray traces for sql queries as expected. The code I'm testing with only uses .query, but I think this change would work for .execute all the same :)

Do you know how often new releases are cut or when a release with this change would be available?

@willarmiros
Copy link
Contributor

Awesome to hear! We can't give exact dates for releases but I will prioritize making a release with this feature in the near future.

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.

2 participants