-
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
NodeSDK should register instrumentations earlier #3146
Comments
I'm actually going to reclassify this as a bug since it definitely can cause problems. The node sdk package is something that was done experimentally a long time ago but now has gained quite some users and should be brought to the level of quality they expect |
As an alternative, can I suggest that instrumentation be a pre-runtime step? Having all the instrumentations patched into node_modules where possible would really help with reliability- especially where bundlers are used. |
@AWare What do you mean in detail with pre-runtime step? |
Thanks @Flarna I haven't had time to work on this so I appreciate that you handled it |
Is your feature request related to a problem? Please describe.
Instrumentations need to be registered before the corresponding module to instrument is loaded. Currently
NodeSDK
callsregisterInstrumentations()
as last step instart()
(see here). This might lead to missing some modules to instrument es e.g. resource detection does already HTTP requests before.Describe the solution you'd like
We should move
registerInstrumentations()
call to the beginning of start or even into constructor. Or maybe even remove this functionality from SDK and require user to do it before require the SDK.Describe alternatives you've considered
Additional context
refs.: open-telemetry/opentelemetry-js-contrib#1109 (comment)
The text was updated successfully, but these errors were encountered: