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
fix(esbuild,webpack): bundle the OpenTelemetry API fallback when the app has no copy
The plugins marked @opentelemetry/api and @opentelemetry/api-logs external
unconditionally, so a bundle that used the OpenTelemetry bridge but was deployed
without the packages in node_modules threw at runtime on the fallback require.
Externalizing is only needed when the application owns a copy the instrumentation
must capture and share; a package the application does not declare has no
competing copy to protect.
Externalize a package only when the application's package.json declares it, and
otherwise leave it in the bundle so dd-trace's own copy is inlined and the bundle
stays self-contained. When the manifest cannot be read, keep externalizing so the
shared-copy correctness is never traded for the self-contained-bundle
optimization.
Fixes: #6882
Copy file name to clipboardExpand all lines: docs/API.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -398,6 +398,8 @@ const tracerProvider = new tracer.TracerProvider()
398
398
tracerProvider.register()
399
399
```
400
400
401
+
dd-trace binds to the application's own `@opentelemetry/api` copy when it is present and falls back to the copy it bundles otherwise. If you require `@opentelemetry/api` yourself, require it before creating the `TracerProvider` so the bridge registers on the same copy your code reads. The `dd-trace/esbuild` and `dd-trace/webpack` plugins mark a package external only when your application depends on it, so its single runtime copy is shared with the bridge; keep those resolvable at runtime. A package your application does not depend on is bundled from dd-trace's own copy, so no extra runtime dependency is needed.
402
+
401
403
The following attributes are available to override Datadog-specific options:
402
404
403
405
*`service.name`: The service name to be used for this span. The service name from the tracer will be used if this is not provided.
0 commit comments