Announcing the OpenTelemetry JavaScript SDK 2.0
Exciting news: OpenTelemetry JavaScript has released SDK 2.0!
For a detailed description of breaking changes, see the migration guide Upgrade to OpenTelemetry JS SDK 2.x.
What is JS SDK 2.x?
JS SDK 2.x encompasses new releases of the @opentelemetry/*
JavaScript
packages published from the
opentelemetry-js
repository,
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.
What has changed?
Summary
- 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. - The minimum supported TypeScript version has been raised to 5.0.4.
- The compilation target for transpiled TypeScript has been raised to ES2022 (from ES2017).
- The public interface has changed
- for notes on migrating to 2.x / 0.200.x see the upgrade guide
Details
- Node.js supported versions
- TypeScript supported versions
- ES2022 compilation target
- Drop
window.OTEL_*
support in browsers @opentelemetry/resources
API changes@opentelemetry/core
API changes- Tracing SDK API changes
@opentelemetry/sdk-metrics
API changes@opentelemetry/resources
changes for implementors of Resource Detectors- Other changes
Why was this done?
Some of the details for why this 2.0 was done can be found in this issue. We knew we would gain the greatest benefit by allowing breaking changes to improve things related to:
- Optimization: removing classes and namespaces to allow better minification and tree-shaking.
- Better Tooling and Support: dropping old runtimes and tool versions to take advantage of enhanced ESM support and simplify documentation.
- Velocity: reducing code complexity and removing deprecated fields for faster feature and maintenance work.
This also begins our goal of releasing a new major release every year.
How can I get involved?
- Try out the v2.0.0 and v0.200.0 releases and provide feedback
- Review our contributing guide for details on contributing
- Attend our SIG meetings
- Collaborate on Slack