3.0.0
Summary
- The minimum supported Node.js has been raised to
>=22.15.0. This means that support for Node.js 18 and 20 has been dropped. - The public interface has changed
- for notes on migrating to 3.x / 0.300.x see the upgrade guide
- Only experimental versions
0.300.0are compatible with this release
💥 Breaking Changes
- chore(sdk-trace-node)!: remove the
@opentelemetry/sdk-trace-nodepackage #7054- The sdk-trace-node package has been replaced by the
@opentelemetry/sdk-tracepackage.
See the 3.x migration guide for full migration instructions.
- The sdk-trace-node package has been replaced by the
- chore(shim-opentracing)!: remove the
@opentelemetry/shim-opentracingpackage- In the OpenTelemetry Specification v1.58.0 the OpenTracing compatibility requirements were deprecated. The JavaScript OpenTracing shim package will not receive any more releases after the current 2.11.0 release (source code for last release).
- chore(context-async-hooks)!: remove the unused class
AsyncHooksContextManager#7078 - feat!: migrate package builds from
tsctotsdown, emitting dual CJS/ESM output from a singledist/directory and declaring anexportsmap on every package #6293 @overbalance- Importing a package by its name is unaffected in both CommonJS and ESM, as is every subpath listed in its
exportsmap. - Deep imports into the build output no longer resolve. An
exportsmap is an allowlist that Node.js and bundlers enforce, so specifiers such as@opentelemetry/core/build/src/...or@opentelemetry/core/build/esm/...now fail withERR_PACKAGE_PATH_NOT_EXPORTED. Rewriting them to the new file layout does not help — unlisted subpaths are rejected whether or not the file exists. - The emitted files moved out of
build/src(CJS),build/esmandbuild/esnext(ESM) intodist/, using.cjs/.mjsextensions with matching.d.cts/.d.mtsdeclarations. <package>/package.jsonis no longer importable for the same reason. Read a package's version from your own dependency metadata, or useSDK_INFOfrom@opentelemetry/corefor the SDK version.- The non-standard
esnextentry point has been removed; tools that preferred it fall back tomodule(ESM) ormain(CJS). - Packages that ship separate Node.js and browser implementations export them under explicit subpaths, for example
@opentelemetry/core/platform. If you depend on something that is only reachable through a deep import, please open an issue so it can be considered for the public API.
- Importing a package by its name is unaffected in both CommonJS and ESM, as is every subpath listed in its
- feat(core)!: remove deprecated
getTimeOrigin,otperformance,_globalThis, andunrefTimerfrom@opentelemetry/core#7053getTimeOrigin()— useperformance.timeOrigindirectly.otperformance— use the globalperformanceobject directly._globalThis— useglobalThisdirectly.unrefTimer(timer)— calltimer.unref()directly in your own code.
- feat(sdk-trace)!: remove deprecated
TracerProviderOptions.forceFlushTimeoutMillis#7057- Pass
timeoutMillistoprovider.forceFlush({ timeoutMillis })instead. The default timeout is 30000ms.
- Pass
- feat(propagator-jaeger)!: remove
@opentelemetry/propagator-jaegerpackage #7077- The Jaeger propagator is deprecated by the OpenTelemetry specification in favour of
W3CTraceContextPropagator. UseW3CTraceContextPropagatorfrom@opentelemetry/coreinstead. - See the 3.x migration guide for full instructions.
- The Jaeger propagator is deprecated by the OpenTelemetry specification in favour of
- feat(exporter-jaeger)!: remove
@opentelemetry/exporter-jaegerpackage- The Jaeger exporter has been removed. Jaeger has deprecated its custom Thrift collection protocols in favor of standard OpenTelemetry Protocol (OTLP). Use standard OTLP exporters instead.
- See the 3.x migration guide for full instructions.
- chore!: bump minimum node.js version to >=22.15.0
- chore(sdk-trace-base, sdk-trace-web)!: remove the
@opentelemetry/sdk-trace-baseand@opentelemetry/sdk-trace-webpackages #7117- The sdk-trace-base, sdk-trace-web, and sdk-trace-node packages have been replaced by the
@opentelemetry/sdk-tracepackage.
See the 3.x migration guide for full migration instructions.
- The sdk-trace-base, sdk-trace-web, and sdk-trace-node packages have been replaced by the
- feat!: replace the
browserfield inpackage.jsonwith#platformsubpath imports #7141 @overbalance- Resolvers with the
nodecondition load the Node.js build; all others load the browser build. Bundlers withoutimportssupport fail; see the migration guide. - webpack needs 5.54 or later. Parcel needs package exports enabled and cannot resolve
#platformfromrequire(). - Root type declarations describe the Node.js build.
- Resolvers with the
- feat(resources)!: remove the
./detectors/platformand./detectors/platform/browsersubpath exports; import from the package root #7141 @overbalance - feat(core, sdk-trace, sdk-logs, exporter-zipkin)!: remove the
./platformand./platform/browsersubpath exports; import from the package root #7141 @overbalance - fix(sdk-logs)!: replace
LoggerConfig.disabledwithenabledto match the specification #7160- Replace
disabled: truewithenabled: false, anddisabled: falsewithenabled: true. Loggers remain enabled by default.
- Replace
🚀 Features
- feat(sdk-metrics): stabilize
maxExportBatchSizeoption inPeriodicExportingMetricReader - chore(sdk-logs): mark
@opentelemetry/sdk-logsas stable #7143 @trentm - feat(sdk-trace, sdk-logs): add the browser-only
disableAutoFlushOnDocumentHidetoBatchSpanProcessorOptionsandBatchLogRecordProcessorOptions, deprecateBatchSpanProcessorBrowserOptionsandBatchLogRecordProcessorBrowserOptions#7140 @overbalance
🐛 Bug Fixes
- fix(sdk-metrics): guard against a missing or empty name to MeterProvider#getMeter #7105 @trentm
- fix: resolve the ESM build through the
defaultexport condition instead ofimport, so a resolver that activates neitherimportnorrequirestill finds an entry point #7132 @overbalance - fix(sdk-trace): make the Node.js
RandomIdGeneratorid generators prototype methods, so subclasses can override them #7190 @overbalance - fix(sdk-logs): report a rejected document-hide flush to the global error handler #7187 @overbalance
- fix(sdk-trace): count attributes passed to
startSpantowardattributeCountLimit#7176 @overbalance - fix(resources): stop reading
globalThis.processin the browser build #7173 @overbalance - fix(core): return
falseinstead ofundefinedfrom the browsergetBooleanFromEnv#7188 @overbalance - fix(core): no longer drop an attribute value that is an object that has
undefinedproperties #7207 @trentmisAnyValue()now returns true for{aStr: 'bob', anUndefined: undefined}. This restores the behavior of the oldisLogAttributeValuefrom version 2.x of thesdk-logspackage.- "Cleaning" of attributes, by
cleanAttributes()andmaybeAddAttribute(), will now drop undefined properties from objects. For example,logger.emit(attributes: {myAttr: {aStr: 'bob', anUndefined: undefined}, ...)will includeattributes: {myAttr: {aStr: 'bob'}}.
📚 Documentation
- chore(examples): drop examples/{otlp-exporter-node,grpc-js} #7096
🏠 Internal
- chore: remove
@opentelemetry/sdk-trace-webpackage from examples and bundler tests #7095 - chore(sdk-trace): add
StackContextManagerin@opentelemetry/sdk-tracepackage #7086 - feat(ci): support releasing from maintenance branches #6767 @pichlermarc
- The API documentation site is only redeployed for releases whose commit is reachable from
main, so a maintenance release no longer overwrites it.
- The API documentation site is only redeployed for releases whose commit is reachable from
- chore: don't close stale issues #x @maryliag
- chore: mark the workspace root package as private #7097 @overbalance
- chore: declare the Node.js and npm version floors that the tsdown build requires via
devEngines#7093 @overbalance- The migration to tsdown raised the toolchain a contributor needs to build this repo, but nothing declared it. Contributors now build on Node.js
^24.11.1 || >=26.0.0with npm>=11.10.0; both are advisory and warn rather than fail. The published packages are unaffected and still support Node.js>=22.15.0, which the test matrix continues to cover.
- The migration to tsdown raised the toolchain a contributor needs to build this repo, but nothing declared it. Contributors now build on Node.js
- test(bundler-tests): typecheck packages under legacy module resolution #7127 @overbalance
- chore: remove the redundant
modulefield frompackage.json; bundlers resolve the ESM build through theexportsmap #7130 @overbalance - test(bundler-tests): bundle the platform packages for iOS and Android with Metro and Expo, and load them under Jest's jsdom environment #7131 @overbalance
- fix(verify-pack): read the npm 12
pack --jsonoutput, which is keyed by package name instead of an array #7133 @overbalance - fix(karma): resolve plugins and the
processshim from the repo root, so browser tests run with isolated installs #7137 @overbalance - fix(nx): key the
versiontarget defaults by the target name, so a cache hit restores the generatedsrc/version.ts#7134 @overbalance - fix(nx): make the
test,test:browserandtest:webworkertargets compile their dependencies first, since tests load dependencies from theirdist#7139 @overbalance - fix(verify-pack): extract tarballs under the root
node_modules, so workspace dependencies resolve and entry points load fully instead of being skipped #7138 @overbalance - build: lint published packages for unused dependencies with knip, as part of
npm run lint#7200 @overbalance - chore(exporter-zipkin): move
@opentelemetry/resourcestodevDependencies, since only tests use it #7200 @overbalance - build: fail the tsdown build when its output includes a module from outside the package #7195 @overbalance
- refactor(sdk-trace): remove the
pagehidelistener from the browserBatchSpanProcessor, it was registered ondocumentand never ran, andvisibilitychangealready flushes on unload #7153 @adityareddy-dev - refactor(sdk-logs): remove the
pagehidelistener from the browserBatchLogRecordProcessor, it was registered ondocumentand never ran, andvisibilitychangealready flushes on unload #7153 @adityareddy-dev - refactor(sdk-trace, sdk-logs, sdk-metrics): type timers with
ReturnType<typeof setTimeout>instead ofNodeJS.Timeout#7174 @overbalance