Describe the bug
When upgrading dd-trace to v0.16.2 logs do not contain dd (https://github.com/DataDog/dd-trace-js/blob/v0.16.2/packages/dd-trace/src/plugins/util/log.js#L13-L16) block any more.
The issue seems to be in Instrumenter.enable method https://github.com/DataDog/dd-trace-js/blob/v0.16.2/packages/dd-trace/src/instrumenter.js#L39-L52 Namely, plugins do not get auto-instrumented, because this._enabled is set to true after setting and loading the plugins and not before. load method simply returns if this._enabled is false: https://github.com/DataDog/dd-trace-js/blob/v0.16.2/packages/dd-trace/src/instrumenter.js#L98 Moving this._enabled = true to the begging of enable method fixes log injection issue, but might introduce others.
Environment
DD_LOGS_INJECTION=true
DD_TRACE_ANALYTICS_ENABLED=true
DD_RUNTIME_METRICS_ENABLED=true
- Operation system:
Alpine Linux 3.9.4
- Node version:
v10.17.0
- Tracer version:
v0.16.2
- Agent version:
v6.15.1
Describe the bug
When upgrading dd-trace to v0.16.2 logs do not contain dd (https://github.com/DataDog/dd-trace-js/blob/v0.16.2/packages/dd-trace/src/plugins/util/log.js#L13-L16) block any more.
The issue seems to be in
Instrumenter.enablemethod https://github.com/DataDog/dd-trace-js/blob/v0.16.2/packages/dd-trace/src/instrumenter.js#L39-L52 Namely, plugins do not get auto-instrumented, becausethis._enabledis set totrueafter setting and loading the plugins and not before.loadmethod simply returns ifthis._enabledis false: https://github.com/DataDog/dd-trace-js/blob/v0.16.2/packages/dd-trace/src/instrumenter.js#L98 Movingthis._enabled = trueto the begging ofenablemethod fixes log injection issue, but might introduce others.Environment
DD_LOGS_INJECTION=true
DD_TRACE_ANALYTICS_ENABLED=true
DD_RUNTIME_METRICS_ENABLED=true
Alpine Linux 3.9.4
v10.17.0
v0.16.2
v6.15.1