@sentry/node 10.65.0 → 10.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/build/cjs/index.js +30 -27
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/tracing/dataloader/index.js +7 -2
  4. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -1
  5. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +4 -2
  6. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  7. package/build/cjs/integrations/tracing/index.js +2 -2
  8. package/build/cjs/integrations/tracing/index.js.map +1 -1
  9. package/build/cjs/integrations/tracing/knex/index.js +6 -1
  10. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  11. package/build/cjs/integrations/tracing/koa/vendored/utils.js +4 -1
  12. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -1
  13. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +8 -9
  14. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -1
  15. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +5 -118
  16. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -1
  17. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +33 -23
  18. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  19. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +0 -16
  20. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  21. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +2 -2
  22. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  23. package/build/cjs/sdk/index.js +13 -3
  24. package/build/cjs/sdk/index.js.map +1 -1
  25. package/build/cjs/sdk/initOtel.js +26 -2
  26. package/build/cjs/sdk/initOtel.js.map +1 -1
  27. package/build/esm/index.js +3 -2
  28. package/build/esm/index.js.map +1 -1
  29. package/build/esm/integrations/tracing/dataloader/index.js +7 -2
  30. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -1
  31. package/build/esm/integrations/tracing/graphql/vendored/utils.js +5 -3
  32. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  33. package/build/esm/integrations/tracing/index.js +1 -1
  34. package/build/esm/integrations/tracing/index.js.map +1 -1
  35. package/build/esm/integrations/tracing/knex/index.js +6 -1
  36. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  37. package/build/esm/integrations/tracing/koa/vendored/utils.js +5 -2
  38. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -1
  39. package/build/esm/integrations/tracing/mongo/vendored/patches.js +3 -4
  40. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -1
  41. package/build/esm/integrations/tracing/mongo/vendored/utils.js +6 -118
  42. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -1
  43. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +35 -25
  44. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  45. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +1 -16
  46. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  47. package/build/esm/package.json +1 -1
  48. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +2 -2
  49. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  50. package/build/esm/sdk/index.js +13 -4
  51. package/build/esm/sdk/index.js.map +1 -1
  52. package/build/esm/sdk/initOtel.js +27 -3
  53. package/build/esm/sdk/initOtel.js.map +1 -1
  54. package/build/types/index.d.ts +3 -2
  55. package/build/types/index.d.ts.map +1 -1
  56. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -1
  57. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -1
  58. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  59. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -1
  60. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -1
  61. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +6 -15
  62. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -1
  63. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +0 -1
  64. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -1
  65. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +1 -3
  66. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -1
  67. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +2 -1
  68. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -1
  69. package/build/types/sdk/index.d.ts +18 -0
  70. package/build/types/sdk/index.d.ts.map +1 -1
  71. package/build/types/sdk/initOtel.d.ts.map +1 -1
  72. package/build/types-ts3.8/index.d.ts +3 -2
  73. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +6 -15
  74. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +0 -1
  75. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +1 -3
  76. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +2 -1
  77. package/build/types-ts3.8/sdk/index.d.ts +18 -0
  78. package/package.json +6 -6
  79. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js +0 -14
  80. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +0 -1
  81. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +0 -10
  82. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +0 -1
  83. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +0 -6
  84. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +0 -1
  85. package/build/cjs/integrations/tracing/prisma/index.js +0 -109
  86. package/build/cjs/integrations/tracing/prisma/index.js.map +0 -1
  87. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js +0 -145
  88. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +0 -1
  89. package/build/cjs/integrations/tracing/prisma/vendored/constants.js +0 -14
  90. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +0 -1
  91. package/build/cjs/integrations/tracing/prisma/vendored/global.js +0 -28
  92. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +0 -1
  93. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js +0 -33
  94. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +0 -1
  95. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js +0 -12
  96. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +0 -1
  97. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +0 -6
  98. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +0 -1
  99. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +0 -4
  100. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +0 -1
  101. package/build/esm/integrations/tracing/prisma/index.js +0 -106
  102. package/build/esm/integrations/tracing/prisma/index.js.map +0 -1
  103. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js +0 -143
  104. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +0 -1
  105. package/build/esm/integrations/tracing/prisma/vendored/constants.js +0 -9
  106. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +0 -1
  107. package/build/esm/integrations/tracing/prisma/vendored/global.js +0 -24
  108. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +0 -1
  109. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js +0 -31
  110. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +0 -1
  111. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +0 -17
  112. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +0 -1
  113. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -9
  114. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +0 -1
  115. package/build/types/integrations/tracing/prisma/index.d.ts +0 -34
  116. package/build/types/integrations/tracing/prisma/index.d.ts.map +0 -1
  117. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +0 -16
  118. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +0 -1
  119. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts +0 -5
  120. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +0 -1
  121. package/build/types/integrations/tracing/prisma/vendored/global.d.ts +0 -5
  122. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +0 -1
  123. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts +0 -15
  124. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +0 -1
  125. package/build/types/integrations/tracing/prisma/vendored/types.d.ts +0 -34
  126. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +0 -1
  127. package/build/types/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts +0 -38
  128. package/build/types/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts.map +0 -1
  129. package/build/types/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts +0 -31
  130. package/build/types/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts.map +0 -1
  131. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +0 -17
  132. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -9
  133. package/build/types-ts3.8/integrations/tracing/prisma/index.d.ts +0 -34
  134. package/build/types-ts3.8/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +0 -16
  135. package/build/types-ts3.8/integrations/tracing/prisma/vendored/constants.d.ts +0 -5
  136. package/build/types-ts3.8/integrations/tracing/prisma/vendored/global.d.ts +0 -5
  137. package/build/types-ts3.8/integrations/tracing/prisma/vendored/instrumentation.d.ts +0 -15
  138. package/build/types-ts3.8/integrations/tracing/prisma/vendored/types.d.ts +0 -37
  139. package/build/types-ts3.8/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts +0 -44
  140. package/build/types-ts3.8/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts +0 -34
@@ -1 +1 @@
1
- {"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { context, propagation, trace } from '@opentelemetry/api';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport { debug as coreDebug, hasSpanStreamingEnabled } from '@sentry/core';\nimport {\n initializeEsmLoader,\n type NodeClient,\n SentryContextManager,\n setupOpenTelemetryLogger,\n} from '@sentry/node-core';\nimport {\n applyOtelSpanData,\n type AsyncLocalStorageLookup,\n backfillStreamedSpanDataFromOtel,\n getSentryResource,\n type OpenTelemetryTracerProvider,\n SentryPropagator,\n SentrySampler,\n SentrySpanProcessor,\n SentryTracerProvider,\n setIsSetup,\n} from '@sentry/opentelemetry';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing';\n\n// About 277h - this must fit into new Array(len)!\nconst MAX_MAX_SPAN_WAIT_DURATION = 1_000_000;\n\ninterface AdditionalOpenTelemetryOptions {\n /** Additional SpanProcessor instances that should be used. */\n spanProcessors?: SpanProcessor[];\n}\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): void {\n if (client.getOptions().debug) {\n setupOpenTelemetryLogger();\n }\n\n const [provider, asyncLocalStorageLookup] = setupOtel(client, options);\n client.traceProvider = provider;\n client.asyncLocalStorageLookup = asyncLocalStorageLookup;\n}\n\ninterface NodePreloadOptions {\n debug?: boolean;\n integrations?: string[];\n}\n\n/**\n * Preload OpenTelemetry for Node.\n * This can be used to preload instrumentation early, but set up Sentry later.\n * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.\n */\nexport function preloadOpenTelemetry(options: NodePreloadOptions = {}): void {\n const { debug } = options;\n\n if (debug) {\n coreDebug.enable();\n }\n\n initializeEsmLoader();\n\n // These are all integrations that we need to pre-load to ensure they are set up before any other code runs\n getPreloadMethods(options.integrations).forEach(fn => {\n fn();\n\n if (debug) {\n coreDebug.log(`[Sentry] Preloaded ${fn.id} instrumentation`);\n }\n });\n}\n\nfunction getPreloadMethods(integrationNames?: string[]): ((() => void) & { id: string })[] {\n const instruments = getOpenTelemetryInstrumentationToPreload();\n\n if (!integrationNames) {\n return instruments;\n }\n\n // We match exact matches of instrumentation, but also match prefixes, e.g. \"Fastify.v5\" will match \"Fastify\"\n return instruments.filter(instrumentation => {\n const id = instrumentation.id;\n return integrationNames.some(integrationName => id === integrationName || id.startsWith(`${integrationName}.`));\n });\n}\n\n/** Just exported for tests. */\nexport function setupOtel(\n client: NodeClient,\n options: AdditionalOpenTelemetryOptions = {},\n): [OpenTelemetryTracerProvider | undefined, AsyncLocalStorageLookup | undefined] {\n // Sentry's minimal tracer provider is the default. We fall back to the full OpenTelemetry SDK\n // `BasicTracerProvider` when the user explicitly opts in via `openTelemetryBasicTracerProvider`, or\n // when they provide custom `openTelemetrySpanProcessors` — those require the SDK span pipeline\n // that the minimal provider does not run.\n const shouldUseBasicTracerProvider =\n client.getOptions().openTelemetryBasicTracerProvider || !!options.spanProcessors?.length;\n\n if (!shouldUseBasicTracerProvider) {\n return setupSentryTracerProvider(client);\n }\n\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: getSentryResource('node'),\n forceFlushTimeoutMillis: 500,\n spanProcessors: [\n new SentrySpanProcessor({\n timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),\n client,\n }),\n ...(options.spanProcessors || []),\n ],\n });\n\n // Register as globals\n trace.setGlobalTracerProvider(provider);\n propagation.setGlobalPropagator(new SentryPropagator());\n\n const ctxManager = new SentryContextManager();\n context.setGlobalContextManager(ctxManager);\n\n return [provider, ctxManager.getAsyncLocalStorageLookup()];\n}\n\nfunction setupSentryTracerProvider(\n client: NodeClient,\n): [SentryTracerProvider | undefined, AsyncLocalStorageLookup | undefined] {\n const provider = new SentryTracerProvider({ resource: getSentryResource('node') });\n\n if (!trace.setGlobalTracerProvider(provider)) {\n DEBUG_BUILD &&\n coreDebug.warn(\n 'Could not register SentryTracerProvider because another OpenTelemetry tracer provider is already registered.',\n );\n return [undefined, undefined];\n }\n\n // Only mark the provider as set up once it is actually the registered global\n // tracer provider, so setup validation doesn't skip required checks when\n // registration failed.\n setIsSetup('SentryTracerProvider');\n\n propagation.setGlobalPropagator(new SentryPropagator());\n\n const ctxManager = new SentryContextManager();\n context.setGlobalContextManager(ctxManager);\n\n client.on('spanEnd', span => {\n applyOtelSpanData(span, { finalizeStatus: true });\n });\n\n if (hasSpanStreamingEnabled(client)) {\n // Streamed spans skip the exporter, so per-span data inferred from OTel semantic conventions\n // (notably `sentry.source` on child spans, which `applyOtelSpanData` only sets on segment roots)\n // is backfilled here, reusing the exact inference the OTel SDK `SentrySpanProcessor` applies.\n client.on('preprocessSpan', backfillStreamedSpanDataFromOtel);\n }\n\n client.on('preprocessEvent', event => {\n if (event.type !== 'transaction') {\n return;\n }\n\n event.contexts = {\n ...event.contexts,\n otel: {\n resource: provider.resource?.attributes,\n ...event.contexts?.otel,\n },\n };\n });\n\n return [provider, ctxManager.getAsyncLocalStorageLookup()];\n}\n\n/** Just exported for tests. */\nexport function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined {\n if (maxSpanWaitDuration == null) {\n return undefined;\n }\n\n // We guard for a max. value here, because we create an array with this length\n // So if this value is too large, this would fail\n if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) {\n DEBUG_BUILD &&\n coreDebug.warn(`\\`maxSpanWaitDuration\\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`);\n return MAX_MAX_SPAN_WAIT_DURATION;\n } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) {\n DEBUG_BUILD && coreDebug.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.');\n return undefined;\n }\n\n return maxSpanWaitDuration;\n}\n"],"names":["debug","coreDebug"],"mappings":";;;;;;;;AA0BA,MAAM,0BAAA,GAA6B,GAAA;AAU5B,SAAS,iBAAA,CAAkB,MAAA,EAAoB,OAAA,GAA0C,EAAC,EAAS;AACxG,EAAA,IAAI,MAAA,CAAO,UAAA,EAAW,CAAE,KAAA,EAAO;AAC7B,IAAA,wBAAA,EAAyB;AAAA,EAC3B;AAEA,EAAA,MAAM,CAAC,QAAA,EAAU,uBAAuB,CAAA,GAAI,SAAA,CAAU,QAAQ,OAAO,CAAA;AACrE,EAAA,MAAA,CAAO,aAAA,GAAgB,QAAA;AACvB,EAAA,MAAA,CAAO,uBAAA,GAA0B,uBAAA;AACnC;AAYO,SAAS,oBAAA,CAAqB,OAAA,GAA8B,EAAC,EAAS;AAC3E,EAAA,MAAM,SAAEA,SAAM,GAAI,OAAA;AAElB,EAAA,IAAIA,OAAA,EAAO;AACT,IAAAC,KAAA,CAAU,MAAA,EAAO;AAAA,EACnB;AAEA,EAAA,mBAAA,EAAoB;AAGpB,EAAA,iBAAA,CAAkB,OAAA,CAAQ,YAAY,CAAA,CAAE,OAAA,CAAQ,CAAA,EAAA,KAAM;AACpD,IAAA,EAAA,EAAG;AAEH,IAAA,IAAID,OAAA,EAAO;AACT,MAAAC,KAAA,CAAU,GAAA,CAAI,CAAA,mBAAA,EAAsB,EAAA,CAAG,EAAE,CAAA,gBAAA,CAAkB,CAAA;AAAA,IAC7D;AAAA,EACF,CAAC,CAAA;AACH;AAEA,SAAS,kBAAkB,gBAAA,EAAgE;AACzF,EAAA,MAAM,cAAc,wCAAA,EAAyC;AAE7D,EAAA,IAAI,CAAC,gBAAA,EAAkB;AACrB,IAAA,OAAO,WAAA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,CAAA;AAC3D;AAGO,SAAS,2BAA2B,mBAAA,EAA6D;AACtG,EAAA,IAAI,uBAAuB,IAAA,EAAM;AAC/B,IAAA,OAAO,MAAA;AAAA,EACT;AAIA,EAAA,IAAI,sBAAsB,0BAAA,EAA4B;AACpD,IAAA,WAAA,IACEA,KAAA,CAAU,IAAA,CAAK,CAAA,gEAAA,EAAmE,0BAA0B,CAAA,CAAE,CAAA;AAChH,IAAA,OAAO,0BAAA;AAAA,EACT,WAAW,mBAAA,IAAuB,CAAA,IAAK,MAAA,CAAO,KAAA,CAAM,mBAAmB,CAAA,EAAG;AACxE,IAAA,WAAA,IAAeA,KAAA,CAAU,KAAK,+EAA+E,CAAA;AAC7G,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAO,mBAAA;AACT;;;;"}
1
+ {"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import type { TracerProvider } from '@opentelemetry/api';\nimport { context, propagation, trace } from '@opentelemetry/api';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport { debug as coreDebug, hasSpanStreamingEnabled } from '@sentry/core';\nimport {\n initializeEsmLoader,\n type NodeClient,\n SentryContextManager,\n setupOpenTelemetryLogger,\n} from '@sentry/node-core';\nimport {\n applyOtelSpanData,\n type AsyncLocalStorageLookup,\n backfillStreamedSpanDataFromOtel,\n getSentryResource,\n type OpenTelemetryTracerProvider,\n SentryPropagator,\n SentrySampler,\n SentrySpanProcessor,\n SentryTracerProvider,\n setIsSetup,\n} from '@sentry/opentelemetry';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing';\n\n// About 277h - this must fit into new Array(len)!\nconst MAX_MAX_SPAN_WAIT_DURATION = 1_000_000;\n\n// The global registry of @opentelemetry/api 1.x, shared across all copies of the package\nconst OTEL_API_GLOBAL_KEY = Symbol.for('opentelemetry.js.api.1');\n\n/**\n * Registers the given tracer provider as the global tracer provider, recreating the OpenTelemetry\n * API registry when it pre-exists with a different `@opentelemetry/api` version.\n *\n * Some host runtimes (e.g. Neon Functions) pre-create the registry with their own API version.\n * `registerGlobal` requires an exact version match, so every registration through the SDK's copy\n * of `@opentelemetry/api` is rejected and tracing is silently disabled\n * (https://github.com/getsentry/sentry-javascript/issues/22338). This case is identified by a\n * failed registration with an empty `trace` slot: `registerGlobal` checks the slot before the\n * version, so an empty slot means the version gate rejected us and recreating the registry\n * clobbers no other tracer provider. If the slot is occupied (another provider registered first,\n * e.g. a second `Sentry.init()` call), the registry is left untouched and registration fails.\n *\n * Slots Sentry does not claim itself (e.g. `diag`, `metrics`) are carried over into the recreated\n * registry: reads resolve via a semver-compatibility check rather than the exact-match write gate,\n * so they keep working for the copy that registered them. `propagation` and `context` are not\n * carried over because Sentry registers its own right after this.\n */\nfunction registerGlobalTracerProvider(provider: TracerProvider): boolean {\n if (trace.setGlobalTracerProvider(provider)) {\n return true;\n }\n\n // @opentelemetry/api stores the registry under a `Symbol.for` key that no public type\n // describes, so `typeof globalThis` can only be narrowed to it by casting through `unknown`.\n const otelGlobal = globalThis as unknown as Record<symbol, Record<string, unknown> | undefined>;\n const registry = otelGlobal[OTEL_API_GLOBAL_KEY];\n if (registry && !registry.trace) {\n DEBUG_BUILD &&\n coreDebug.warn(\n 'Replaced a pre-existing OpenTelemetry API registry that was created by a different @opentelemetry/api version and would have blocked tracing. If you want to manage OpenTelemetry yourself, set `skipOpenTelemetrySetup: true` in `Sentry.init()`.',\n );\n otelGlobal[OTEL_API_GLOBAL_KEY] = undefined;\n\n if (!trace.setGlobalTracerProvider(provider)) {\n return false;\n }\n\n // The cast is needed because TS still has the slot narrowed to `undefined` from the reset\n // above and cannot know the registration call just recreated the registry.\n const recreatedRegistry = otelGlobal[OTEL_API_GLOBAL_KEY] as Record<string, unknown> | undefined;\n if (recreatedRegistry) {\n const { propagation: _propagation, context: _context, ...carriedOverSlots } = registry;\n otelGlobal[OTEL_API_GLOBAL_KEY] = { ...carriedOverSlots, ...recreatedRegistry };\n }\n\n return true;\n }\n\n return false;\n}\n\ninterface AdditionalOpenTelemetryOptions {\n /** Additional SpanProcessor instances that should be used. */\n spanProcessors?: SpanProcessor[];\n}\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): void {\n if (client.getOptions().debug) {\n setupOpenTelemetryLogger();\n }\n\n const [provider, asyncLocalStorageLookup] = setupOtel(client, options);\n client.traceProvider = provider;\n client.asyncLocalStorageLookup = asyncLocalStorageLookup;\n}\n\ninterface NodePreloadOptions {\n debug?: boolean;\n integrations?: string[];\n}\n\n/**\n * Preload OpenTelemetry for Node.\n * This can be used to preload instrumentation early, but set up Sentry later.\n * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.\n */\nexport function preloadOpenTelemetry(options: NodePreloadOptions = {}): void {\n const { debug } = options;\n\n if (debug) {\n coreDebug.enable();\n }\n\n initializeEsmLoader();\n\n // These are all integrations that we need to pre-load to ensure they are set up before any other code runs\n getPreloadMethods(options.integrations).forEach(fn => {\n fn();\n\n if (debug) {\n coreDebug.log(`[Sentry] Preloaded ${fn.id} instrumentation`);\n }\n });\n}\n\nfunction getPreloadMethods(integrationNames?: string[]): ((() => void) & { id: string })[] {\n const instruments = getOpenTelemetryInstrumentationToPreload();\n\n if (!integrationNames) {\n return instruments;\n }\n\n // We match exact matches of instrumentation, but also match prefixes, e.g. \"Fastify.v5\" will match \"Fastify\"\n return instruments.filter(instrumentation => {\n const id = instrumentation.id;\n return integrationNames.some(integrationName => id === integrationName || id.startsWith(`${integrationName}.`));\n });\n}\n\n/** Just exported for tests. */\nexport function setupOtel(\n client: NodeClient,\n options: AdditionalOpenTelemetryOptions = {},\n): [OpenTelemetryTracerProvider | undefined, AsyncLocalStorageLookup | undefined] {\n // Sentry's minimal tracer provider is the default. We fall back to the full OpenTelemetry SDK\n // `BasicTracerProvider` when the user explicitly opts in via `openTelemetryBasicTracerProvider`, or\n // when they provide custom `openTelemetrySpanProcessors` — those require the SDK span pipeline\n // that the minimal provider does not run.\n const shouldUseBasicTracerProvider =\n client.getOptions().openTelemetryBasicTracerProvider || !!options.spanProcessors?.length;\n\n if (!shouldUseBasicTracerProvider) {\n return setupSentryTracerProvider(client);\n }\n\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: getSentryResource('node'),\n forceFlushTimeoutMillis: 500,\n spanProcessors: [\n new SentrySpanProcessor({\n timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),\n client,\n }),\n ...(options.spanProcessors || []),\n ],\n });\n\n // Register as globals\n registerGlobalTracerProvider(provider);\n propagation.setGlobalPropagator(new SentryPropagator());\n\n const ctxManager = new SentryContextManager();\n context.setGlobalContextManager(ctxManager);\n\n return [provider, ctxManager.getAsyncLocalStorageLookup()];\n}\n\nfunction setupSentryTracerProvider(\n client: NodeClient,\n): [SentryTracerProvider | undefined, AsyncLocalStorageLookup | undefined] {\n const provider = new SentryTracerProvider({ resource: getSentryResource('node') });\n\n if (!registerGlobalTracerProvider(provider)) {\n DEBUG_BUILD &&\n coreDebug.warn(\n 'Could not register SentryTracerProvider because another OpenTelemetry tracer provider is already registered.',\n );\n return [undefined, undefined];\n }\n\n // Only mark the provider as set up once it is actually the registered global\n // tracer provider, so setup validation doesn't skip required checks when\n // registration failed.\n setIsSetup('SentryTracerProvider');\n\n propagation.setGlobalPropagator(new SentryPropagator());\n\n const ctxManager = new SentryContextManager();\n context.setGlobalContextManager(ctxManager);\n\n client.on('spanEnd', span => {\n applyOtelSpanData(span, { finalizeStatus: true });\n });\n\n if (hasSpanStreamingEnabled(client)) {\n // Streamed spans skip the exporter, so per-span data inferred from OTel semantic conventions\n // (notably `sentry.source` on child spans, which `applyOtelSpanData` only sets on segment roots)\n // is backfilled here, reusing the exact inference the OTel SDK `SentrySpanProcessor` applies.\n client.on('preprocessSpan', backfillStreamedSpanDataFromOtel);\n }\n\n client.on('preprocessEvent', event => {\n if (event.type !== 'transaction') {\n return;\n }\n\n event.contexts = {\n ...event.contexts,\n otel: {\n resource: provider.resource?.attributes,\n ...event.contexts?.otel,\n },\n };\n });\n\n return [provider, ctxManager.getAsyncLocalStorageLookup()];\n}\n\n/** Just exported for tests. */\nexport function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined {\n if (maxSpanWaitDuration == null) {\n return undefined;\n }\n\n // We guard for a max. value here, because we create an array with this length\n // So if this value is too large, this would fail\n if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) {\n DEBUG_BUILD &&\n coreDebug.warn(`\\`maxSpanWaitDuration\\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`);\n return MAX_MAX_SPAN_WAIT_DURATION;\n } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) {\n DEBUG_BUILD && coreDebug.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.');\n return undefined;\n }\n\n return maxSpanWaitDuration;\n}\n"],"names":["coreDebug","debug"],"mappings":";;;;;;;;AA2BA,MAAM,0BAAA,GAA6B,GAAA;AAGnC,MAAM,mBAAA,mBAAsB,MAAA,CAAO,GAAA,CAAI,wBAAwB,CAAA;AAoB/D,SAAS,6BAA6B,QAAA,EAAmC;AACvE,EAAA,IAAI,KAAA,CAAM,uBAAA,CAAwB,QAAQ,CAAA,EAAG;AAC3C,IAAA,OAAO,IAAA;AAAA,EACT;AAIA,EAAA,MAAM,UAAA,GAAa,UAAA;AACnB,EAAA,MAAM,QAAA,GAAW,WAAW,mBAAmB,CAAA;AAC/C,EAAA,IAAI,QAAA,IAAY,CAAC,QAAA,CAAS,KAAA,EAAO;AAC/B,IAAA,WAAA,IACEA,KAAA,CAAU,IAAA;AAAA,MACR;AAAA,KACF;AACF,IAAA,UAAA,CAAW,mBAAmB,CAAA,GAAI,MAAA;AAElC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AAA,EAAU,SAAS,QAAA,EAAU,UAAA;AAAA,QAC7B,GAAG,MAAM,QAAA,EAAU;AAAA;AACrB,KACF;AAAA,EACF,CAAC,CAAA;AAED,EAAA,OAAO,CAAC,QAAA,EAAU,UAAA,CAAW,0BAAA,EAA4B,CAAA;AAC3D;AAGO,SAAS,2BAA2B,mBAAA,EAA6D;AACtG,EAAA,IAAI,uBAAuB,IAAA,EAAM;AAC/B,IAAA,OAAO,MAAA;AAAA,EACT;AAIA,EAAA,IAAI,sBAAsB,0BAAA,EAA4B;AACpD,IAAA,WAAA,IACEA,KAAA,CAAU,IAAA,CAAK,CAAA,gEAAA,EAAmE,0BAA0B,CAAA,CAAE,CAAA;AAChH,IAAA,OAAO,0BAAA;AAAA,EACT,WAAW,mBAAA,IAAuB,CAAA,IAAK,MAAA,CAAO,KAAA,CAAM,mBAAmB,CAAA,EAAG;AACxE,IAAA,WAAA,IAAeA,KAAA,CAAU,KAAK,+EAA+E,CAAA;AAC7G,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAO,mBAAA;AACT;;;;"}
@@ -13,7 +13,7 @@ export { mysql2Integration } from './integrations/tracing/mysql2';
13
13
  export { redisIntegration } from './integrations/tracing/redis';
14
14
  export { postgresIntegration } from './integrations/tracing/postgres';
15
15
  export { postgresJsIntegration } from './integrations/tracing/postgresjs';
16
- export { prismaIntegration } from './integrations/tracing/prisma';
16
+ export { prismaIntegration } from '@sentry/server-utils';
17
17
  export { hapiIntegration, setupHapiErrorHandler } from './integrations/tracing/hapi';
18
18
  export { honoIntegration, setupHonoErrorHandler } from './integrations/tracing/hono';
19
19
  export { koaIntegration, setupKoaErrorHandler } from './integrations/tracing/koa';
@@ -31,8 +31,9 @@ export { langChainIntegration } from './integrations/tracing/langchain';
31
31
  export { langGraphIntegration } from './integrations/tracing/langgraph';
32
32
  export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, growthbookIntegration, } from './integrations/featureFlagShims';
33
33
  export { firebaseIntegration } from './integrations/tracing/firebase';
34
- export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, } from './sdk';
34
+ export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, applyDiagnosticsChannelInjectionIntegrations, } from './sdk';
35
35
  export { experimentalUseDiagnosticsChannelInjection, diagnosticsChannelInjectionIntegrations, } from './sdk/experimentalUseDiagnosticsChannelInjection';
36
+ export { isDiagnosticsChannelInjectionEnabled } from './sdk/diagnosticsChannelInjection';
36
37
  export { initOpenTelemetry, preloadOpenTelemetry } from './sdk/initOtel';
37
38
  export { getAutoPerformanceIntegrations } from './integrations/tracing';
38
39
  export type { NodeOptions } from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACnH,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EA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ACT,UAAU,EACV,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,GAAG,EACH,gBAAgB,EAChB,uBAAuB,EACvB,kCAAkC,EAClC,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,MAAM,EACN,OAAO,EACP,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,8BAA8B,EAC9B,+BAA+B,EAE/B,cAAc,EAEd,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,6BAA6B,EAC7B,KAAK,yBAAyB,EAC9B,kBAAkB,EAClB,eAAe,EACf,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,iBAAiB,EACjB,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,0BAA0B,EAC1B,gBAAgB,EAChB,qCAAqC,GACtC,MAAM,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/dataloader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAOvE,eAAO,MAAM,oBAAoB;;CAAkF,CAAC;AAWpH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB;;CAA4C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/dataloader/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAIvE,eAAO,MAAM,oBAAoB;;CAAkF,CAAC;AAmBpH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB;;CAA4C,CAAC"}
@@ -1 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AAM,CAAC,CAAC;AAsD9D,wBAAgB,qBAAqB,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAgDpG;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,KAAK,CAAC,iBAAiB,GAAG,WAAW,CAAC,EAC5C,SAAS,EAAE,MAAM,kCAAkC,GAClD,IAAI,CA4BN;AAgDD,wBAAgB,iBAAiB,CAAC,OAAO,GAAG,GAAG,EAAE,QAAQ,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,EAC1E,SAAS,EAAE,MAAM,kCAAkC,EACnD,aAAa,EAAE,KAAK,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC,EAClF,iBAAiB,UAAQ,GACxB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,GAAG,qBAAqB,EAAE,KAAK,CAAC,GAAG,WAAW,CAqEtF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/knex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAOjE,eAAO,MAAM,cAAc;;CAA4E,CAAC;AAWxG;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe;;CAAsC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/knex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAQjE,eAAO,MAAM,cAAc;;CAA4E,CAAC;AAkBxG;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe;;CAAsC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/koa/vendored/utils.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,KAAK,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,eAAO,MAAM,qBAAqB,GAChC,SAAS,UAAU,EACnB,OAAO,aAAa,EACpB,UAAU,OAAO,EACjB,YAAY,MAAM,GAAG,MAAM,KAC1B;IACD,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CAoBd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,YAAY,EAAE,SAAS,wBAAwB,KAAG,OAEtF,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/koa/vendored/utils.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,KAAK,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,eAAO,MAAM,qBAAqB,GAChC,SAAS,UAAU,EACnB,OAAO,aAAa,EACpB,UAAU,OAAO,EACjB,YAAY,MAAM,GAAG,MAAM,KAC1B;IACD,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CAqBd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,YAAY,EAAE,SAAS,wBAAwB,KAAG,OAEtF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"patches.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongo/vendored/patches.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,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M,OAAO,EACb,QAAQ,qBAAqB,EAC7B,IAAI,MAAM,EACV,aAAa,WAAW,EACxB,WAAW,MAAM,EACjB,SAAS,OAAO,GAAG,QAAQ,EAC3B,WAAW,QAAQ,SAuBxB;AAGD,wBAAgB,2BAA2B,KACjC,UAAU,gBAAgB,CAAC,UAAU,CAAC,MACZ,MAAM,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,KAAK,IAAI,SASjG"}
1
+ {"version":3,"file":"patches.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongo/vendored/patches.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAU1B,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,IACvE,UAAU,oBAAoB,CAAC,OAAO,aAAa,CAAC,MAExD,MAAM,OAAO,EACb,QAAQ,qBAAqB,EAC7B,IAAI,MAAM,EACV,KAAK,OAAO,EAAE,EACd,SAAS,OAAO,GAAG,QAAQ,EAC3B,WAAW,QAAQ,SAsBxB;AAED,kDAAkD;AAClD,wBAAgB,iBAAiB,KACvB,UAAU,oBAAoB,CAAC,SAAS,CAAC,MAE7C,MAAM,OAAO,EACb,QAAQ,qBAAqB,EAC7B,IAAI,MAAM,EACV,KAAK,oBAAoB,EACzB,SAAS,OAAO,GAAG,QAAQ,EAC3B,WAAW,QAAQ,SAwBxB;AAED,wEAAwE;AACxE,wBAAgB,yBAAyB,KAC/B,UAAU,YAAY,CAAC,iBAAiB,CAAC,MAE7C,MAAM,GAAG,EACT,IAAI,gBAAgB,EACpB,KAAK,GAAG,EACR,SAAS,SAAS,GAAG,OAAO,EAC5B,UAAU,GAAG,SAkBlB;AAED,wEAAwE;AACxE,wBAAgB,wBAAwB,KAC9B,UAAU,YAAY,CAAC,gBAAgB,CAAC,MACP,MAAM,GAAG,EAAE,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,SAyBxG;AAED,+CAA+C;AAC/C,wBAAgB,cAAc,KACpB,UAAU,oBAAoB,CAAC,OAAO,CAAC,MAE3C,MAAM,OAAO,EACb,QAAQ,qBAAqB,EAC7B,IAAI,MAAM,EACV,KAAK,oBAAoB,EACzB,aAAa,WAAW,EACxB,SAAS,OAAO,GAAG,QAAQ,EAC3B,WAAW,QAAQ,SAuBxB;AAED,2DAA2D;AAC3D,wBAAgB,gBAAgB,KACtB,UAAU,oBAAoB,CAAC,SAAS,CAAC,MAE7C,MAAM,OAAO,EACb,QAAQ,qBAAqB,EAC7B,IAAI,MAAM,EACV,aAAa,WAAW,EACxB,WAAW,MAAM,EACjB,SAAS,OAAO,GAAG,QAAQ,EAC3B,WAAW,QAAQ,SAuBxB;AAGD,wBAAgB,2BAA2B,KACjC,UAAU,gBAAgB,CAAC,UAAU,CAAC,MACZ,MAAM,OAAO,EAAE,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,KAAK,IAAI,SASjG"}
@@ -1,19 +1,10 @@
1
1
  import type { Span, SpanAttributes } from '@sentry/core';
2
- import type { MongodbNamespace, MongoInternalCommand, MongoInternalTopology } from './internal-types';
3
- import { MongodbCommandType } from './internal-types';
4
- /**
5
- * Get the mongodb command type from the object.
6
- */
7
- export declare function getCommandType(command: MongoInternalCommand): MongodbCommandType;
8
- /**
9
- * Determine a span's attributes by fetching related metadata from the v4 connection context.
10
- */
11
- export declare function getV4SpanAttributes(connectionCtx: any, ns: MongodbNamespace, command?: any, operation?: string): SpanAttributes;
12
- /**
13
- * Determine a span's attributes by fetching related metadata from the v3 topology.
14
- */
15
- export declare function getV3SpanAttributes(ns: string, topology: MongoInternalTopology, command?: MongoInternalCommand, operation?: string | undefined): SpanAttributes;
16
- export declare function startMongoSpan(attributes: SpanAttributes): Span;
2
+ import { getV3CommandOperation, startMongoSpan } from '@sentry/server-utils';
3
+ export { getV3CommandOperation, startMongoSpan };
4
+ /** Determine a span's attributes from the v4 connection context (OTel origin). */
5
+ export declare function getV4SpanAttributes(connectionCtx: any, ns: any, command?: any, operation?: string): SpanAttributes;
6
+ /** Determine a span's attributes from the v3 topology (OTel origin). */
7
+ export declare function getV3SpanAttributes(ns: string, topology: any, command?: any, operation?: string): SpanAttributes;
17
8
  /**
18
9
  * Wraps the result handler so it ends the span (with error status on failure) and runs the
19
10
  * original callback re-activated under the parent span — mongodb loses the async context when
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongo/vendored/utils.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAmBzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA4CtD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,kBAAkB,CAchF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,GAAG,EAClB,EAAE,EAAE,gBAAgB,EACpB,OAAO,CAAC,EAAE,GAAG,EACb,SAAS,CAAC,EAAE,MAAM,GACjB,cAAc,CAmBhB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,CAAC,EAAE,oBAAoB,EAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAC7B,cAAc,CAwBhB;AA8CD,wBAAgB,cAAc,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI,CAO/D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,aAAa,EAAE,QAAQ,GAAG,QAAQ,CAkBlF;AAID,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongo/vendored/utils.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EACL,qBAAqB,EAGrB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,CAAC;AAEjD,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CAElH;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,CAEhH;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,aAAa,EAAE,QAAQ,GAAG,QAAQ,CAkBlF;AAID,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD"}
@@ -13,7 +13,6 @@ export declare class MongooseInstrumentation extends InstrumentationBase<Instrum
13
13
  private patchModelStatic;
14
14
  private patchModelAggregate;
15
15
  private patchAndCaptureSpanContext;
16
- private _startSpan;
17
16
  private _handleResponse;
18
17
  }
19
18
  //# sourceMappingURL=mongoose.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongoose.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/mongoose.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,qBAAqB,EAC1B,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mBAAmB;IAW3B,OAAO,CAAC,0BAA0B;IASlC,OAAO,CAAC,eAAe;CAaxB"}
@@ -1,6 +1,4 @@
1
- import type { Span, SpanAttributes } from '@sentry/core';
2
- import type { Collection } from './mongoose-types';
3
- export declare function getAttributesFromCollection(collection: Collection): SpanAttributes;
1
+ import type { Span } from '@sentry/core';
4
2
  export declare function handlePromiseResponse(execResponse: any, span: Span): any;
5
3
  export declare function handleCallbackResponse(callback: Function, exec: Function, originalThis: any, span: Span, args: IArguments): any;
6
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/utils.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AAGlE,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,CAYlF;AASD,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,CAYxE;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,GAAG,EACjB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,UAAU,OAmBjB"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/utils.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAWzC,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,CAYxE;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,GAAG,EACjB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,UAAU,OAmBjB"}
@@ -1,4 +1,5 @@
1
1
  import { channelIntegrations } from '@sentry/server-utils/orchestrion';
2
+ import type { RegisterDiagnosticsChannelInjectionOptions } from '@sentry/server-utils/orchestrion/register';
2
3
  export declare function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations;
3
4
  /**
4
5
  * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.
@@ -32,5 +33,5 @@ export declare function diagnosticsChannelInjectionIntegrations(): typeof channe
32
33
  *
33
34
  * @experimental May change or be removed in any release.
34
35
  */
35
- export declare function experimentalUseDiagnosticsChannelInjection(): void;
36
+ export declare function experimentalUseDiagnosticsChannelInjection(options?: RegisterDiagnosticsChannelInjectionOptions): void;
36
37
  //# sourceMappingURL=experimentalUseDiagnosticsChannelInjection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.d.ts","sourceRoot":"","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAIpB,MAAM,kCAAkC,CAAC;AAM1C,wBAAgB,uCAAuC,IAAI,OAAO,mBAAmB,CAEpF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,0CAA0C,IAAI,IAAI,CAoBjE"}
1
+ {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.d.ts","sourceRoot":"","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAIpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,2CAA2C,CAAC;AAM5G,wBAAgB,uCAAuC,IAAI,OAAO,mBAAmB,CAEpF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,0CAA0C,CAIxD,OAAO,CAAC,EAAE,0CAA0C,GACnD,IAAI,CAwBN"}
@@ -7,6 +7,24 @@ import type { NodeOptions } from '../types';
7
7
  export declare function getDefaultIntegrationsWithoutPerformance(): Integration[];
8
8
  /** Get the default integrations for the Node SDK. */
9
9
  export declare function getDefaultIntegrations(options: Options): Integration[];
10
+ /**
11
+ * When the app opted into diagnostics-channel injection (via
12
+ * `experimentalUseDiagnosticsChannelInjection()`) AND span recording is enabled, drop the OTel
13
+ * integrations that have a channel-based replacement and append the FULL channel-integration set,
14
+ * so the two never both instrument the same library. Otherwise returns `integrations` unchanged.
15
+ *
16
+ * `_init` applies the same swap to `defaultIntegrations`, but SDKs that seed their integrations
17
+ * through the user `integrations` option instead (e.g. the `@sentry/aws-serverless` Lambda layer
18
+ * entry) never hit that path, so they call this directly from their own `getDefaultIntegrations`.
19
+ *
20
+ * Note the asymmetry: appended channel integrations are not limited to ones whose OTel counterpart
21
+ * was in `integrations`. For `@sentry/node` that makes no difference (the incoming list carries the
22
+ * whole OTel performance set), but a caller with a narrower list (e.g. `@sentry/aws-serverless`)
23
+ * gains channel coverage for libraries it never shipped OTel integrations for. Channel integrations
24
+ * produce nothing but spans, so this is gated on span recording. Exported so SDKs that build their
25
+ * own default-integration set can apply the same logic instead of duplicating it.
26
+ */
27
+ export declare function applyDiagnosticsChannelInjectionIntegrations(integrations: Integration[], options: Options): Integration[];
10
28
  /**
11
29
  * Initialize Sentry for Node.
12
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AASpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAO5C;;GAEG;AACH,wBAAgB,wCAAwC,IAAI,WAAW,EAAE,CAOxE;AAED,qDAAqD;AACrD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CA2BtE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,GAAG,SAAS,CAElF;AAkDD;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,GAAG,SAAS,CAE5G"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AASpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAO5C;;GAEG;AACH,wBAAgB,wCAAwC,IAAI,WAAW,EAAE,CAOxE;AAED,qDAAqD;AACrD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CAStE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4CAA4C,CAC1D,YAAY,EAAE,WAAW,EAAE,EAC3B,OAAO,EAAE,OAAO,GACf,WAAW,EAAE,CASf;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,GAAG,SAAS,CAElF;AAsED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,GAAG,SAAS,CAE5G"}
@@ -1 +1 @@
1
- {"version":3,"file":"initOtel.d.ts","sourceRoot":"","sources":["../../../src/sdk/initOtel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,uBAAuB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YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAiB3E;AAgBD,+BAA+B;AAC/B,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,8BAAmC,GAC3C,CAAC,2BAA2B,GAAG,SAAS,EAAE,uBAAuB,GAAG,SAAS,CAAC,CAkChF;AAqDD,+BAA+B;AAC/B,wBAAgB,0BAA0B,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAiBtG"}
@@ -13,7 +13,7 @@ export { mysql2Integration } from './integrations/tracing/mysql2';
13
13
  export { redisIntegration } from './integrations/tracing/redis';
14
14
  export { postgresIntegration } from './integrations/tracing/postgres';
15
15
  export { postgresJsIntegration } from './integrations/tracing/postgresjs';
16
- export { prismaIntegration } from './integrations/tracing/prisma';
16
+ export { prismaIntegration } from '@sentry/server-utils';
17
17
  export { hapiIntegration, setupHapiErrorHandler } from './integrations/tracing/hapi';
18
18
  export { honoIntegration, setupHonoErrorHandler } from './integrations/tracing/hono';
19
19
  export { koaIntegration, setupKoaErrorHandler } from './integrations/tracing/koa';
@@ -31,8 +31,9 @@ export { langChainIntegration } from './integrations/tracing/langchain';
31
31
  export { langGraphIntegration } from './integrations/tracing/langgraph';
32
32
  export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, growthbookIntegration, } from './integrations/featureFlagShims';
33
33
  export { firebaseIntegration } from './integrations/tracing/firebase';
34
- export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, } from './sdk';
34
+ export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, applyDiagnosticsChannelInjectionIntegrations, } from './sdk';
35
35
  export { experimentalUseDiagnosticsChannelInjection, diagnosticsChannelInjectionIntegrations, } from './sdk/experimentalUseDiagnosticsChannelInjection';
36
+ export { isDiagnosticsChannelInjectionEnabled } from './sdk/diagnosticsChannelInjection';
36
37
  export { initOpenTelemetry, preloadOpenTelemetry } from './sdk/initOtel';
37
38
  export { getAutoPerformanceIntegrations } from './integrations/tracing';
38
39
  export { NodeOptions } from './types';
@@ -1,19 +1,10 @@
1
1
  import { Span, SpanAttributes } from '@sentry/core';
2
- import { MongodbNamespace, MongoInternalCommand, MongoInternalTopology } from './internal-types';
3
- import { MongodbCommandType } from './internal-types';
4
- /**
5
- * Get the mongodb command type from the object.
6
- */
7
- export declare function getCommandType(command: MongoInternalCommand): MongodbCommandType;
8
- /**
9
- * Determine a span's attributes by fetching related metadata from the v4 connection context.
10
- */
11
- export declare function getV4SpanAttributes(connectionCtx: any, ns: MongodbNamespace, command?: any, operation?: string): SpanAttributes;
12
- /**
13
- * Determine a span's attributes by fetching related metadata from the v3 topology.
14
- */
15
- export declare function getV3SpanAttributes(ns: string, topology: MongoInternalTopology, command?: MongoInternalCommand, operation?: string | undefined): SpanAttributes;
16
- export declare function startMongoSpan(attributes: SpanAttributes): Span;
2
+ import { getV3CommandOperation, startMongoSpan } from '@sentry/server-utils';
3
+ export { getV3CommandOperation, startMongoSpan };
4
+ /** Determine a span's attributes from the v4 connection context (OTel origin). */
5
+ export declare function getV4SpanAttributes(connectionCtx: any, ns: any, command?: any, operation?: string): SpanAttributes;
6
+ /** Determine a span's attributes from the v3 topology (OTel origin). */
7
+ export declare function getV3SpanAttributes(ns: string, topology: any, command?: any, operation?: string): SpanAttributes;
17
8
  /**
18
9
  * Wraps the result handler so it ends the span (with error status on failure) and runs the
19
10
  * original callback re-activated under the parent span — mongodb loses the async context when
@@ -13,7 +13,6 @@ export declare class MongooseInstrumentation extends InstrumentationBase<Instrum
13
13
  private patchModelStatic;
14
14
  private patchModelAggregate;
15
15
  private patchAndCaptureSpanContext;
16
- private _startSpan;
17
16
  private _handleResponse;
18
17
  }
19
18
  //# sourceMappingURL=mongoose.d.ts.map
@@ -1,6 +1,4 @@
1
- import { Span, SpanAttributes } from '@sentry/core';
2
- import { Collection } from './mongoose-types';
3
- export declare function getAttributesFromCollection(collection: Collection): SpanAttributes;
1
+ import { Span } from '@sentry/core';
4
2
  export declare function handlePromiseResponse(execResponse: any, span: Span): any;
5
3
  export declare function handleCallbackResponse(callback: Function, exec: Function, originalThis: any, span: Span, args: IArguments): any;
6
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { channelIntegrations } from '@sentry/server-utils/orchestrion';
2
+ import { RegisterDiagnosticsChannelInjectionOptions } from '@sentry/server-utils/orchestrion/register';
2
3
  export declare function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations;
3
4
  /**
4
5
  * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.
@@ -32,5 +33,5 @@ export declare function diagnosticsChannelInjectionIntegrations(): typeof channe
32
33
  *
33
34
  * @experimental May change or be removed in any release.
34
35
  */
35
- export declare function experimentalUseDiagnosticsChannelInjection(): void;
36
+ export declare function experimentalUseDiagnosticsChannelInjection(options?: RegisterDiagnosticsChannelInjectionOptions): void;
36
37
  //# sourceMappingURL=experimentalUseDiagnosticsChannelInjection.d.ts.map
@@ -7,6 +7,24 @@ import { NodeOptions } from '../types';
7
7
  export declare function getDefaultIntegrationsWithoutPerformance(): Integration[];
8
8
  /** Get the default integrations for the Node SDK. */
9
9
  export declare function getDefaultIntegrations(options: Options): Integration[];
10
+ /**
11
+ * When the app opted into diagnostics-channel injection (via
12
+ * `experimentalUseDiagnosticsChannelInjection()`) AND span recording is enabled, drop the OTel
13
+ * integrations that have a channel-based replacement and append the FULL channel-integration set,
14
+ * so the two never both instrument the same library. Otherwise returns `integrations` unchanged.
15
+ *
16
+ * `_init` applies the same swap to `defaultIntegrations`, but SDKs that seed their integrations
17
+ * through the user `integrations` option instead (e.g. the `@sentry/aws-serverless` Lambda layer
18
+ * entry) never hit that path, so they call this directly from their own `getDefaultIntegrations`.
19
+ *
20
+ * Note the asymmetry: appended channel integrations are not limited to ones whose OTel counterpart
21
+ * was in `integrations`. For `@sentry/node` that makes no difference (the incoming list carries the
22
+ * whole OTel performance set), but a caller with a narrower list (e.g. `@sentry/aws-serverless`)
23
+ * gains channel coverage for libraries it never shipped OTel integrations for. Channel integrations
24
+ * produce nothing but spans, so this is gated on span recording. Exported so SDKs that build their
25
+ * own default-integration set can apply the same logic instead of duplicating it.
26
+ */
27
+ export declare function applyDiagnosticsChannelInjectionIntegrations(integrations: Integration[], options: Options): Integration[];
10
28
  /**
11
29
  * Initialize Sentry for Node.
12
30
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "10.65.0",
3
+ "version": "10.67.0",
4
4
  "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -68,11 +68,11 @@
68
68
  "@opentelemetry/api": "^1.9.1",
69
69
  "@opentelemetry/instrumentation": "^0.220.0",
70
70
  "@opentelemetry/sdk-trace-base": "^2.9.0",
71
- "@sentry/conventions": "^0.15.1",
72
- "@sentry/core": "10.65.0",
73
- "@sentry/node-core": "10.65.0",
74
- "@sentry/opentelemetry": "10.65.0",
75
- "@sentry/server-utils": "10.65.0",
71
+ "@sentry/conventions": "^0.16.0",
72
+ "@sentry/core": "10.67.0",
73
+ "@sentry/node-core": "10.67.0",
74
+ "@sentry/opentelemetry": "10.67.0",
75
+ "@sentry/server-utils": "10.67.0",
76
76
  "import-in-the-middle": "^3.0.0"
77
77
  },
78
78
  "devDependencies": {
@@ -1,14 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- var MongodbCommandType = /* @__PURE__ */ ((MongodbCommandType2) => {
4
- MongodbCommandType2["CREATE_INDEXES"] = "createIndexes";
5
- MongodbCommandType2["FIND_AND_MODIFY"] = "findAndModify";
6
- MongodbCommandType2["IS_MASTER"] = "isMaster";
7
- MongodbCommandType2["COUNT"] = "count";
8
- MongodbCommandType2["AGGREGATE"] = "aggregate";
9
- MongodbCommandType2["UNKNOWN"] = "unknown";
10
- return MongodbCommandType2;
11
- })(MongodbCommandType || {});
12
-
13
- exports.MongodbCommandType = MongodbCommandType;
14
- //# sourceMappingURL=internal-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/mongo/vendored/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mongodb\n * - Upstream version: @opentelemetry/instrumentation-mongodb@0.71.0\n * - Trimmed to the driver-internal types actually used by the instrumentation\n */\n\nexport type MongoInternalCommand = {\n findandmodify: boolean;\n createIndexes: boolean;\n count: boolean;\n aggregate: boolean;\n ismaster: boolean;\n indexes?: unknown[];\n query?: Record<string, unknown>;\n limit?: number;\n q?: Record<string, unknown>;\n u?: Record<string, unknown>;\n};\n\nexport type CursorState = { cmd: MongoInternalCommand } & Record<string, unknown>;\n\n// https://github.com/mongodb/node-mongodb-native/blob/3.6/lib/core/wireprotocol/index.js\nexport type WireProtocolInternal = {\n insert: (\n server: MongoInternalTopology,\n ns: string,\n ops: unknown[],\n options: unknown | Function,\n callback?: Function,\n ) => unknown;\n update: (\n server: MongoInternalTopology,\n ns: string,\n ops: unknown[],\n options: unknown | Function,\n callback?: Function,\n ) => unknown;\n remove: (\n server: MongoInternalTopology,\n ns: string,\n ops: unknown[],\n options: unknown | Function,\n callback?: Function,\n ) => unknown;\n killCursors: (server: MongoInternalTopology, ns: string, cursorState: CursorState, callback: Function) => unknown;\n getMore: (\n server: MongoInternalTopology,\n ns: string,\n cursorState: CursorState,\n batchSize: number,\n options: unknown | Function,\n callback?: Function,\n ) => unknown;\n query: (\n server: MongoInternalTopology,\n ns: string,\n cmd: MongoInternalCommand,\n cursorState: CursorState,\n options: unknown | Function,\n callback?: Function,\n ) => unknown;\n command: (\n server: MongoInternalTopology,\n ns: string,\n cmd: MongoInternalCommand,\n options: unknown | Function,\n callback?: Function,\n ) => unknown;\n};\n\n// https://github.com/mongodb/node-mongodb-native/blob/3.6/lib/topologies/server.js#L172\n// https://github.com/mongodb/node-mongodb-native/blob/2.2/lib/server.js#L174\nexport type MongoInternalTopology = {\n s?: {\n // those are for mongodb@3\n options?: {\n host?: string;\n port?: number;\n servername?: string;\n };\n // those are for mongodb@2\n host?: string;\n port?: number;\n };\n // mongodb@3 with useUnifiedTopology option\n description?: {\n address?: string;\n };\n};\n\nexport enum MongodbCommandType {\n CREATE_INDEXES = 'createIndexes',\n FIND_AND_MODIFY = 'findAndModify',\n IS_MASTER = 'isMaster',\n COUNT = 'count',\n AGGREGATE = 'aggregate',\n UNKNOWN = 'unknown',\n}\n\n// https://github.com/mongodb/js-bson/blob/main/src/bson.ts\nexport type Document = {\n [key: string]: any;\n};\n\n// https://github.com/mongodb/node-mongodb-native/blob/v6.4.0/src/utils.ts#L281\nexport interface MongodbNamespace {\n db: string;\n collection?: string;\n}\n\nexport type V4Connection = {\n command: Function;\n // From version 6.4.0 the method does not expect a callback and returns a promise\n // https://github.com/mongodb/node-mongodb-native/blob/v6.4.2/src/cmap/connection.ts\n commandPromise(\n ns: MongodbNamespace,\n cmd: Document,\n options: undefined | unknown,\n // From v6.6.0 we have this new param which is a constructor function\n // https://github.com/mongodb/node-mongodb-native/blob/v6.6.0/src/cmap/connection.ts#L588\n responseType: undefined | unknown,\n ): Promise<any>;\n // Earlier versions expect a callback param and return void\n // https://github.com/mongodb/node-mongodb-native/blob/v4.2.2/src/cmap/connection.ts\n commandCallback(ns: MongodbNamespace, cmd: Document, options: undefined | unknown, callback: any): void;\n};\n\n// https://github.com/mongodb/node-mongodb-native/blob/v4.2.2/src/cmap/connection_pool.ts\nexport type V4ConnectionPool = {\n // Instrumentation just cares about carrying the async context so\n // types of callback params are not needed\n checkOut: (callback: (error: any, connection: any) => void) => void;\n};\n"],"names":["MongodbCommandType"],"mappings":";;AA8FO,IAAK,kBAAA,qBAAAA,mBAAAA,KAAL;AACL,EAAAA,oBAAA,gBAAA,CAAA,GAAiB,eAAA;AACjB,EAAAA,oBAAA,iBAAA,CAAA,GAAkB,eAAA;AAClB,EAAAA,oBAAA,WAAA,CAAA,GAAY,UAAA;AACZ,EAAAA,oBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,oBAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,oBAAA,SAAA,CAAA,GAAU,SAAA;AANA,EAAA,OAAAA,mBAAAA;AAAA,CAAA,EAAA,kBAAA,IAAA,EAAA;;;;"}
@@ -1,10 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const ATTR_DB_CONNECTION_STRING = "db.connection_string";
4
- const ATTR_DB_MONGODB_COLLECTION = "db.mongodb.collection";
5
- const DB_SYSTEM_VALUE_MONGODB = "mongodb";
6
-
7
- exports.ATTR_DB_CONNECTION_STRING = ATTR_DB_CONNECTION_STRING;
8
- exports.ATTR_DB_MONGODB_COLLECTION = ATTR_DB_MONGODB_COLLECTION;
9
- exports.DB_SYSTEM_VALUE_MONGODB = DB_SYSTEM_VALUE_MONGODB;
10
- //# sourceMappingURL=semconv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/mongo/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mongodb\n * - Upstream version: @opentelemetry/instrumentation-mongodb@0.71.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Deprecated, use `server.address`, `server.port` attributes instead.\n *\n * @deprecated Replaced by `server.address` and `server.port`.\n */\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\n\n/**\n * Deprecated, use `db.collection.name` instead.\n *\n * @deprecated Replaced by `db.collection.name`.\n */\nexport const ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection' as const;\n\n/**\n * Enum value \"mongodb\" for attribute `db.system`.\n */\nexport const DB_SYSTEM_VALUE_MONGODB = 'mongodb' as const;\n"],"names":[],"mappings":";;AAoBO,MAAM,yBAAA,GAA4B;AAOlC,MAAM,0BAAA,GAA6B;AAKnC,MAAM,uBAAA,GAA0B;;;;;;"}
@@ -1,6 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const ATTR_DB_MONGODB_COLLECTION = "db.mongodb.collection";
4
-
5
- exports.ATTR_DB_MONGODB_COLLECTION = ATTR_DB_MONGODB_COLLECTION;
6
- //# sourceMappingURL=semconv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mongoose\n * - Upstream version: @opentelemetry/instrumentation-mongoose@0.64.0\n */\n\n/**\n * Deprecated, use `db.collection.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.collection.name`.\n */\nexport const ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection' as const;\n"],"names":[],"mappings":";;AAgBO,MAAM,0BAAA,GAA6B;;;;"}
@@ -1,109 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const nodeCore = require('@sentry/node-core');
5
- const debugBuild = require('../../../debug-build.js');
6
- const instrumentation = require('./vendored/instrumentation.js');
7
-
8
- const INTEGRATION_NAME = "Prisma";
9
- function isPrismaV6TracingHelper(helper) {
10
- return !!helper && typeof helper === "object" && "dispatchEngineSpans" in helper;
11
- }
12
- function getPrismaTracingHelper() {
13
- const prismaInstrumentationObject = globalThis.PRISMA_INSTRUMENTATION;
14
- const prismaTracingHelper = prismaInstrumentationObject && typeof prismaInstrumentationObject === "object" && "helper" in prismaInstrumentationObject ? prismaInstrumentationObject.helper : void 0;
15
- return prismaTracingHelper;
16
- }
17
- const MAX_TRACKED_PRISMA_SPANS = 1e3;
18
- const prismaSpanRegistry = new core.LRUMap(MAX_TRACKED_PRISMA_SPANS);
19
- const pendingEngineSpans = [];
20
- function registerPrismaSpan(id, span) {
21
- prismaSpanRegistry.set(id, span);
22
- }
23
- function createResolvedEngineSpans() {
24
- let createdSpan = true;
25
- while (createdSpan) {
26
- createdSpan = false;
27
- for (let i = pendingEngineSpans.length - 1; i >= 0; i--) {
28
- const engineSpan = pendingEngineSpans[i];
29
- const parentSpan = prismaSpanRegistry.get(engineSpan.parent_span_id);
30
- if (!parentSpan) {
31
- continue;
32
- }
33
- const span = core.startInactiveSpan({
34
- name: engineSpan.name,
35
- attributes: engineSpan.attributes,
36
- kind: engineSpan.kind === "client" ? core.SPAN_KIND.CLIENT : core.SPAN_KIND.INTERNAL,
37
- startTime: engineSpan.start_time,
38
- parentSpan
39
- });
40
- registerPrismaSpan(engineSpan.span_id, span);
41
- if (engineSpan.links) {
42
- span.addLinks(
43
- engineSpan.links.flatMap((link) => {
44
- const linkedSpan = prismaSpanRegistry.get(link.span_id);
45
- return linkedSpan ? [{ context: linkedSpan.spanContext() }] : [];
46
- })
47
- );
48
- }
49
- span.end(engineSpan.end_time);
50
- pendingEngineSpans.splice(i, 1);
51
- createdSpan = true;
52
- }
53
- }
54
- }
55
- class SentryPrismaInteropInstrumentation extends instrumentation.PrismaInstrumentation {
56
- constructor(options) {
57
- super(options?.instrumentationConfig);
58
- }
59
- enable() {
60
- super.enable();
61
- const prismaTracingHelper = getPrismaTracingHelper();
62
- if (isPrismaV6TracingHelper(prismaTracingHelper)) {
63
- prismaTracingHelper.createEngineSpan = (engineSpanEvent) => {
64
- pendingEngineSpans.push(...engineSpanEvent.spans);
65
- createResolvedEngineSpans();
66
- const overflow = pendingEngineSpans.length - MAX_TRACKED_PRISMA_SPANS;
67
- if (overflow > 0) {
68
- debugBuild.DEBUG_BUILD && core.debug.log(`[Prisma] Dropping ${overflow} unresolved v5 engine span(s) whose parent was never registered.`);
69
- pendingEngineSpans.splice(0, overflow);
70
- }
71
- };
72
- }
73
- }
74
- }
75
- const instrumentPrisma = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, (options) => {
76
- return new SentryPrismaInteropInstrumentation(options);
77
- });
78
- const prismaIntegration = core.defineIntegration((options) => {
79
- return {
80
- name: INTEGRATION_NAME,
81
- setupOnce() {
82
- instrumentPrisma(options);
83
- },
84
- setup(client) {
85
- if (!getPrismaTracingHelper()) {
86
- return;
87
- }
88
- client.on("spanStart", (span) => {
89
- const spanJSON = core.spanToJSON(span);
90
- if (spanJSON.description?.startsWith("prisma:")) {
91
- span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto.db.otel.prisma");
92
- if (spanJSON.description.startsWith("prisma:client:")) {
93
- registerPrismaSpan(span.spanContext().spanId, span);
94
- }
95
- }
96
- if ((spanJSON.description === "prisma:engine:db_query" || spanJSON.description === "prisma:client:db_query") && spanJSON.data["db.query.text"]) {
97
- span.updateName(spanJSON.data["db.query.text"]);
98
- }
99
- if (spanJSON.description === "prisma:engine:db_query" && !spanJSON.data["db.system"]) {
100
- span.setAttribute("db.system", "prisma");
101
- }
102
- });
103
- }
104
- };
105
- });
106
-
107
- exports.instrumentPrisma = instrumentPrisma;
108
- exports.prismaIntegration = prismaIntegration;
109
- //# sourceMappingURL=index.js.map