Support OpenTelemetry SDK v2
Description
Today, the Node SDK uses & supports the OpenTelemetry SDK in version 1.x.
Since v2 was released, we should look into supporting this as well.
This is, as of now, a breaking change, as anybody using @sentry/node with custom stuff that depends on OTEL v1 will have breakage once we update this.
Because of this, we will likely cut a v10 release soon-ish that only bumps OTEL to v2.
There are a few pieces to this:
- Widen ranges of peerDependencies in
@sentry/opentelemetryto allow both v1 and v2 (if possible - this can already happen on v9!) - On v10 branch, bump the used versions of dependencies of
@sentry/nodeto v2 of the OTEL SDKs a. We need to make sure that all instrumentations we use (e.g. prisma, remix, ...) are also on v2 first! - While we are at this, we may re-visit how we handle/support users with custom OTEL setups. Today, it is pretty hard to make this work because we ship our own versions of everything, which easily conflicts with user versions. In order to solve this, we want to introduce a
@sentry/node-coreSDK, which does not include any OTEL dependencies (but instead has peerDependency ranges defined). This SDK ships without any instrumentations out of the box. It can be used both by users that want a custom OTEL setup, as well as for scenarios where you only need manual instrumentation (e.g. CLIs or similar). See https://github.com/getsentry/sentry-javascript/issues/15213
Experimental work for this is being done here: https://github.com/getsentry/sentry-javascript/pull/15518
This is currently a blocker for us, we hope to see a compatible release soon
Any news on this one?
@dcaffull-fds we're actively working on this. Once this is ready for users to try out we'll update in this GH issue. Thanks!
Am I right to assume that the fruit of this labour will arrive in the Sentry 10.x release?
I have an open ticket to upgrade to opentelemetry v2, but this issue in Sentry has been blocking me since spring. Knowing it will come in 10.x will at least let me snooze until that clear signal arrives :)
@klippx yes, this will land with v10 of our SDKs.
Hi, we recently shipped a new @sentry/node-core SDK that comes with a widened peer dependency range on OpenTelemetry and without any OpenTelemetry auto instrumentations out of the box. This SDK is now at the base of @sentry/node.
We suggest users with custom OpenTelemetry setups to use this SDK over @sentry/node with the caveat that anything tracing related has to be set up by users themselves.
For users that are fine with the OpenTelemetry setup @sentry/node ships with but would like to give OpenTelemetry v2 a try, we have a v10 alpha.
We'd love if you could give this a try and provide feedback here or in newly filed issues.
v10 has now been released which marks the completion of this project. We'd appreciate hearing back from folks with custom OTel setups and their experience. Feel free to file new issues on the repo.