-
Notifications
You must be signed in to change notification settings - Fork 317
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
add support for node specifiers #3893
add support for node specifiers #3893
Conversation
Overall package sizeSelf size: 5.82 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #3893 +/- ##
==========================================
- Coverage 84.58% 84.54% -0.05%
==========================================
Files 235 235
Lines 9957 9962 +5
Branches 33 33
==========================================
Hits 8422 8422
- Misses 1535 1540 +5 ☔ View full report in Codecov by Sentry. |
51556d1
to
c89dd5c
Compare
BenchmarksBenchmark execution time: 2023-12-27 19:50:55 Comparing candidate commit 0b029fd in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 524 metrics, 8 unstable metrics. |
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.
Some minor nits but otherwise LGTM.
name.forEach(val => { | ||
if (!instrumentations[val]) { | ||
instrumentations[val] = [] | ||
} | ||
|
||
instrumentations[val].push({ name: val, versions, file, hook }) | ||
}) |
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.
I would generally recommend for-of over forEach.
name.forEach(val => { | |
if (!instrumentations[val]) { | |
instrumentations[val] = [] | |
} | |
instrumentations[val].push({ name: val, versions, file, hook }) | |
}) | |
for (const val of name) { | |
if (!instrumentations[val]) { | |
instrumentations[val] = [] | |
} | |
instrumentations[val].push({ name: val, versions, file, hook }) | |
} |
if (name === 'net') { | ||
require('dns') | ||
} else { | ||
require('node:dns') | ||
} |
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.
Why are we loading the dns module here again? Maybe we could use a comment to remember?
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.
I believe it's because otherwise net gets an uninstrumented instance & thus we miss the dns calls
88fe31f
to
0b029fd
Compare
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
* add support for node specifiers
What does this PR do?
adds support for fastify versions >= 4.23.0 by adding support for node:* specifiers. Also updates addHook and register functionality to make sure that double patching doesn't occur when instrumenting node:* specifiers. For example instrumenting both dns and node:dns causes double patching
Motivation
fastify instrumentation breaking on versions >= 4.23.0
Notes
this PR is a continuation of this #3676