Packages

@opentelemetry/exporter-prometheus

0.301.2 · 12 Nov 2026Apache-2.029.5M / weekRepositoryHomepagenpmAtom feed

Your version

0.300.0

20 Oct 2026Where it was published

0.301.2 is the newest release of 0.300.x.

In short

12 breaking1 removed2 fixed1 internal

  • Breaking

    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.

  • Breaking

    Only stable versions 3.0.0 are compatible with this release

  • Breaking

    feat!: migrate package builds from tsc to tsdown, emitting dual CJS/ESM output from a single dist/ directory and declaring an exports map on every package

  • Breaking

    Deep imports into the build output no longer resolve. An exports map 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 with ERR_PACKAGE_PATH_NOT_EXPORTED. Rewriting them to the new file layout does not help — unlisted subpaths are rejected whether or not the file exists.

  • Breaking

    The emitted files moved out of build/src (CJS), build/esm and build/esnext (ESM) into dist/, using .cjs/.mjs extensions with matching .d.cts/.d.mts declarations.

    To check
  • Breaking

    <package>/package.json is no longer importable for the same reason. Read a package's version from your own dependency metadata, or use SDK_INFO from @opentelemetry/core for the SDK version.

  • Breaking

    chore!: bump minimum node.js version to >=22.15.0

  • Breaking

    fix(exporter-prometheus)!: stop reading Prometheus exporter host and port environment variables in the exporter constructor

Release note

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

  • Only stable versions 3.0.0 are compatible with this release

:boom: Breaking Changes

  • Breaking

    shim-opencensus: Remove the @opentelemetry/shim-opencensus package

  • Breaking

    instrumentation-http: Remove deprecated serverName field from HttpInstrumentationConfig #7081

    • The serverName option had no effect; stable HTTP semantic conventions do not include http.server_name. Remove it from any setConfig() or constructor call.

  • Breaking

    sdk-node: Remove deprecated NodeSDKConfiguration fields logRecordProcessor, metricReader, spanProcessor and deprecated namespace re-exports node, tracing

    • NodeSDKConfiguration.logRecordProcessor — use logRecordProcessors instead.

    • NodeSDKConfiguration.metricReader — use metricReaders instead.

    • NodeSDKConfiguration.spanProcessor — use spanProcessors instead.

    • export * as node from '@opentelemetry/sdk-node' — import directly from @opentelemetry/sdk-trace-node instead.

    • export * as tracing from '@opentelemetry/sdk-node' — import directly from @opentelemetry/sdk-trace-base instead.

  • Breaking

    sdk-logs: Remove deprecated SdkLogRecord type alias and LoggerProviderConfig type alias #7062

    • SdkLogRecord — use ReadWriteLogRecord instead.

    • LoggerProviderConfig — use LoggerProviderOptions instead.

  • Breaking

    Migrate package builds from tsc to tsdown, emitting dual CJS/ESM output from a single dist/ directory and declaring an exports map on every package #6293

    • Importing a package by its name is unaffected in both CommonJS and ESM, as is every subpath listed in its exports map.

    • Deep imports into the build output no longer resolve. An exports map 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 with ERR_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/esm and build/esnext (ESM) into dist/, using .cjs/.mjs extensions with matching .d.cts/.d.mts declarations.

    • <package>/package.json is no longer importable for the same reason. Read a package's version from your own dependency metadata, or use SDK_INFO from @opentelemetry/core for the SDK version.

    • The non-standard esnext entry point has been removed; tools that preferred it fall back to module (ESM) or main (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.

  • Breaking

    sdk-node: Remove "jaeger" propagator from @opentelemetry/sdk-node #7077

    • OTEL_PROPAGATORS=jaeger and { jaeger: null } in the configuration object are no longer recognised. Replace with "tracecontext".

    • See the 3.x migration guide for full instructions.

  • Breaking

    opentelemetry-exporter-prometheus: Default exporter host to localhost #6599

  • Breaking

    Bump minimum node.js version to >=22.15.0

  • Breaking

    api-logs: Move the Logs API to @opentelemetry/api and remove the standalone @opentelemetry/api-logs package #4862

  • Breaking

    exporter-prometheus: Stop reading Prometheus exporter host and port environment variables in the exporter constructor #6966

  • Breaking

    web-common: Clean up and deprecate network span utils #7114

    • These utilities were long planned for removal. They were moved from the sdk-trace-web package and are currently only used by the (deprecated) instrumentation-fetch and instrumentation-xml-http-request packages.

    • Drop the skipOldSemconvContentLengthAttrs vestigial option from addSpanNetworkEvents().

  • Breaking

    sdk-node: Drop SDK package re-exports (api, contextBase, core, logs, metrics, resources) #7111

  • Breaking

    sdk-logs: Mark @opentelemetry/sdk-logs as stable #7143

  • Breaking

    Replace the browser field in package.json with #platform subpath imports #7141

    • Resolvers with the node condition load the Node.js build; all others load the browser build. Bundlers without imports support fail; see the migration guide.

    • webpack needs 5.54 or later. Parcel needs package exports enabled and cannot resolve #platform from require().

    • Root type declarations describe the Node.js build.

  • Breaking

    instrumentation, exporter--otlp-http, exporter--otlp-proto: Remove the ./platform and ./platform/browser subpath exports; import from the package root #7141

  • Breaking

    otlp-exporter-base: Move OTLPExporterNodeConfigBase to @opentelemetry/otlp-exporter-base/node-http #7172

    • typesVersions maps the subpaths for moduleResolution: node.

:rocket: Features

  • Refactor!(api-logs): remove AnyValue-related types in favor of new types in the api package #6780

    • The AnyValue, LogBody, and LogAttributes types are no longer exported by the api-logs package.
      Instead, use the AnyValue and Attributes types from the latest @opentelemetry/api package.

    • This is part of supporting OTEP 4485.

  • instrumentation: Add isEnabled() to the browser InstrumentationBase; fetch and XHR report false when patching throws #7140

  • Breaking

    instrumentation: Make InstrumentationBase#_enabled protected on both platforms #7202

    • The browser base no longer tracks enable() and disable() calls. Browser subclasses set _enabled themselves; one that never sets it reports isEnabled() as false.

    • A browser subclass that declares its own private _enabled fails to compile; rename it or declare it protected.

:bug: Bug Fixes

  • otlp-exporter-base: Suppress tracing around the browser fetch transport's own request so a fetch instrumentation cannot create an export → span → export loop #6948

  • instrumentation-http: Set error.type on spans whose status code makes them an error #7061

  • exporter-prometheus: Prevent duplicate metric metadata and keep metric families grouped across instrumentation scopes in Prometheus scrapes #7047

  • configuration: Preserve zero-valued limits from environment variables #7060

  • otlp-exporter-base: Release the keepalive budget once the response body drains, instead of holding up the export until it does #7070

  • web-common: Export getElementXPath utility

    • This was accidentally missed when moving utilities from sdk-trace-web to web-common.

  • opentelemetry-browser-detector: Mark the package side-effect free so bundlers can tree-shake it #7135

  • Resolve the ESM build through the default export condition instead of import, so a resolver that activates neither import nor require still finds an entry point #7132

  • instrumentation-fetch: Define PropagateTraceHeaderCorsUrls locally, so the types no longer import @opentelemetry/web-common #7193

  • web-common: Declare @opentelemetry/sdk-trace and @opentelemetry/sdk-logs as dependencies #7193

  • instrumentation-fetch, instrumentation-xml-http-request: Stay disabled when fetch or XMLHttpRequest open/send is missing, so a later enable() retries #7171

  • instrumentation: Move InstrumentationNodeModuleFile behind #platform, so the root types no longer import Node.js path #7177

  • otlp-transformer: Accept DOM TextDecoder in ProtobufReader typing #7169

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.