0.300.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 stable versions
3.0.0are compatible with this release
💥 Breaking Changes
- chore(shim-opencensus)!: remove the
@opentelemetry/shim-opencensuspackage- In the OpenTelemetry Specification v1.58.0 the OpenCensus compatibility requirements were deprecated. The JavaScript OpenCensus shim package will not receive any more releases after the current 0.222.0 release (source code for last release).
- feat(instrumentation-http)!: remove deprecated
serverNamefield fromHttpInstrumentationConfig#7081- The
serverNameoption had no effect; stable HTTP semantic conventions do not includehttp.server_name. Remove it from anysetConfig()or constructor call.
- The
- feat(sdk-node)!: remove deprecated
NodeSDKConfigurationfieldslogRecordProcessor,metricReader,spanProcessorand deprecated namespace re-exportsnode,tracingNodeSDKConfiguration.logRecordProcessor— uselogRecordProcessorsinstead.NodeSDKConfiguration.metricReader— usemetricReadersinstead.NodeSDKConfiguration.spanProcessor— usespanProcessorsinstead.export * as node from '@opentelemetry/sdk-node'— import directly from@opentelemetry/sdk-trace-nodeinstead.export * as tracing from '@opentelemetry/sdk-node'— import directly from@opentelemetry/sdk-trace-baseinstead.
- feat(sdk-logs)!: remove deprecated
SdkLogRecordtype alias andLoggerProviderConfigtype alias #7062SdkLogRecord— useReadWriteLogRecordinstead.LoggerProviderConfig— useLoggerProviderOptionsinstead.
- 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/sdk-logs/build/src/...or@opentelemetry/sdk-logs/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/sdk-logs/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(sdk-node)!: remove
"jaeger"propagator from@opentelemetry/sdk-node#7077OTEL_PROPAGATORS=jaegerand{ jaeger: null }in the configuration object are no longer recognised. Replace with"tracecontext".- See the 3.x migration guide for full instructions.
- fix(opentelemetry-exporter-prometheus)!: default exporter host to localhost #6599 @cjihrig
- chore!: bump minimum node.js version to >=22.15.0
- feat(api-logs)!: move the Logs API to
@opentelemetry/apiand remove the standalone@opentelemetry/api-logspackage #4862 @hectorhdzg - fix(exporter-prometheus)!: stop reading Prometheus exporter host and port environment variables in the exporter constructor #6966 @LarryHu0217
- chore(web-common)!: clean up and deprecate network span utils #7114
- These utilities were long planned for removal. They were moved from the
sdk-trace-webpackage and are currently only used by the (deprecated)instrumentation-fetchandinstrumentation-xml-http-requestpackages. - Drop the
skipOldSemconvContentLengthAttrsvestigial option fromaddSpanNetworkEvents().
- These utilities were long planned for removal. They were moved from the
- feat(sdk-node)!: drop SDK package re-exports (
api,contextBase,core,logs,metrics,resources) #7111 @pichlermarcapi/contextBase→ import from@opentelemetry/apicore→ import from@opentelemetry/corelogs→ import from@opentelemetry/sdk-logsmetrics→ import from@opentelemetry/sdk-metricsresources→ import from@opentelemetry/resources
- feat(sdk-logs): mark
@opentelemetry/sdk-logsas stable #7143 @trentm- See the stable CHANGELOG for future changes to the sdk-logs package.
- 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(instrumentation, exporter--otlp-http, exporter--otlp-proto)!: remove the
./platformand./platform/browsersubpath exports; import from the package root #7141 @overbalance - feat(otlp-exporter-base)!: move
OTLPExporterNodeConfigBaseto@opentelemetry/otlp-exporter-base/node-http#7172 @overbalancetypesVersionsmaps the subpaths formoduleResolution: node.
🚀 Features
- refactor!(api-logs): remove AnyValue-related types in favor of new types in the
apipackage #6780 @trentm- The
AnyValue,LogBody, andLogAttributestypes are no longer exported by theapi-logspackage.
Instead, use theAnyValueandAttributestypes from the latest@opentelemetry/apipackage. - This is part of supporting OTEP 4485.
- The
- feat(instrumentation): add
isEnabled()to the browserInstrumentationBase; fetch and XHR report false when patching throws #7140 @overbalance - feat(instrumentation)!: make
InstrumentationBase#_enabledprotected on both platforms #7202 @overbalance- The browser base no longer tracks
enable()anddisable()calls. Browser subclasses set_enabledthemselves; one that never sets it reportsisEnabled()as false. - A browser subclass that declares its own
private _enabledfails to compile; rename it or declare itprotected.
- The browser base no longer tracks
🐛 Bug Fixes
- fix(otlp-exporter-base): suppress tracing around the browser fetch transport's own request so a
fetchinstrumentation cannot create an export → span → export loop #6948 @YangJonghun - fix(instrumentation-http): set
error.typeon spans whose status code makes them an error #7061 @mwear - fix(exporter-prometheus): prevent duplicate metric metadata and keep metric families grouped across instrumentation scopes in Prometheus scrapes #7047 @freben
- fix(configuration): preserve zero-valued limits from environment variables #7060 @DenisCDev
- fix(otlp-exporter-base): release the keepalive budget once the response body drains, instead of holding up the export until it does #7070 @overbalance
- fix(web-common): export getElementXPath utility
- This was accidentally missed when moving utilities from sdk-trace-web to web-common.
- fix(opentelemetry-browser-detector): mark the package side-effect free so bundlers can tree-shake it #7135 @overbalance
- fix: resolve the ESM build through the
defaultexport condition instead ofimport, so a resolver that activates neitherimportnorrequirestill finds an entry point #7132 @overbalance - fix(instrumentation-fetch): define
PropagateTraceHeaderCorsUrlslocally, so the types no longer import@opentelemetry/web-common#7193 @overbalance - fix(web-common): declare
@opentelemetry/sdk-traceand@opentelemetry/sdk-logsas dependencies #7193 @overbalance - fix(instrumentation-fetch, instrumentation-xml-http-request): stay disabled when
fetchorXMLHttpRequestopen/sendis missing, so a laterenable()retries #7171 @overbalance - fix(instrumentation): move
InstrumentationNodeModuleFilebehind#platform, so the root types no longer import Node.jspath#7177 @overbalance - fix(otlp-transformer): accept DOM
TextDecoderinProtobufReadertyping #7169 @overbalance
🏠 Internal
- refactor(web-common, instrumentation-fetch, instrumentation-xml-http-request): move utils from
@opentelemetry/sdk-trace-web
into@opentelemetry/web-commonand use them in@opentelemetry/instrumentation-fetchand@opentelemetry/instrumentation-xml-http-request.
With this change the instrumentations do not depend on SDK packages and the utils are kept in a shared package so we avoid code duplication. - chore(instrumentation-fetch, instrumentation-xml-http-request): Soft-deprecate
@opentelemetry/instrumentation-fetchand@opentelemetry/instrumentation-xml-http-request#7109 @trentm- Browser instrumentations in this repository are being (soft-)deprecated in favor of the new (and significantly different)
@opentelemetry/browser-instrumentationinstrumentations. "Soft" deprecation means exports have been marked with@deprecatedand a notice added to READMEs, but the packages will not yet benpm deprecate'd to avoid loud notice to users while opentelemetry-browser.git is still in heavy development.
- Browser instrumentations in this repository are being (soft-)deprecated in favor of the new (and significantly different)
- chore: remove the redundant
modulefield frompackage.json; bundlers resolve the ESM build through theexportsmap #7130 @overbalance - chore(exporter-metrics-otlp-http): remove the unused
@opentelemetry/resourcesdependency #7200 @overbalance - chore(web-common): remove the unused
@opentelemetry/semantic-conventionsdependency #7196 @overbalance - refactor(otlp-transformer): encode base64 through
#platform, so the browser build no longer referencesBuffer#7173 @overbalance - refactor(exporter-metrics-otlp-proto): type the browser
OTLPMetricExporterconfig asOTLPExporterConfigBase#7172 @overbalance