unstale

npm / @opentelemetry/api

@opentelemetry/api

What changed in @opentelemetry/api 2, from its official release notes, upgrade guides and advisories. Also covers @opentelemetry/core, @opentelemetry/semantic-conventions. Sources checked 2026-10-18.

9 breaking1 security4 deprecations9 new APIs and options3 performance6 behavior and defaults7 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

@opentelemetry/api 239 changes

Breaking changes 9

  • SimpleSpanProcessor.forceFlush() now rejects when a pending export fails.

    2.10.0release notes

  • In sdk-trace, the constructor now takes an options object containing the exporter instead of the exporter as its first argument.

    2.9.0release notes

  • In sdk-trace, the constructor now takes an options object containing the exporter and selfObsMeterProvider.

    2.9.0release notes

  • The limit is now enforced for event attributes.

    2.6.1release notes

  • The limit is now enforced for link attributes.

    2.6.1release notes

  • The limit is now enforced for event and link attributes.

    2.6.1release notes

  • The limit is now enforced for links.

    2.6.1release notes

  • Parsing now ignores the entire environment variable if any entry is invalid. Double-quotes remain part of values; encode leading or trailing whitespace with percent-encoding.

    2.6.0release notes

  • Corrected the overly broad type for otperformance, catching incompatible uses at compile time; use the target platform's performance implementation if affected.

    2.2.0release notes

Security 1

  • OpenTelemetry Core: Unbounded memory allocation in W3C Baggage propagation

    2.8.0security advisory

Deprecations 4

  • The Jaeger propagator is deprecated in favor of W3CTraceContextPropagator; the package is planned for removal in SDK 3.x, approximately September 2026.

    2.10.0release notes

  • The package is planned for removal in SDK 3.x, approximately September 2026, following deprecation of OpenTracing compatibility requirements in the OpenTelemetry specification.

    2.9.0release notes

  • The TraceState implementation in api is deprecated.

    2.7.1release notes

  • AsyncHooksContextManager is deprecated.

    2.5.0release notes

New APIs and options 9

  • AsyncLocalStorageContextManager implements attach(), using AsyncLocalStorage.withScope() on Node.js 25.9+ and a manual disposable wrapper with enterWith() on older Node.js.

    2.11.0release notes

  • The force flush timeout can be configured per call.

    2.11.0release notes

  • Exporter metrics are implemented.

    2.10.0release notes

  • Log processor metrics are implemented.

    2.10.0release notes

  • Adds AlwaysRecordSampler to the trace SDK.

    2.9.0release notes

  • Adds a Trace SDK package without environment variable configuration handling; it is intended to eventually replace sdk-trace-base, sdk-trace-node, and sdk-trace-web.

    2.9.0release notes

  • Adds the maxExportBatchSize option to configure the maximum export batch size.

    2.9.0release notes

  • Implements metrics for span processors.

    2.9.0release notes

  • Span start/end metrics are implemented.

    2.6.0release notes

Performance 3

Behavior and default changes 6

  • Concurrent forceFlush calls await ongoing exports and reuse a fresh concurrent export cycle, avoiding duplicate collection and export cycles.

    2.9.0release notes

  • set now returns the same TraceState instance when the key/value are invalid or make the whole trace state invalid.

    2.7.1release notes

  • unset now returns the same TraceState instance when the key is not present.

    2.7.1release notes

  • When best-effort parsing encounters duplicate keys, the most recent value wins.

    2.7.1release notes

  • The custom value from the environment variable for service.instance.id now takes priority over the random UUID backup.

    2.5.1release notes

  • A runtime check is used for the default service name.

    2.5.0release notes

Fixes and other changes 7

  • Exponential histograms now ignore Infinity.

    2.11.0release notes

  • Multiple calls to serviceInstanceIdDetector.detect() now return the same value for service.instance.id.

    2.11.0release notes

  • The sampler now includes trace IDs at the ratio 1 upper bound.

    2.10.0release notes

  • Extraction no longer throws on malformed percent-encoded uber-trace-id or uberctx-* headers.

    2.9.0release notes

  • Warning logs are no longer shown when a module is not marked as loaded.

    2.6.1release notes

  • The export avoids DOM types, improving compatibility in environments without DOM types.

    2.4.0release notes

  • Constructor input validation is improved, helping catch invalid inputs.

    2.4.0release notes