-
Notifications
You must be signed in to change notification settings - Fork 540
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
High startup memory when using @opentelemetry/instrumentation-fs #1344
Comments
Can we have a little more info here? How many fs spans are being created and do you have an estimate of how many files are read at startup of your application? Does the memory use drop to normal after the startup or does it stay high? The FS instrumentation may be able to be optimized a bit more to reduce memory use. |
I assume that require calls will also result in spans because fs is used internally and there is no parent span required (Refs: #1335 which adds this). I guess you could use the |
Experiencing the same. Over 1000 spans are created when the application is bootstrapped caused by fs-instrumentation. The memory usage is over 100% for ~11 seconds. If I set |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
I think we should strongly consider disabling the Just had a customer run into a befuddling issue:
And the reason was because The spans themselves are generally of low value -- it serves little purpose to know that node opened N files at startup. I'm happy to contribute a PR if folks think this is a good idea. |
I fully agree. For traces more isn't better. I assume it's useful at application runtime but not to trace the startup. Some other options I have in mind:
|
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stale for 14 days with no activity. |
What version of OpenTelemetry are you using?
What version of Node are you using?
18
What did you do?
I'm using opentelemetry with the auto instrumentation package. After updating opentelemetry packages to latest version, i realized that the memory usage of my container during application startup went from ~200MiB to ~600MiB. After disabling
@opentelemetry/instrumentation-fs
, the memory usage went back to normal.What did you expect to see?
No change in memory usage.
What did you see instead?
Memory usage went up by ~400MiB during starup.
Additional context
After realizing the problem, I traced it back to the version update of
@opentelemetry/auto-instrumentations-node
from0.33.x
to0.34.x
, to this commit: https://github.com/open-telemetry/opentelemetry-js-contrib/pull/981/files . From there i realized the@opentelemetry/instrumentation-fs
instrumentation that was added is causing the high memory usage. I tried disabling it with:This solved the memory issue.
The high memory usage appeared both when running the container in wsl, and on AWS ECS (fargate).
The text was updated successfully, but these errors were encountered: