-
Notifications
You must be signed in to change notification settings - Fork 821
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-fetch] Memory leak in NextJS app #4496
Comments
@cpatti97100 |
It would be extremely useful if you could identify the objects that are being retained and causing the out of memory. Along with maybe a small repo so that anyone can reproduce this without constructing their own version of the test. |
it does, but here #4063 I read "The motivation for this change is so I can instrument my NodeJS applications using fetch() with the @opentelemetry/instrumentation-fetch package.". Also here #3413 (comment) Node compatibility is mentioned. I guess I misunderstood something here or something is confusing :) |
Yes, sorry for the confusion - any support added was purely experimental. There are differences in Node's fetch and the web version. We plan on adding an In the meantime we'll change this instrumentation to be a no-op for Node.js to avoid any issues further issues like this. That being said, it'd still be helpful to have a reproducer as MSNev said. It could be that this is not only affecting Node.js but also the browser instrumentation. |
sorry I am super busy right now :( but what I will do is to try out the implementation for undici which is under development and report if the same behavior still happens |
@cpatti97100 we've published the undici instrumentation recently. Would you be able to test that one out? 🙂 |
@cpatti97100 did you try the new undici instrumentation out yet? We're looking into using it for the Sentry Node.js SDK, and implicitly the Sentry Next.js SDK. |
@cpatti97100 any updates? |
Hello everyone, we should deploy our app in prod soon with instrumentation-undici. I will let you know how things will go 🤞🏼 |
@cpatti97100 any updates on this? 🙂 |
@cpatti97100 closing this issue, if you still run into trouble with the new unidici instrumentation, please open a new issue over at https://github.com/open-telemetry/opentelemetry-js-contrib |
hi all, just to let yo know that we had @opentelemetry/[email protected] live in prod for over a week and it's working correctly |
What happened?
Steps to Reproduce
NodeJS 18 (but also 20)
NextJS 13
Stress test by having Node perform a significant number of outgoing requests using
fetch
Expected Result
App memory usage remains almost constant in time, like it was before introducing
@opentelemetry/instrumentation-fetch
Actual Result
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
this started to happen after introducing
@opentelemetry/instrumentation-fetch
Additional Details
Related work:
#4063
#3413
#4333
#4393
Now that I think of it, can these 3 packages be active together?
OpenTelemetry Setup Code
instrumentation.node.js
package.json
Relevant log output
No response
The text was updated successfully, but these errors were encountered: