docs: clarify Sentry OpenTelemetry integration comments in instrument.ts

- Updated comments in the instrument.ts file to provide clearer context on Sentry's OpenTelemetry setup.
- Explained the implications of allowing Sentry to manage OpenTelemetry dependencies, specifically regarding the migration from v1 to v2.
This commit is contained in:
mantrakp04
2026-06-22 17:34:12 -07:00
parent 32ea6b9408
commit 902c92692b
+2 -1
View File
@@ -51,7 +51,8 @@ export function registerBackendInstrumentation() {
// registers the global trace/context/propagation APIs. Without this flag, @sentry/node (v10 is
// OpenTelemetry-native) tries to register them again, logging "Attempted duplicate registration
// of API: trace/propagation/context". Skipping Sentry's OTel setup lets the NodeSDK own it while
// error capture continues to work normally.
// error capture continues to work normally. (Letting Sentry own OTel instead would require migrating
// our OpenTelemetry deps from v1 to v2 to match @sentry/node v10.)
skipOpenTelemetrySetup: true,
dsn: getEnvVariable("NEXT_PUBLIC_SENTRY_DSN", ""),
enabled: getNodeEnvironment() !== "development" && !getEnvVariable("CI", ""),