# What changed in @opentelemetry/api

> 39 changes in @opentelemetry/api 2 from its official release notes, upgrade guides and advisories: 9 breaking, 4 deprecations, 1 security, 9 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/@opentelemetry/api/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @opentelemetry/api 2

### Breaking changes

- SimpleSpanProcessor.forceFlush() now rejects when a pending export fails. (2.10.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.10.0)
- In sdk-trace, the constructor now takes an options object containing the exporter instead of the exporter as its first argument. (2.9.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- In sdk-trace, the constructor now takes an options object containing the exporter and selfObsMeterProvider. (2.9.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- The limit is now enforced for event attributes. (2.6.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.1)
- The limit is now enforced for link attributes. (2.6.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.1)
- The limit is now enforced for event and link attributes. (2.6.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.1)
- The limit is now enforced for links. (2.6.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.1)
- 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.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.0)
- Corrected the overly broad type for otperformance, catching incompatible uses at compile time; use the target platform's performance implementation if affected. (2.2.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.2.0)

### Security

- OpenTelemetry Core: Unbounded memory allocation in W3C Baggage propagation (2.8.0) — [security advisory](https://github.com/advisories/GHSA-8988-4F7V-96QF)

### Deprecations

- The Jaeger propagator is deprecated in favor of W3CTraceContextPropagator; the package is planned for removal in SDK 3.x, approximately September 2026. (2.10.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.10.0)
- 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.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- The TraceState implementation in api is deprecated. (2.7.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.7.1)
- AsyncHooksContextManager is deprecated. (2.5.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.5.0)

### New APIs and options

- AsyncLocalStorageContextManager implements attach(), using AsyncLocalStorage.withScope() on Node.js 25.9+ and a manual disposable wrapper with enterWith() on older Node.js. (2.11.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.11.0)
- The force flush timeout can be configured per call. (2.11.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.11.0)
- Exporter metrics are implemented. (2.10.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.10.0)
- Log processor metrics are implemented. (2.10.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.10.0)
- Adds AlwaysRecordSampler to the trace SDK. (2.9.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- 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.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- Adds the maxExportBatchSize option to configure the maximum export batch size. (2.9.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- Implements metrics for span processors. (2.9.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- Span start/end metrics are implemented. (2.6.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.0)

### Performance

- The method's performance is optimized. (2.6.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.1)
- The method's performance is optimized. (2.6.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.1)
- The method avoids Object.entries, improving performance. (2.6.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.1)

### Behavior and default changes

- Concurrent forceFlush calls await ongoing exports and reuse a fresh concurrent export cycle, avoiding duplicate collection and export cycles. (2.9.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- set now returns the same TraceState instance when the key/value are invalid or make the whole trace state invalid. (2.7.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.7.1)
- unset now returns the same TraceState instance when the key is not present. (2.7.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.7.1)
- When best-effort parsing encounters duplicate keys, the most recent value wins. (2.7.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.7.1)
- The custom value from the environment variable for service.instance.id now takes priority over the random UUID backup. (2.5.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.5.1)
- A runtime check is used for the default service name. (2.5.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.5.0)

### Fixes and other changes

- Exponential histograms now ignore Infinity. (2.11.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.11.0)
- Multiple calls to serviceInstanceIdDetector.detect() now return the same value for service.instance.id. (2.11.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.11.0)
- The sampler now includes trace IDs at the ratio 1 upper bound. (2.10.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.10.0)
- Extraction no longer throws on malformed percent-encoded uber-trace-id or uberctx-* headers. (2.9.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.9.0)
- Warning logs are no longer shown when a module is not marked as loaded. (2.6.1) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.6.1)
- The export avoids DOM types, improving compatibility in environments without DOM types. (2.4.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.4.0)
- Constructor input validation is improved, helping catch invalid inputs. (2.4.0) — [release notes](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.4.0)
