-
Notifications
You must be signed in to change notification settings - Fork 530
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
@opentelemetry/instrumentation-fs` fails to wrap fs promises #1305
Comments
Which ohter modules have you loaded in your app? In special that ones loaded before the instrumentation would be insteresting. Or can you even share a stripped down reproducer? |
I'm experiencing what appears to be the same error in a NestJS environment. Likewise, I'm trying to use auto-instrumentations in node:
For context, the codebase I'm attempting to add instrumentation to is not one I'm very familiar with. I had previously, successfully, attempted this same thing in another nestjs codebase (of similar size and complexity and with some code in common) recently and did not experience this issue. I attempted to reproduce the issue in a new nest app but have been unsuccessful as of yet. (Note: bring your own open-telemetry collector, etc.) |
using node 18.12.0 i see the issue with |
Nice one @modosc - that resolved it for me as well! |
Created open-telemetry/opentelemetry-js#3448 which includes a simple reproducer and some hints where the problem is located. |
This is still broken in
|
I reproduced the issue in this repository |
This should have been resolved by open-telemetry/opentelemetry-js#3451. If you upgrade to Proper instrumentation of |
Thanks |
What version of OpenTelemetry are you using?
What version of Node are you using?
18.12.1
What did you do?
I installed Opentelemetry and use the auto-instrumentation meta package via
node-sdk
to instrument my node backend application but when starting up the application thrown a runtime errorWhat did you expect to see?
Successfully running my backend application without throwing errors
What did you see instead?
Looks like the
fs.promises
is undefined in my case which causes the wrapping step to fail. I am not sure whyfs.promises
is undefined. Maybe thesupportsPromises
needs to be adapted so it also checks whetherfs.promises
is defined?E.g.
const supportsPromises = parseInt(process.versions.node.split('.')[0], 10) > 8 && fs.promises
I can't really think of a reason why
fs.promises
could be undefined. Could a library maybe override it? If so, what would be a good way to detect that in Node?Additional context
I am running Express
The text was updated successfully, but these errors were encountered: