|
| 1 | +--- |
| 2 | +title: Announcing the OpenTelemetry JavaScript SDK 2.0 |
| 3 | +linkTitle: OTel JS SDK 2.0 |
| 4 | +date: 2025-02-21 |
| 5 | +author: > |
| 6 | + [Jamie Danielson](https://github.com/JamieDanielson) (Honeycomb) |
| 7 | +sig: OpenTelemetry JS |
| 8 | +--- |
| 9 | + |
| 10 | +Exciting news! [OpenTelemetry JavaScript](https://github.com/open-telemetry/opentelemetry-js) has released [SDK 2.0](https://github.com/open-telemetry/opentelemetry-js/releases)! |
| 11 | + |
| 12 | +There is a [migration guide](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md) in the repo detailing breaking changes and steps for users to take to upgrade to the latest versions. |
| 13 | + |
| 14 | +## What is JS SDK 2.x? |
| 15 | + |
| 16 | +"JS SDK 2.x" encompasses new releases of the `@opentelemetry/*` JavaScript packages published from the [`opentelemetry-js` repository](https://github.com/open-telemetry/opentelemetry-js), except the API and semantic-conventions packages. The package versions for this new major will be `>=2.0.0` for the stable and `>=0.200.0` for the unstable packages. Details on the full list of packages can be found in the [migration guide](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#what-is-js-sdk-2x). |
| 17 | + |
| 18 | +## What has changed? |
| 19 | + |
| 20 | +### Summary |
| 21 | + |
| 22 | +- The **minimum supported Node.js has been raised to `^18.19.0 || >=20.6.0`**. This means that support for Node.js 14 and 16 has been dropped. |
| 23 | +- The **minimum supported TypeScript version has been raised to 5.0.4**. |
| 24 | +- The **compilation target for transpiled TypeScript has been raised to ES2022** (from ES2017). |
| 25 | +- The **public interface has changed** |
| 26 | + - for notes on migrating to 2.x / 0.200.x see [the upgrade guide](https://github.com/open-telemetry/opentelemetry-js/tree/main/doc/upgrade-to-2.x.md) |
| 27 | + |
| 28 | +### Details |
| 29 | + |
| 30 | +- [Node.js supported versions](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-nodejs-supported-versions) |
| 31 | +- [TypeScript supported versions](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-typescript-supported-versions) |
| 32 | +- [ES2022 compilation target](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-es2022-compilation-target) |
| 33 | +- [Drop `window.OTEL_*` support in browsers](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-drop-windowotel_-support-in-browsers) |
| 34 | +- [`@opentelemetry/resources` API changes](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-opentelemetryresources-api-changes) |
| 35 | +- [`@opentelemetry/core` API changes](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-opentelemetrycore-api-changes) |
| 36 | +- [Tracing SDK API changes](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-tracing-sdk-api-changes) |
| 37 | +- [`@opentelemetry/sdk-metrics` API changes](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-opentelemetrysdk-metrics-api-changes) |
| 38 | +- [`@opentelemetry/resources` changes for *implementors* of Resource Detectors](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-opentelemetryresources-changes-for-implementors-of-resource-detectors) |
| 39 | +- [Other changes](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/upgrade-to-2.x.md#-other-changes) |
| 40 | + |
| 41 | +## Why was this done? |
| 42 | + |
| 43 | +Some of the details for why this 2.0 was done can be found [in this issue](https://github.com/open-telemetry/opentelemetry-js/issues/4083). We knew we would gain the greatest benefit by allowing breaking changes to improve things related to: |
| 44 | + |
| 45 | +- Optimization: removing classes and namespaces to allow better minification and tree-shaking. |
| 46 | +- Better Tooling and Support: dropping old runtimes and tool versions to take advantage of enhanced ESM support and simplify documentation. |
| 47 | +- Velocity: reducing code complexity and removing deprecated fields for faster feature and maintenance work. |
| 48 | + |
| 49 | +This also begins our goal of releasing a new major release every year. |
| 50 | + |
| 51 | +## How can I get involved? |
| 52 | + |
| 53 | +- Try out the [v2.0.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/v2.0.0) and [v0.200.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.200.0) releases and provide feedback |
| 54 | +- Review our [contributing guide](https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md) for details on contributing |
| 55 | +- Attend our [SIG meetings](https://groups.google.com/a/opentelemetry.io/g/calendar-js) |
| 56 | +- Collaborate on [Slack](https://cloud-native.slack.com/archives/C01NL1GRPQR) |
0 commit comments