-
Notifications
You must be signed in to change notification settings - Fork 534
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
fix(instrumentation-pg): ensure db.client.operation.duration metric is recorded for Promises API usage of pg #2480
fix(instrumentation-pg): ensure db.client.operation.duration metric is recorded for Promises API usage of pg #2480
Conversation
…s recorded for Promises API usage of pg Refs: open-telemetry#2380
@@ -277,6 +277,7 @@ describe('pg-pool', () => { | |||
await client.query('SELECT NOW()'); | |||
} finally { | |||
client.release(); | |||
await newPool.end(); |
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.
reviewer note: This is an unrelated change. It fixes a few-second hang in the test file completing (presumably on a pool connection timeout).
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2480 +/- ##
==========================================
- Coverage 90.86% 90.85% -0.02%
==========================================
Files 159 159
Lines 7849 7851 +2
Branches 1621 1621
==========================================
+ Hits 7132 7133 +1
- Misses 717 718 +1
|
The codecov issue is that the |
const metrics = resourceMetrics.scopeMetrics[0].metrics; | ||
assert.strictEqual( | ||
metrics[0].descriptor.name, | ||
'db.client.operation.duration' |
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.
nit: can you use the variable here?
I made a similar update on https://github.com/open-telemetry/opentelemetry-js-contrib/pull/2475/files#diff-682483846290c7e14fba934e5f5effaaa2ff8e84e94f511300af6d0120a59251R53
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.
done in commit 2120edf
That was an awesome catch! Thanks for finding and fixing it! |
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.
a little nit, otherwise LGTM
Refs: #2380
While working on pg tests in #2464 I accidentally noticed that the duration metric added to instr-pg in #2380 didn't work if the Promises API of the pg client was used.