feat(opentelemetry): Remove setupEventContextTrace - #23226
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4bf1290. Configure here.
| @@ -1,7 +1,5 @@ | |||
| export { getScopesFromContext } from './utils/contextData'; | |||
|
|
|||
| export { setupEventContextTrace } from './setupEventContextTrace'; | |||
There was a problem hiding this comment.
Public API removed without deprecation
High Severity
Flagged because of the PR Review Guidelines rule on breaking changes: setupEventContextTrace was a publicly exported @sentry/opentelemetry API and is removed here with no deprecation path. Downstream imports will fail, and MIGRATION.md also does not mention this removal.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 4bf1290. Configure here.
size-limit report 📦
|
We no longer need this.
4bf1290 to
453bfc7
Compare
| setupOtel(client); | ||
| } | ||
|
|
||
| setupEventContextTrace(client); | ||
|
|
||
| return client; | ||
| } | ||
|
|
There was a problem hiding this comment.
Bug: The removal of setupEventContextTrace in the Node SDK is not automatically replaced. Users with enableOpenTelemetrySetup: true will lose OTel trace context unless they manually add otlpIntegration.
Severity: MEDIUM
Suggested Fix
Automatically add otlpIntegration to the default integrations in the Node SDK when the enableOpenTelemetrySetup option is set to true. This would restore the previous behavior where OpenTelemetry trace context is automatically captured without requiring manual configuration from the user. Alternatively, clearly document this breaking change and instruct users to add the integration manually.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/vercel-edge/src/sdk.ts#L98-L103
Potential issue: The Node SDK previously used `setupEventContextTrace` to automatically
link Sentry events with active OpenTelemetry (OTel) spans when
`enableOpenTelemetrySetup` was true. This function has been removed. The replacement,
`otlpIntegration`, is not enabled by default. Consequently, users who enable OTel setup
will no longer have trace context from active OTel spans automatically associated with
their Sentry events. This is a breaking change that can lead to broken or incomplete
traces for users relying on the previous automatic OTel span linkage, unless they
manually add `otlpIntegration()` to their Sentry configuration.
Also affects:
packages/node/src/sdk/index.ts:230~235
Did we get this right? 👍 / 👎 to inform future reviews.


We no longer need this after #23225, as this should now pick up the correct span also for otel.