-
Notifications
You must be signed in to change notification settings - Fork 615
fix(pg): fix instrumentation of ESM-imported pg-pool #2807
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
Conversation
…trib into fix-pg-pool
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2807 +/- ##
=======================================
Coverage 89.66% 89.67%
=======================================
Files 184 184
Lines 8943 8946 +3
Branches 1834 1834
=======================================
+ Hits 8019 8022 +3
Misses 924 924
🚀 New features to boost your workflow:
|
|
Thanks for fixing this 🙂 opentelemetry-js-contrib/plugins/node/opentelemetry-instrumentation-pg/test/pg.test.ts Lines 1098 to 1125 in d9e757f
Doing so would also check the box in #1942 |
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.
Thanks!
If you are super-bored sometime ;) a test for this (similar to the runTestFixture usage in test/pg.test.ts) would be great. Then we could check off instrumentation-pg in #1942 (comment)
|
Oh, duh, Marc said the exact same thing already. |
|
Yes, I will be adding the test shortly :D |
…trib into fix-pg-pool
plugins/node/opentelemetry-instrumentation-pg/test/fixtures/use-pg-pool.mjs
Fixed
Show fixed
Hide fixed
plugins/node/opentelemetry-instrumentation-pg/test/fixtures/use-pg-pool.mjs
Fixed
Show fixed
Hide fixed
… testing of instrumentation-pg This also fixes a couple missing 'pool.end()' calls in pg-pool.test.ts that would result in a 10s hang at the end of testing.
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.
thank you for fixing this 🙂
plugins/node/opentelemetry-instrumentation-pg/test/fixtures/use-pg-pool.mjs
Outdated
Show resolved
Hide resolved
…e-pg-pool.mjs Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
The ESM imported top-level object is a Module Namespace Object per ECMA262 spec that is, apparently, incompatible with the 'PG' class object that 'pg' returns. The ".defaults" holds the equivalent of require('pg').
Fixes: #2759