You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It follows that it looks like instrumentation happens at import/require time. But this contradicts your documentation, which says that instrumentation happens at .init() time. Right? Or is it “auto-initialized” because of something I do? Or am I missing something?
Also, regarding “what makes you say that instrumentation happens?” : I believe instrumentation happens because dd-trace causes a crashes in the app test suite (where of course dd-trace shouldn't run, because process.env.NODE_ENV !== 'production') since this change of dd-trace 5.33.0 in packages/datadog-instrumentations/src/aws-sdk.js, where name = name.replaceAll(' ', '') legit crashes on name being undefined (“legit” because dd-trace shouldn't be running when running tests!).
To reformulate, this change made me realize that dd-trace instrumentation was unexpectedly happening when running the tests, and here I am trying to understand why.
Thanks for the halp 🙂.
Error Logs
No response
Tracer Config
No response
Operating System
Debian 6.12.12-1 x86_64
Bundling
No Bundling
The text was updated successfully, but these errors were encountered:
Tracer Version(s)
5.33.0, 5.35.0
Node.js Version(s)
22.13.1
Bug Report
Documentation says that there are 2 options to Import and initialize the tracer:
const tracer = require('dd-trace').init();
node --require dd-trace/init app.js
However, I observe that dd-trace instrumentation is initialized even when I do not call
.init()
. Is this expected? Am I doing something wrong?Reproduction Code
With this first listing, I observe that dd-trace instrumentation unexpectedly happens even when DD_TRACE_ENABLED is unset:
However, with this second listing below, I observe that dd-trace instrumentation satisfyingly does not happen when DD_TRACE_ENABLED is unset:
It follows that it looks like instrumentation happens at import/require time. But this contradicts your documentation, which says that instrumentation happens at
.init()
time. Right? Or is it “auto-initialized” because of something I do? Or am I missing something?Also, regarding “what makes you say that instrumentation happens?” : I believe instrumentation happens because dd-trace causes a crashes in the app test suite (where of course dd-trace shouldn't run, because
process.env.NODE_ENV
!=='production'
) since this change of dd-trace 5.33.0 inpackages/datadog-instrumentations/src/aws-sdk.js
, wherename = name.replaceAll(' ', '')
legit crashes onname
beingundefined
(“legit” because dd-trace shouldn't be running when running tests!).To reformulate, this change made me realize that dd-trace instrumentation was unexpectedly happening when running the tests, and here I am trying to understand why.
Thanks for the halp 🙂.
Error Logs
No response
Tracer Config
No response
Operating System
Debian 6.12.12-1 x86_64
Bundling
No Bundling
The text was updated successfully, but these errors were encountered: