-
Notifications
You must be signed in to change notification settings - Fork 306
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
dd-trace >= 4.7.0 crashes with TypeError: Cannot read properties of undefined (reading 'span') #3451
Comments
@AaronMoat Looking at the code, the only way I can see for this to happen is that a request is started before the instrumentation is applied. This should not be possible if the tracer is initialized before anything else happens in the process, but it can happen otherwise. I'll work on a fix since even when that's the case the tracer shouldn't throw, but then I would still expect traces to not be reported properly even after the fix has been released since the tracer relies on being initialized first. Can you make sure that dd-trace initialization is the very first thing that happens in your app, before any other code or any other imports? An easy way to make sure of this is to initialize directly from the CLI with |
Thanks @rochdev -- I believe that's all set up correctly, we can't import dd-trace/init due to providing some configuration not configurable via logger, however the code to setup is the first import. |
Hi @rochdev, I'm still getting this crash in 4.11.
|
I'm also seeing this issue with 4.11.0. I upgraded from 3.20.0, and never saw this error with that version. Related: #2915 We see this issue for 4.11.x with both Node 16 and 20. |
Expected behaviour
Expected no change to functionality in minor upgrade
Actual behaviour
My app fails on startup with this error:
Steps to reproduce
Unsure on exact reproduction steps as some internal services appear to be unaffected. In particular the same service with additional opentelemetry (from some surrounding containers) disabled functions fine.
Environment
datadog/agent:7
The text was updated successfully, but these errors were encountered: