-
Notifications
You must be signed in to change notification settings - Fork 538
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-fs): fix instrumentation of fs/promises
#1375
Conversation
This reverts commit 90d9f0d.
I just merged #1332 and it seems to create conflicts in this PR, sorry about that |
spans | ||
) => { | ||
const rootSpanName = `${name} test span`; | ||
it(`promises.${name} ${error ? 'error' : 'success'}`, async () => { |
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.
Maybe I'm missing something, but isn't this test already exist in the file 'fs.test.ts' ?
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.
This is testing fs/promises
, whereas fs.test.ts
is testing fs.promises
.
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.
Looks like this is just applying the existing patch from fs.promises
and adding tests. Looks good to me
init(): ( | ||
| InstrumentationNodeModuleDefinition<FS> | ||
| InstrumentationNodeModuleDefinition<FSPromises> | ||
)[] { |
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: i think this type is more explicit
init(): ( | |
| InstrumentationNodeModuleDefinition<FS> | |
| InstrumentationNodeModuleDefinition<FSPromises> | |
)[] { | |
init(): [InstrumentationNodeModuleDefinition<FS>, InstrumentationNodeModuleDefinition<FSPromises>] { |
const supportsPromises = | ||
parseInt(process.versions.node.split('.')[0], 10) >= 14; |
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.
The repo supports node >= 14 anyway, so I guess this is not needed?
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.
Resolved by #1413
Sorry, I merged this PR but now I see there is still a comment about it: #1375 (comment). If you want to address this comment, I suggest to do it on another PR. |
@haddasbronfman #1375 (comment) will be addressed in #1413. |
Which problem is this PR solving?
This PR fixes
@opentelemetry/instrumentation-fs
when used withfs/promises
.Short description of the changes
This PR adds logic to
@opentelemetry/instrumentation-fs
that instrumentsfs/promises
. This will properly instrumentfs
methods when they come fromfs/promises
; currently, that instrumentation is not happening.