You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Goal: add additional span processors to Sentry Node and Sentry NextJS. This is currently blocking our production customers, so urgency would be appreciated!
TLDR:
To add additional span processors, the recommended approach is to use client.traceProvider.addSpanProcessors([...]) as documented here.
spanProcessors: [
new SentrySpanProcessor({
timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),
}),
...client.getOptions().spanProcessors,
],
and the user would do something like this:
const client = Sentry.init({
dsn: "https://9ee4c...31168",
// Add optional integrations for additional features
integrations: [
Sentry.replayIntegration(),
],
tracesSampleRate: 1,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
debug: false,
// This is the recommend approach after the deprecation of client.traceProviders.addSpanProcessors([...])
// PR https://github.com/open-telemetry/opentelemetry-js/issues/4792
// However, this is not picked up in https://github.com/getsentry/sentry-javascript/blob/develop/packages/node/src/sdk/initOtel.ts#L143-L147
spanProcessors: [
new BatchSpanProcessor(new OTLPTraceExporter(
{
url: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
},
)),
],
} as Sentry.NodeOptions) as Sentry.NodeClient;
Please let us know if you need anything.
The text was updated successfully, but these errors were encountered:
Hi @sunnybak thanks for writing in! This is indeed a noteworthy change in the next Otel SDK major version and we'll probably need to adapt our strategy how to enable adding processors.
This is currently blocking our production customers
Is this actually hard-blocking you? The new Otel SDK version isn't released yet, so right now, adding a span processor via addSpanProcessors() is only deprecated but should still work. I understand this is not ideal but I'm just trying to assess priority here :)
Otherwise, your proposed API makes sense to me. I'll also tag @mydea - thoughts?
Btw, for the next time, please use our issue templates. They're there for a reason. Thanks!
Another thought: Have you tried using a custom Otel Setup where you add Sentry components instead of using the Sentry setup and adding additional Otel components? Maybe this can also unblock you.
Imho we can add a config similar to what we did for additional otel instrumentation to also pass in more span processors to sentry init! But agree, for now using the deprecated methods should be fine, we will work on a suitable replacement in early January then :)
Goal: add additional span processors to Sentry Node and Sentry NextJS. This is currently blocking our production customers, so urgency would be appreciated!
TLDR:
client.traceProvider.addSpanProcessors([...])
as documented here.@sentry/node
or@sentry/nextjs
Proposed Solution:
spanProcessors
when theTraceProvider
is initialized, which would be hereNodeOption
) can be read and added to thespanProcessors
when initializing OTEL in SentryProposed code change in initOtel.ts:
and the user would do something like this:
Please let us know if you need anything.
The text was updated successfully, but these errors were encountered: