@sentry/node 8.3.0 → 8.5.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 (173) hide show
  1. package/cjs/index.js +14 -9
  2. package/cjs/index.js.map +1 -1
  3. package/cjs/init.js +2 -2
  4. package/cjs/init.js.map +1 -1
  5. package/cjs/integrations/anr/index.js +2 -2
  6. package/cjs/integrations/anr/index.js.map +1 -1
  7. package/cjs/integrations/http.js +121 -97
  8. package/cjs/integrations/http.js.map +1 -1
  9. package/cjs/integrations/local-variables/local-variables-async.js +2 -2
  10. package/cjs/integrations/local-variables/local-variables-async.js.map +1 -1
  11. package/cjs/integrations/local-variables/local-variables-sync.js +114 -109
  12. package/cjs/integrations/local-variables/local-variables-sync.js.map +1 -1
  13. package/cjs/integrations/tracing/connect.js +8 -3
  14. package/cjs/integrations/tracing/connect.js.map +1 -1
  15. package/cjs/integrations/tracing/express.js +44 -37
  16. package/cjs/integrations/tracing/express.js.map +1 -1
  17. package/cjs/integrations/tracing/fastify.js +16 -9
  18. package/cjs/integrations/tracing/fastify.js.map +1 -1
  19. package/cjs/integrations/tracing/graphql.js +24 -16
  20. package/cjs/integrations/tracing/graphql.js.map +1 -1
  21. package/cjs/integrations/tracing/hapi/index.js +8 -3
  22. package/cjs/integrations/tracing/hapi/index.js.map +1 -1
  23. package/cjs/integrations/tracing/index.js +25 -0
  24. package/cjs/integrations/tracing/index.js.map +1 -1
  25. package/cjs/integrations/tracing/koa.js +45 -39
  26. package/cjs/integrations/tracing/koa.js.map +1 -1
  27. package/cjs/integrations/tracing/mongo.js +16 -9
  28. package/cjs/integrations/tracing/mongo.js.map +1 -1
  29. package/cjs/integrations/tracing/mongoose.js +16 -9
  30. package/cjs/integrations/tracing/mongoose.js.map +1 -1
  31. package/cjs/integrations/tracing/mysql.js +8 -3
  32. package/cjs/integrations/tracing/mysql.js.map +1 -1
  33. package/cjs/integrations/tracing/mysql2.js +16 -9
  34. package/cjs/integrations/tracing/mysql2.js.map +1 -1
  35. package/cjs/integrations/tracing/nest.js +8 -3
  36. package/cjs/integrations/tracing/nest.js.map +1 -1
  37. package/cjs/integrations/tracing/postgres.js +17 -10
  38. package/cjs/integrations/tracing/postgres.js.map +1 -1
  39. package/cjs/integrations/tracing/prisma.js +16 -7
  40. package/cjs/integrations/tracing/prisma.js.map +1 -1
  41. package/cjs/integrations/tracing/redis.js +58 -47
  42. package/cjs/integrations/tracing/redis.js.map +1 -1
  43. package/cjs/otel/instrument.js +35 -0
  44. package/cjs/otel/instrument.js.map +1 -0
  45. package/cjs/preload.js +20 -0
  46. package/cjs/preload.js.map +1 -0
  47. package/cjs/sdk/{init.js → index.js} +8 -29
  48. package/cjs/sdk/index.js.map +1 -0
  49. package/cjs/sdk/initOtel.js +88 -9
  50. package/cjs/sdk/initOtel.js.map +1 -1
  51. package/esm/index.js +4 -3
  52. package/esm/index.js.map +1 -1
  53. package/esm/init.js +1 -1
  54. package/esm/init.js.map +1 -1
  55. package/esm/integrations/anr/index.js +2 -2
  56. package/esm/integrations/anr/index.js.map +1 -1
  57. package/esm/integrations/anr/worker-script.js +2 -2
  58. package/esm/integrations/http.js +123 -100
  59. package/esm/integrations/http.js.map +1 -1
  60. package/esm/integrations/local-variables/local-variables-async.js +2 -2
  61. package/esm/integrations/local-variables/local-variables-async.js.map +1 -1
  62. package/esm/integrations/local-variables/local-variables-sync.js +114 -109
  63. package/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
  64. package/esm/integrations/local-variables/worker-script.js +1 -1
  65. package/esm/integrations/tracing/connect.js +8 -4
  66. package/esm/integrations/tracing/connect.js.map +1 -1
  67. package/esm/integrations/tracing/express.js +44 -38
  68. package/esm/integrations/tracing/express.js.map +1 -1
  69. package/esm/integrations/tracing/fastify.js +16 -10
  70. package/esm/integrations/tracing/fastify.js.map +1 -1
  71. package/esm/integrations/tracing/graphql.js +24 -17
  72. package/esm/integrations/tracing/graphql.js.map +1 -1
  73. package/esm/integrations/tracing/hapi/index.js +8 -4
  74. package/esm/integrations/tracing/hapi/index.js.map +1 -1
  75. package/esm/integrations/tracing/index.js +37 -13
  76. package/esm/integrations/tracing/index.js.map +1 -1
  77. package/esm/integrations/tracing/koa.js +45 -40
  78. package/esm/integrations/tracing/koa.js.map +1 -1
  79. package/esm/integrations/tracing/mongo.js +16 -10
  80. package/esm/integrations/tracing/mongo.js.map +1 -1
  81. package/esm/integrations/tracing/mongoose.js +16 -10
  82. package/esm/integrations/tracing/mongoose.js.map +1 -1
  83. package/esm/integrations/tracing/mysql.js +8 -4
  84. package/esm/integrations/tracing/mysql.js.map +1 -1
  85. package/esm/integrations/tracing/mysql2.js +16 -10
  86. package/esm/integrations/tracing/mysql2.js.map +1 -1
  87. package/esm/integrations/tracing/nest.js +8 -4
  88. package/esm/integrations/tracing/nest.js.map +1 -1
  89. package/esm/integrations/tracing/postgres.js +17 -11
  90. package/esm/integrations/tracing/postgres.js.map +1 -1
  91. package/esm/integrations/tracing/prisma.js +16 -8
  92. package/esm/integrations/tracing/prisma.js.map +1 -1
  93. package/esm/integrations/tracing/redis.js +57 -47
  94. package/esm/integrations/tracing/redis.js.map +1 -1
  95. package/esm/otel/instrument.js +33 -0
  96. package/esm/otel/instrument.js.map +1 -0
  97. package/esm/preload.js +20 -0
  98. package/esm/preload.js.map +1 -0
  99. package/esm/sdk/{init.js → index.js} +11 -32
  100. package/esm/sdk/index.js.map +1 -0
  101. package/esm/sdk/initOtel.js +88 -12
  102. package/esm/sdk/initOtel.js.map +1 -1
  103. package/package.json +13 -5
  104. package/types/index.d.ts +4 -3
  105. package/types/index.d.ts.map +1 -1
  106. package/types/integrations/anr/index.d.ts.map +1 -1
  107. package/types/integrations/http.d.ts +7 -0
  108. package/types/integrations/http.d.ts.map +1 -1
  109. package/types/integrations/local-variables/local-variables-sync.d.ts +1 -1
  110. package/types/integrations/local-variables/local-variables-sync.d.ts.map +1 -1
  111. package/types/integrations/tracing/connect.d.ts +3 -0
  112. package/types/integrations/tracing/connect.d.ts.map +1 -1
  113. package/types/integrations/tracing/express.d.ts +3 -0
  114. package/types/integrations/tracing/express.d.ts.map +1 -1
  115. package/types/integrations/tracing/fastify.d.ts +3 -0
  116. package/types/integrations/tracing/fastify.d.ts.map +1 -1
  117. package/types/integrations/tracing/graphql.d.ts +4 -1
  118. package/types/integrations/tracing/graphql.d.ts.map +1 -1
  119. package/types/integrations/tracing/hapi/index.d.ts +3 -0
  120. package/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  121. package/types/integrations/tracing/index.d.ts +6 -0
  122. package/types/integrations/tracing/index.d.ts.map +1 -1
  123. package/types/integrations/tracing/koa.d.ts +3 -0
  124. package/types/integrations/tracing/koa.d.ts.map +1 -1
  125. package/types/integrations/tracing/mongo.d.ts +3 -0
  126. package/types/integrations/tracing/mongo.d.ts.map +1 -1
  127. package/types/integrations/tracing/mongoose.d.ts +3 -0
  128. package/types/integrations/tracing/mongoose.d.ts.map +1 -1
  129. package/types/integrations/tracing/mysql.d.ts +3 -0
  130. package/types/integrations/tracing/mysql.d.ts.map +1 -1
  131. package/types/integrations/tracing/mysql2.d.ts +3 -0
  132. package/types/integrations/tracing/mysql2.d.ts.map +1 -1
  133. package/types/integrations/tracing/nest.d.ts +3 -0
  134. package/types/integrations/tracing/nest.d.ts.map +1 -1
  135. package/types/integrations/tracing/postgres.d.ts +3 -0
  136. package/types/integrations/tracing/postgres.d.ts.map +1 -1
  137. package/types/integrations/tracing/prisma.d.ts +3 -0
  138. package/types/integrations/tracing/prisma.d.ts.map +1 -1
  139. package/types/integrations/tracing/redis.d.ts +3 -0
  140. package/types/integrations/tracing/redis.d.ts.map +1 -1
  141. package/types/otel/instrument.d.ts +9 -0
  142. package/types/otel/instrument.d.ts.map +1 -0
  143. package/types/preload.d.ts +2 -0
  144. package/types/preload.d.ts.map +1 -0
  145. package/types/sdk/{init.d.ts → index.d.ts} +5 -1
  146. package/types/sdk/index.d.ts.map +1 -0
  147. package/types/sdk/initOtel.d.ts +13 -0
  148. package/types/sdk/initOtel.d.ts.map +1 -1
  149. package/types-ts3.8/index.d.ts +4 -3
  150. package/types-ts3.8/integrations/http.d.ts +7 -0
  151. package/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +1 -1
  152. package/types-ts3.8/integrations/tracing/connect.d.ts +3 -0
  153. package/types-ts3.8/integrations/tracing/express.d.ts +3 -0
  154. package/types-ts3.8/integrations/tracing/fastify.d.ts +3 -0
  155. package/types-ts3.8/integrations/tracing/graphql.d.ts +4 -1
  156. package/types-ts3.8/integrations/tracing/hapi/index.d.ts +3 -0
  157. package/types-ts3.8/integrations/tracing/index.d.ts +6 -0
  158. package/types-ts3.8/integrations/tracing/koa.d.ts +3 -0
  159. package/types-ts3.8/integrations/tracing/mongo.d.ts +3 -0
  160. package/types-ts3.8/integrations/tracing/mongoose.d.ts +3 -0
  161. package/types-ts3.8/integrations/tracing/mysql.d.ts +3 -0
  162. package/types-ts3.8/integrations/tracing/mysql2.d.ts +3 -0
  163. package/types-ts3.8/integrations/tracing/nest.d.ts +3 -0
  164. package/types-ts3.8/integrations/tracing/postgres.d.ts +3 -0
  165. package/types-ts3.8/integrations/tracing/prisma.d.ts +3 -0
  166. package/types-ts3.8/integrations/tracing/redis.d.ts +3 -0
  167. package/types-ts3.8/otel/instrument.d.ts +9 -0
  168. package/types-ts3.8/preload.d.ts +2 -0
  169. package/types-ts3.8/sdk/{init.d.ts → index.d.ts} +5 -1
  170. package/types-ts3.8/sdk/initOtel.d.ts +13 -0
  171. package/cjs/sdk/init.js.map +0 -1
  172. package/esm/sdk/init.js.map +0 -1
  173. package/types/sdk/init.d.ts.map +0 -1
@@ -1,11 +1,10 @@
1
1
  import { inboundFiltersIntegration, functionToStringIntegration, linkedErrorsIntegration, requestDataIntegration, hasTracingEnabled, getCurrentScope, getIntegrationsToSetup, getClient, startSession, getIsolationScope, endSession } from '@sentry/core';
2
- import { setOpenTelemetryContextAsyncContextStrategy, openTelemetrySetupCheck } from '@sentry/opentelemetry';
3
- import { logger, consoleSandbox, GLOBAL_OBJ, dropUndefinedKeys, stackParserFromStackParserOptions, propagationContextFromHeaders } from '@sentry/utils';
2
+ import { setOpenTelemetryContextAsyncContextStrategy, setupEventContextTrace, openTelemetrySetupCheck } from '@sentry/opentelemetry';
3
+ import { logger, consoleSandbox, dropUndefinedKeys, stackParserFromStackParserOptions, propagationContextFromHeaders } from '@sentry/utils';
4
4
  import { DEBUG_BUILD } from '../debug-build.js';
5
5
  import { consoleIntegration } from '../integrations/console.js';
6
6
  import { nodeContextIntegration } from '../integrations/context.js';
7
7
  import { contextLinesIntegration } from '../integrations/contextlines.js';
8
- import moduleModule from 'module';
9
8
  import { httpIntegration } from '../integrations/http.js';
10
9
  import { localVariablesIntegration } from '../integrations/local-variables/index.js';
11
10
  import { modulesIntegration } from '../integrations/modules.js';
@@ -18,7 +17,7 @@ import { makeNodeTransport } from '../transports/http.js';
18
17
  import { isCjs } from '../utils/commonjs.js';
19
18
  import { defaultStackParser, getSentryRelease } from './api.js';
20
19
  import { NodeClient } from './client.js';
21
- import { initOpenTelemetry } from './initOtel.js';
20
+ import { maybeInitializeEsmLoader, initOpenTelemetry } from './initOtel.js';
22
21
 
23
22
  function getCjsOnlyIntegrations() {
24
23
  return isCjs() ? [modulesIntegration()] : [];
@@ -106,31 +105,7 @@ function _init(
106
105
  }
107
106
 
108
107
  if (!isCjs()) {
109
- const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);
110
-
111
- // Register hook was added in v20.6.0 and v18.19.0
112
- if (nodeMajor >= 22 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) {
113
- // We need to work around using import.meta.url directly because jest complains about it.
114
- const importMetaUrl =
115
- typeof import.meta.url !== 'undefined' ? import.meta.url : undefined;
116
-
117
- if (!GLOBAL_OBJ._sentryEsmLoaderHookRegistered && importMetaUrl) {
118
- try {
119
- // @ts-expect-error register is available in these versions
120
- moduleModule.register('@opentelemetry/instrumentation/hook.mjs', importMetaUrl);
121
- GLOBAL_OBJ._sentryEsmLoaderHookRegistered = true;
122
- } catch (error) {
123
- logger.warn('Failed to register ESM hook', error);
124
- }
125
- }
126
- } else {
127
- consoleSandbox(() => {
128
- // eslint-disable-next-line no-console
129
- console.warn(
130
- '[Sentry] You are using Node.js in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or use version 7.x of the Sentry Node.js SDK.',
131
- );
132
- });
133
- }
108
+ maybeInitializeEsmLoader();
134
109
  }
135
110
 
136
111
  setOpenTelemetryContextAsyncContextStrategy();
@@ -172,11 +147,15 @@ function _init(
172
147
  // There is no way to use this SDK without OpenTelemetry!
173
148
  if (!options.skipOpenTelemetrySetup) {
174
149
  initOpenTelemetry(client);
150
+ validateOpenTelemetrySetup();
175
151
  }
176
152
 
177
- validateOpenTelemetrySetup();
153
+ setupEventContextTrace(client);
178
154
  }
179
155
 
156
+ /**
157
+ * Validate that your OpenTelemetry setup is correct.
158
+ */
180
159
  function validateOpenTelemetrySetup() {
181
160
  if (!DEBUG_BUILD) {
182
161
  return;
@@ -324,5 +303,5 @@ function isEnabled(client) {
324
303
  return client.getOptions().enabled !== false && client.getTransport() !== undefined;
325
304
  }
326
305
 
327
- export { getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, init, initWithoutDefaultIntegrations };
328
- //# sourceMappingURL=init.js.map
306
+ export { getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, init, initWithoutDefaultIntegrations, validateOpenTelemetrySetup };
307
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/sdk/index.ts"],"sourcesContent":["import {\n endSession,\n functionToStringIntegration,\n getClient,\n getCurrentScope,\n getIntegrationsToSetup,\n getIsolationScope,\n hasTracingEnabled,\n inboundFiltersIntegration,\n linkedErrorsIntegration,\n requestDataIntegration,\n startSession,\n} from '@sentry/core';\nimport {\n openTelemetrySetupCheck,\n setOpenTelemetryContextAsyncContextStrategy,\n setupEventContextTrace,\n} from '@sentry/opentelemetry';\nimport type { Client, Integration, Options } from '@sentry/types';\nimport {\n consoleSandbox,\n dropUndefinedKeys,\n logger,\n propagationContextFromHeaders,\n stackParserFromStackParserOptions,\n} from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { consoleIntegration } from '../integrations/console';\nimport { nodeContextIntegration } from '../integrations/context';\nimport { contextLinesIntegration } from '../integrations/contextlines';\n\nimport { httpIntegration } from '../integrations/http';\nimport { localVariablesIntegration } from '../integrations/local-variables';\nimport { modulesIntegration } from '../integrations/modules';\nimport { nativeNodeFetchIntegration } from '../integrations/node-fetch';\nimport { onUncaughtExceptionIntegration } from '../integrations/onuncaughtexception';\nimport { onUnhandledRejectionIntegration } from '../integrations/onunhandledrejection';\nimport { spotlightIntegration } from '../integrations/spotlight';\nimport { getAutoPerformanceIntegrations } from '../integrations/tracing';\nimport { makeNodeTransport } from '../transports';\nimport type { NodeClientOptions, NodeOptions } from '../types';\nimport { isCjs } from '../utils/commonjs';\nimport { defaultStackParser, getSentryRelease } from './api';\nimport { NodeClient } from './client';\nimport { initOpenTelemetry, maybeInitializeEsmLoader } from './initOtel';\n\nfunction getCjsOnlyIntegrations(): Integration[] {\n return isCjs() ? [modulesIntegration()] : [];\n}\n\n/**\n * Get default integrations, excluding performance.\n */\nexport function getDefaultIntegrationsWithoutPerformance(): Integration[] {\n return [\n // Common\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n linkedErrorsIntegration(),\n requestDataIntegration(),\n // Native Wrappers\n consoleIntegration(),\n httpIntegration(),\n nativeNodeFetchIntegration(),\n // Global Handlers\n onUncaughtExceptionIntegration(),\n onUnhandledRejectionIntegration(),\n // Event Info\n contextLinesIntegration(),\n localVariablesIntegration(),\n nodeContextIntegration(),\n ...getCjsOnlyIntegrations(),\n ];\n}\n\n/** Get the default integrations for the Node SDK. */\nexport function getDefaultIntegrations(options: Options): Integration[] {\n return [\n ...getDefaultIntegrationsWithoutPerformance(),\n // We only add performance integrations if tracing is enabled\n // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added\n // This means that generally request isolation will work (because that is done by httpIntegration)\n // But `transactionName` will not be set automatically\n ...(shouldAddPerformanceIntegrations(options) ? getAutoPerformanceIntegrations() : []),\n ];\n}\n\nfunction shouldAddPerformanceIntegrations(options: Options): boolean {\n if (!hasTracingEnabled(options)) {\n return false;\n }\n\n // We want to ensure `tracesSampleRate` is not just undefined/null here\n return options.enableTracing || options.tracesSampleRate != null || 'tracesSampler' in options;\n}\n\n/**\n * Initialize Sentry for Node.\n */\nexport function init(options: NodeOptions | undefined = {}): void {\n return _init(options, getDefaultIntegrations);\n}\n\n/**\n * Initialize Sentry for Node, without any integrations added by default.\n */\nexport function initWithoutDefaultIntegrations(options: NodeOptions | undefined = {}): void {\n return _init(options, () => []);\n}\n\n/**\n * Initialize Sentry for Node, without performance instrumentation.\n */\nfunction _init(\n options: NodeOptions | undefined = {},\n getDefaultIntegrationsImpl: (options: Options) => Integration[],\n): void {\n const clientOptions = getClientOptions(options, getDefaultIntegrationsImpl);\n\n if (clientOptions.debug === true) {\n if (DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n\n if (!isCjs()) {\n maybeInitializeEsmLoader();\n }\n\n setOpenTelemetryContextAsyncContextStrategy();\n\n const scope = getCurrentScope();\n scope.update(options.initialScope);\n\n const client = new NodeClient(clientOptions);\n // The client is on the current scope, from where it generally is inherited\n getCurrentScope().setClient(client);\n\n if (isEnabled(client)) {\n client.init();\n }\n\n logger.log(`Running in ${isCjs() ? 'CommonJS' : 'ESM'} mode.`);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n\n updateScopeFromEnvVariables();\n\n if (options.spotlight) {\n // force integrations to be setup even if no DSN was set\n // If they have already been added before, they will be ignored anyhow\n const integrations = client.getOptions().integrations;\n for (const integration of integrations) {\n client.addIntegration(integration);\n }\n client.addIntegration(\n spotlightIntegration({\n sidecarUrl: typeof options.spotlight === 'string' ? options.spotlight : undefined,\n }),\n );\n }\n\n // If users opt-out of this, they _have_ to set up OpenTelemetry themselves\n // There is no way to use this SDK without OpenTelemetry!\n if (!options.skipOpenTelemetrySetup) {\n initOpenTelemetry(client);\n validateOpenTelemetrySetup();\n }\n\n setupEventContextTrace(client);\n}\n\n/**\n * Validate that your OpenTelemetry setup is correct.\n */\nexport function validateOpenTelemetrySetup(): void {\n if (!DEBUG_BUILD) {\n return;\n }\n\n const setup = openTelemetrySetupCheck();\n\n const required = ['SentrySpanProcessor', 'SentryContextManager', 'SentryPropagator'] as const;\n for (const k of required) {\n if (!setup.includes(k)) {\n logger.error(\n `You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.`,\n );\n }\n }\n\n if (!setup.includes('SentrySampler')) {\n logger.warn(\n 'You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected.',\n );\n }\n}\n\nfunction getClientOptions(\n options: NodeOptions,\n getDefaultIntegrationsImpl: (options: Options) => Integration[],\n): NodeClientOptions {\n const release = getRelease(options.release);\n\n const autoSessionTracking =\n typeof release !== 'string'\n ? false\n : options.autoSessionTracking === undefined\n ? true\n : options.autoSessionTracking;\n\n const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate);\n\n const baseOptions = dropUndefinedKeys({\n transport: makeNodeTransport,\n dsn: process.env.SENTRY_DSN,\n environment: process.env.SENTRY_ENVIRONMENT,\n });\n\n const overwriteOptions = dropUndefinedKeys({\n release,\n autoSessionTracking,\n tracesSampleRate,\n });\n\n const mergedOptions = {\n ...baseOptions,\n ...options,\n ...overwriteOptions,\n };\n\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrationsImpl(mergedOptions);\n }\n\n const clientOptions: NodeClientOptions = {\n ...mergedOptions,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup({\n defaultIntegrations: options.defaultIntegrations,\n integrations: options.integrations,\n }),\n };\n\n return clientOptions;\n}\n\nfunction getRelease(release: NodeOptions['release']): string | undefined {\n if (release !== undefined) {\n return release;\n }\n\n const detectedRelease = getSentryRelease();\n if (detectedRelease !== undefined) {\n return detectedRelease;\n }\n\n return undefined;\n}\n\nfunction getTracesSampleRate(tracesSampleRate: NodeOptions['tracesSampleRate']): number | undefined {\n if (tracesSampleRate !== undefined) {\n return tracesSampleRate;\n }\n\n const sampleRateFromEnv = process.env.SENTRY_TRACES_SAMPLE_RATE;\n if (!sampleRateFromEnv) {\n return undefined;\n }\n\n const parsed = parseFloat(sampleRateFromEnv);\n return isFinite(parsed) ? parsed : undefined;\n}\n\n/**\n * Update scope and propagation context based on environmental variables.\n *\n * See https://github.com/getsentry/rfcs/blob/main/text/0071-continue-trace-over-process-boundaries.md\n * for more details.\n */\nfunction updateScopeFromEnvVariables(): void {\n const sentryUseEnvironment = (process.env.SENTRY_USE_ENVIRONMENT || '').toLowerCase();\n if (!['false', 'n', 'no', 'off', '0'].includes(sentryUseEnvironment)) {\n const sentryTraceEnv = process.env.SENTRY_TRACE;\n const baggageEnv = process.env.SENTRY_BAGGAGE;\n const propagationContext = propagationContextFromHeaders(sentryTraceEnv, baggageEnv);\n getCurrentScope().setPropagationContext(propagationContext);\n }\n}\n\n/**\n * Enable automatic Session Tracking for the node process.\n */\nfunction startSessionTracking(): void {\n const client = getClient<NodeClient>();\n if (client && client.getOptions().autoSessionTracking) {\n client.initSessionFlusher();\n }\n\n startSession();\n\n // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because\n // The 'beforeExit' event is not emitted for conditions causing explicit termination,\n // such as calling process.exit() or uncaught exceptions.\n // Ref: https://nodejs.org/api/process.html#process_event_beforeexit\n process.on('beforeExit', () => {\n const session = getIsolationScope().getSession();\n\n // Only call endSession, if the Session exists on Scope and SessionStatus is not a\n // Terminal Status i.e. Exited or Crashed because\n // \"When a session is moved away from ok it must not be updated anymore.\"\n // Ref: https://develop.sentry.dev/sdk/sessions/\n if (session && session.status !== 'ok') {\n endSession();\n }\n });\n}\n\nfunction isEnabled(client: Client): boolean {\n return client.getOptions().enabled !== false && client.getTransport() !== undefined;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8CA,SAAS,sBAAsB,GAAkB;AACjD,EAAE,OAAO,KAAK,EAAC,GAAI,CAAC,kBAAkB,EAAE,CAAA,GAAI,EAAE,CAAA;AAC9C,CAAA;AACA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAkB;AAC1E,EAAE,OAAO;AACT;AACA,IAAI,yBAAyB,EAAE;AAC/B,IAAI,2BAA2B,EAAE;AACjC,IAAI,uBAAuB,EAAE;AAC7B,IAAI,sBAAsB,EAAE;AAC5B;AACA,IAAI,kBAAkB,EAAE;AACxB,IAAI,eAAe,EAAE;AACrB,IAAI,0BAA0B,EAAE;AAChC;AACA,IAAI,8BAA8B,EAAE;AACpC,IAAI,+BAA+B,EAAE;AACrC;AACA,IAAI,uBAAuB,EAAE;AAC7B,IAAI,yBAAyB,EAAE;AAC/B,IAAI,sBAAsB,EAAE;AAC5B,IAAI,GAAG,sBAAsB,EAAE;AAC/B,GAAG,CAAA;AACH,CAAA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,OAAO,EAA0B;AACxE,EAAE,OAAO;AACT,IAAI,GAAG,wCAAwC,EAAE;AACjD;AACA;AACA;AACA;AACA,IAAI,IAAI,gCAAgC,CAAC,OAAO,CAAA,GAAI,8BAA8B,EAAC,GAAI,EAAE;AACzF,GAAG,CAAA;AACH,CAAA;AACA;AACA,SAAS,gCAAgC,CAAC,OAAO,EAAoB;AACrE,EAAE,IAAI,CAAC,iBAAiB,CAAC,OAAO,C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AAQ,IAAG,OAAO,CAAC,MAAA,KAAW,IAAI,EAAE;AAC5C,MAAM,UAAU,EAAE,CAAA;AAClB,KAAI;AACJ,GAAG,CAAC,CAAA;AACJ,CAAA;AACA;AACA,SAAS,SAAS,CAAC,MAAM,EAAmB;AAC5C,EAAE,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC,OAAA,KAAY,KAAA,IAAS,MAAM,CAAC,YAAY,EAAC,KAAM,SAAS,CAAA;AACrF;;;;"}
@@ -1,31 +1,91 @@
1
+ import moduleModule from 'module';
1
2
  import { diag, DiagLogLevel } from '@opentelemetry/api';
2
3
  import { Resource } from '@opentelemetry/resources';
3
4
  import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';
4
5
  import { SEMRESATTRS_SERVICE_NAME, SEMRESATTRS_SERVICE_NAMESPACE, SEMRESATTRS_SERVICE_VERSION } from '@opentelemetry/semantic-conventions';
5
6
  import { SDK_VERSION } from '@sentry/core';
6
- import { setupEventContextTrace, SentrySampler, SentrySpanProcessor, SentryPropagator } from '@sentry/opentelemetry';
7
- import { logger } from '@sentry/utils';
7
+ import { SentrySampler, SentrySpanProcessor, SentryPropagator } from '@sentry/opentelemetry';
8
+ import { logger, GLOBAL_OBJ, consoleSandbox } from '@sentry/utils';
9
+ import { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing/index.js';
8
10
  import { SentryContextManager } from '../otel/contextManager.js';
11
+ import { isCjs } from '../utils/commonjs.js';
9
12
 
10
13
  /**
11
14
  * Initialize OpenTelemetry for Node.
12
15
  */
13
16
  function initOpenTelemetry(client) {
14
17
  if (client.getOptions().debug) {
15
- const otelLogger = new Proxy(logger , {
16
- get(target, prop, receiver) {
17
- const actualProp = prop === 'verbose' ? 'debug' : prop;
18
- return Reflect.get(target, actualProp, receiver);
19
- },
18
+ setupOpenTelemetryLogger();
19
+ }
20
+
21
+ const provider = setupOtel(client);
22
+ client.traceProvider = provider;
23
+ }
24
+
25
+ /** Initialize the ESM loader. */
26
+ function maybeInitializeEsmLoader() {
27
+ const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);
28
+
29
+ // Register hook was added in v20.6.0 and v18.19.0
30
+ if (nodeMajor >= 22 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) {
31
+ // We need to work around using import.meta.url directly because jest complains about it.
32
+ const importMetaUrl =
33
+ typeof import.meta.url !== 'undefined' ? import.meta.url : undefined;
34
+
35
+ if (!GLOBAL_OBJ._sentryEsmLoaderHookRegistered && importMetaUrl) {
36
+ try {
37
+ // @ts-expect-error register is available in these versions
38
+ moduleModule.register('@opentelemetry/instrumentation/hook.mjs', importMetaUrl);
39
+ GLOBAL_OBJ._sentryEsmLoaderHookRegistered = true;
40
+ } catch (error) {
41
+ logger.warn('Failed to register ESM hook', error);
42
+ }
43
+ }
44
+ } else {
45
+ consoleSandbox(() => {
46
+ // eslint-disable-next-line no-console
47
+ console.warn(
48
+ '[Sentry] You are using Node.js in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or use version 7.x of the Sentry Node.js SDK.',
49
+ );
20
50
  });
51
+ }
52
+ }
21
53
 
22
- diag.setLogger(otelLogger, DiagLogLevel.DEBUG);
54
+ /**
55
+ * Preload OpenTelemetry for Node.
56
+ * This can be used to preload instrumentation early, but set up Sentry later.
57
+ * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.
58
+ */
59
+ function preloadOpenTelemetry(options = {}) {
60
+ const { debug } = options;
61
+
62
+ if (debug) {
63
+ logger.enable();
64
+ setupOpenTelemetryLogger();
23
65
  }
24
66
 
25
- setupEventContextTrace(client);
67
+ if (!isCjs()) {
68
+ maybeInitializeEsmLoader();
69
+ }
26
70
 
27
- const provider = setupOtel(client);
28
- client.traceProvider = provider;
71
+ // These are all integrations that we need to pre-load to ensure they are set up before any other code runs
72
+ getPreloadMethods(options.integrations).forEach(fn => {
73
+ fn();
74
+
75
+ if (debug) {
76
+ logger.log(`[Sentry] Preloaded ${fn.id} instrumentation`);
77
+ }
78
+ });
79
+ }
80
+
81
+ function getPreloadMethods(integrationNames) {
82
+ const instruments = getOpenTelemetryInstrumentationToPreload();
83
+
84
+ if (!integrationNames) {
85
+ return instruments;
86
+ }
87
+
88
+ return instruments.filter(instrumentation => integrationNames.includes(instrumentation.id));
29
89
  }
30
90
 
31
91
  /** Just exported for tests. */
@@ -51,5 +111,21 @@ function setupOtel(client) {
51
111
  return provider;
52
112
  }
53
113
 
54
- export { initOpenTelemetry, setupOtel };
114
+ /**
115
+ * Setup the OTEL logger to use our own logger.
116
+ */
117
+ function setupOpenTelemetryLogger() {
118
+ const otelLogger = new Proxy(logger , {
119
+ get(target, prop, receiver) {
120
+ const actualProp = prop === 'verbose' ? 'debug' : prop;
121
+ return Reflect.get(target, actualProp, receiver);
122
+ },
123
+ });
124
+
125
+ // Disable diag, to ensure this works even if called multiple times
126
+ diag.disable();
127
+ diag.setLogger(otelLogger, DiagLogLevel.DEBUG);
128
+ }
129
+
130
+ export { initOpenTelemetry, maybeInitializeEsmLoader, preloadOpenTelemetry, setupOtel };
55
131
  //# sourceMappingURL=initOtel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { DiagLogLevel, diag } from '@opentelemetry/api';\nimport { Resource } from '@opentelemetry/resources';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport {\n SEMRESATTRS_SERVICE_NAME,\n SEMRESATTRS_SERVICE_NAMESPACE,\n SEMRESATTRS_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { SDK_VERSION } from '@sentry/core';\nimport { SentryPropagator, SentrySampler, SentrySpanProcessor, setupEventContextTrace } from '@sentry/opentelemetry';\nimport { logger } from '@sentry/utils';\n\nimport { SentryContextManager } from '../otel/contextManager';\nimport type { NodeClient } from './client';\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient): void {\n if (client.getOptions().debug) {\n const otelLogger = new Proxy(logger as typeof logger & { verbose: (typeof logger)['debug'] }, {\n get(target, prop, receiver) {\n const actualProp = prop === 'verbose' ? 'debug' : prop;\n return Reflect.get(target, actualProp, receiver);\n },\n });\n\n diag.setLogger(otelLogger, DiagLogLevel.DEBUG);\n }\n\n setupEventContextTrace(client);\n\n const provider = setupOtel(client);\n client.traceProvider = provider;\n}\n\n/** Just exported for tests. */\nexport function setupOtel(client: NodeClient): BasicTracerProvider {\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: new Resource({\n [SEMRESATTRS_SERVICE_NAME]: 'node',\n [SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry',\n [SEMRESATTRS_SERVICE_VERSION]: SDK_VERSION,\n }),\n forceFlushTimeoutMillis: 500,\n });\n provider.addSpanProcessor(new SentrySpanProcessor());\n\n // Initialize the provider\n provider.register({\n propagator: new SentryPropagator(),\n contextManager: new SentryContextManager(),\n });\n\n return provider;\n}\n"],"names":[],"mappings":";;;;;;;;;AAeA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,MAAM,EAAoB;AAC5D,EAAE,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE;AACjC,IAAI,MAAM,UAAW,GAAE,IAAI,KAAK,CAAC,SAAiE;AAClG,MAAM,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;AAClC,QAAQ,MAAM,aAAa,IAAA,KAAS,SAAU,GAAE,OAAQ,GAAE,IAAI,CAAA;AAC9D,QAAQ,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;AACxD,OAAO;AACP,KAAK,CAAC,CAAA;AACN;AACA,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC,KAAK,CAAC,CAAA;AAClD,GAAE;AACF;AACA,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAA;AAChC;AACA,EAAE,MAAM,QAAS,GAAE,SAAS,CAAC,MAAM,CAAC,CAAA;AACpC,EAAE,MAAM,CAAC,aAAc,GAAE,QAAQ,CAAA;AACjC,CAAA;AACA;AACA;AACO,SAAS,SAAS,CAAC,MAAM,EAAmC;AACnE;AACA,EAAE,MAAM,QAAA,GAAW,IAAI,mBAAmB,CAAC;AAC3C,IAAI,OAAO,EAAE,IAAI,aAAa,CAAC,MAAM,CAAC;AACtC,IAAI,QAAQ,EAAE,IAAI,QAAQ,CAAC;AAC3B,MAAM,CAAC,wBAAwB,GAAG,MAAM;AACxC,MAAM,CAAC,6BAA6B,GAAG,QAAQ;AAC/C,MAAM,CAAC,2BAA2B,GAAG,WAAW;AAChD,KAAK,CAAC;AACN,IAAI,uBAAuB,EAAE,GAAG;AAChC,GAAG,CAAC,CAAA;AACJ,EAAE,QAAQ,CAAC,gBAAgB,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAA;AACtD;AACA;AACA,EAAE,QAAQ,CAAC,QAAQ,CAAC;AACpB,IAAI,UAAU,EAAE,IAAI,gBAAgB,EAAE;AACtC,IAAI,cAAc,EAAE,IAAI,oBAAoB,EAAE;AAC9C,GAAG,CAAC,CAAA;AACJ;AACA,EAAE,OAAO,QAAQ,CAAA;AACjB;;;;"}
1
+ {"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import moduleModule from 'module';\nimport { DiagLogLevel, diag } from '@opentelemetry/api';\nimport { Resource } from '@opentelemetry/resources';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport {\n SEMRESATTRS_SERVICE_NAME,\n SEMRESATTRS_SERVICE_NAMESPACE,\n SEMRESATTRS_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { SDK_VERSION } from '@sentry/core';\nimport { SentryPropagator, SentrySampler, SentrySpanProcessor } from '@sentry/opentelemetry';\nimport { GLOBAL_OBJ, consoleSandbox, logger } from '@sentry/utils';\n\nimport { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing';\nimport { SentryContextManager } from '../otel/contextManager';\nimport { isCjs } from '../utils/commonjs';\nimport type { NodeClient } from './client';\n\ndeclare const __IMPORT_META_URL_REPLACEMENT__: string;\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient): void {\n if (client.getOptions().debug) {\n setupOpenTelemetryLogger();\n }\n\n const provider = setupOtel(client);\n client.traceProvider = provider;\n}\n\n/** Initialize the ESM loader. */\nexport function maybeInitializeEsmLoader(): void {\n const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(Number);\n\n // Register hook was added in v20.6.0 and v18.19.0\n if (nodeMajor >= 22 || (nodeMajor === 20 && nodeMinor >= 6) || (nodeMajor === 18 && nodeMinor >= 19)) {\n // We need to work around using import.meta.url directly because jest complains about it.\n const importMetaUrl =\n typeof __IMPORT_META_URL_REPLACEMENT__ !== 'undefined' ? __IMPORT_META_URL_REPLACEMENT__ : undefined;\n\n if (!GLOBAL_OBJ._sentryEsmLoaderHookRegistered && importMetaUrl) {\n try {\n // @ts-expect-error register is available in these versions\n moduleModule.register('@opentelemetry/instrumentation/hook.mjs', importMetaUrl);\n GLOBAL_OBJ._sentryEsmLoaderHookRegistered = true;\n } catch (error) {\n logger.warn('Failed to register ESM hook', error);\n }\n }\n } else {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n '[Sentry] You are using Node.js in ESM mode (\"import syntax\"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS (\"require() syntax\"), or use version 7.x of the Sentry Node.js SDK.',\n );\n });\n }\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 logger.enable();\n setupOpenTelemetryLogger();\n }\n\n if (!isCjs()) {\n maybeInitializeEsmLoader();\n }\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 logger.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 return instruments.filter(instrumentation => integrationNames.includes(instrumentation.id));\n}\n\n/** Just exported for tests. */\nexport function setupOtel(client: NodeClient): BasicTracerProvider {\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: new Resource({\n [SEMRESATTRS_SERVICE_NAME]: 'node',\n [SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry',\n [SEMRESATTRS_SERVICE_VERSION]: SDK_VERSION,\n }),\n forceFlushTimeoutMillis: 500,\n });\n provider.addSpanProcessor(new SentrySpanProcessor());\n\n // Initialize the provider\n provider.register({\n propagator: new SentryPropagator(),\n contextManager: new SentryContextManager(),\n });\n\n return provider;\n}\n\n/**\n * Setup the OTEL logger to use our own logger.\n */\nfunction setupOpenTelemetryLogger(): void {\n const otelLogger = new Proxy(logger as typeof logger & { verbose: (typeof logger)['debug'] }, {\n get(target, prop, receiver) {\n const actualProp = prop === 'verbose' ? 'debug' : prop;\n return Reflect.get(target, actualProp, receiver);\n },\n });\n\n // Disable diag, to ensure this works even if called multiple times\n diag.disable();\n diag.setLogger(otelLogger, DiagLogLevel.DEBUG);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAoBA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,MAAM,EAAoB;AAC5D,EAAE,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,KA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;AAChD,KAAK,CAAC;AACN,IAAI,uBAAuB,EAAE,GAAG;AAChC,GAAG,CAAC,CAAA;AACJ,EAAE,QAAQ,CAAC,gBAAgB,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAA;AACtD;AACA;AACA,EAAE,QAAQ,CAAC,QAAQ,CAAC;AACpB,IAAI,UAAU,EAAE,IAAI,gBAAgB,EAAE;AACtC,IAAI,cAAc,EAAE,IAAI,oBAAoB,EAAE;AAC9C,GAAG,CAAC,CAAA;AACJ;AACA,EAAE,OAAO,QAAQ,CAAA;AACjB,CAAA;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB,GAAS;AAC1C,EAAE,MAAM,UAAW,GAAE,IAAI,KAAK,CAAC,SAAiE;AAChG,IAAI,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;AAChC,MAAM,MAAM,aAAa,IAAA,KAAS,SAAU,GAAE,OAAQ,GAAE,IAAI,CAAA;AAC5D,MAAM,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;AACtD,KAAK;AACL,GAAG,CAAC,CAAA;AACJ;AACA;AACA,EAAE,IAAI,CAAC,OAAO,EAAE,CAAA;AAChB,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC,KAAK,CAAC,CAAA;AAChD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "8.3.0",
3
+ "version": "8.5.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",
@@ -49,6 +49,14 @@
49
49
  "require": {
50
50
  "default": "./cjs/init.js"
51
51
  }
52
+ },
53
+ "./preload": {
54
+ "import": {
55
+ "default": "./esm/preload.js"
56
+ },
57
+ "require": {
58
+ "default": "./cjs/preload.js"
59
+ }
52
60
  }
53
61
  },
54
62
  "typesVersions": {
@@ -84,10 +92,10 @@
84
92
  "@opentelemetry/sdk-trace-base": "^1.23.0",
85
93
  "@opentelemetry/semantic-conventions": "^1.23.0",
86
94
  "@prisma/instrumentation": "5.14.0",
87
- "@sentry/core": "8.3.0",
88
- "@sentry/opentelemetry": "8.3.0",
89
- "@sentry/types": "8.3.0",
90
- "@sentry/utils": "8.3.0"
95
+ "@sentry/core": "8.5.0",
96
+ "@sentry/opentelemetry": "8.5.0",
97
+ "@sentry/types": "8.5.0",
98
+ "@sentry/utils": "8.5.0"
91
99
  },
92
100
  "devDependencies": {
93
101
  "@types/node": "^14.18.0"
package/types/index.d.ts CHANGED
@@ -23,8 +23,9 @@ export { hapiIntegration, setupHapiErrorHandler } from './integrations/tracing/h
23
23
  export { koaIntegration, setupKoaErrorHandler } from './integrations/tracing/koa';
24
24
  export { connectIntegration, setupConnectErrorHandler } from './integrations/tracing/connect';
25
25
  export { spotlightIntegration } from './integrations/spotlight';
26
- export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, } from './sdk/init';
27
- export { initOpenTelemetry } from './sdk/initOtel';
26
+ export { SentryContextManager } from './otel/contextManager';
27
+ export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, validateOpenTelemetrySetup, } from './sdk';
28
+ export { initOpenTelemetry, preloadOpenTelemetry } from './sdk/initOtel';
28
29
  export { getAutoPerformanceIntegrations } from './integrations/tracing';
29
30
  export { getSentryRelease, defaultStackParser } from './sdk/api';
30
31
  export { createGetModuleFromFilename } from './utils/module';
@@ -34,6 +35,6 @@ export { cron } from './cron';
34
35
  export type { NodeOptions } from './types';
35
36
  export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from '@sentry/utils';
36
37
  export { addOpenTelemetryInstrumentation, continueTrace, setOpenTelemetryContextAsyncContextStrategy as setNodeAsyncContextStrategy, } from '@sentry/opentelemetry';
37
- export { addBreadcrumb, isInitialized, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentHub, getCurrentScope, getIsolationScope, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, zodErrorsIntegration, } from '@sentry/core';
38
+ export { addBreadcrumb, isInitialized, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentHub, getCurrentScope, getIsolationScope, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, zodErrorsIntegration, } from '@sentry/core';
38
39
  export type { Breadcrumb, BreadcrumbHint, PolymorphicRequest, Request, SdkInfo, Event, EventHint, ErrorEvent, Exception, Session, SeverityLevel, StackFrame, Stacktrace, Thread, User, Span, } from '@sentry/types';
39
40
  //# sourceMappingURL=index.d.ts.map
@@ -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;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,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,EA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L,+BAA+B,EAG/B,aAAa,EAEb,2CAA2C,IAAI,2BAA2B,GAC3E,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,KAAK,EACL,eAAe,EACf,KAAK,EACL,WAAW,EACX,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,2BAA2B,EAC3B,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,4BAA4B,EAC5B,gCAAgC,EAChC,gCAAgC,EAChC,qCAAqC,EACrC,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,SAAS,EAET,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,cAAc,IAAI,OAAO,EACzB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,EACd,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,GACL,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE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4B,EAC5B,gCAAgC,EAChC,gCAAgC,EAChC,qCAAqC,EACrC,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,SAAS,EAET,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,cAAc,IAAI,OAAO,EACzB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,EACd,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,GACL,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/anr/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA8B,WAAW,EAA4B,MAAM,eAAe,CAAC;AAIvG,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,UAAU,CAAC;AAGvE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AA4C1D,KAAK,WAAW,GAAG;IAAE,WAAW,EAAE,MAAM,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AA6CvE,KAAK,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,WAAW,GAAG,WAAW,CAAC;AAEzF,eAAO,MAAM,cAAc,WAAkD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/anr/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA8B,WAAW,EAA4B,MAAM,eAAe,CAAC;AAIvG,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,UAAU,CAAC;AAGvE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AA4C1D,KAAK,WAAW,GAAG;IAAE,WAAW,EAAE,MAAM,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AA6CvE,KAAK,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,WAAW,GAAG,WAAW,CAAC;AAEzF,eAAO,MAAM,cAAc,WAAkD,CAAC"}
@@ -18,6 +18,13 @@ interface HttpOptions {
18
18
  /** Allows to pass a custom version of HttpInstrumentation. We use this for Next.js. */
19
19
  _instrumentation?: typeof HttpInstrumentation;
20
20
  }
21
+ /**
22
+ * Instrument the HTTP module.
23
+ * This can only be instrumented once! If this called again later, we just update the options.
24
+ */
25
+ export declare const instrumentHttp: (() => void) & {
26
+ id: string;
27
+ };
21
28
  /**
22
29
  * The http integration instruments Node's internal http and https modules.
23
30
  * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/integrations/http.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAsB1E,UAAU,WAAW;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAElD;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAElD,uFAAuF;IACvF,gBAAgB,CAAC,EAAE,OAAO,mBAAmB,CAAC;CAC/C;AA0GD;;;GAGG;AACH,eAAO,MAAM,eAAe,4EAAsC,CAAC"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/integrations/http.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAwB1E,UAAU,WAAW;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAElD;;;OAGG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAElD,uFAAuF;IACvF,gBAAgB,CAAC,EAAE,OAAO,mBAAmB,CAAC;CAC/C;AAKD;;;GAGG;AACH,eAAO,MAAM,cAAc,SACZ,IAAI;;CAyGlB,CAAC;AAYF;;;GAGG;AACH,eAAO,MAAM,eAAe,4EAAsC,CAAC"}
@@ -21,6 +21,6 @@ export declare function createCallbackList<T>(complete: Next<T>): CallbackWrappe
21
21
  /**
22
22
  * Adds local variables to exception frames.
23
23
  */
24
- export declare const localVariablesSyncIntegration: (options?: LocalVariablesIntegrationOptions | undefined, session?: DebugSession | undefined) => import("@sentry/types").Integration;
24
+ export declare const localVariablesSyncIntegration: (options?: LocalVariablesIntegrationOptions | undefined, sessionOverride?: DebugSession | undefined) => import("@sentry/types").Integration;
25
25
  export {};
26
26
  //# sourceMappingURL=local-variables-sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"local-variables-sync.d.ts","sourceRoot":"","sources":["../../../../src/integrations/local-variables/local-variables-sync.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAW,MAAM,gBAAgB,CAAC;AAQ/E,OAAO,KAAK,EAEV,gCAAgC,EAGhC,SAAS,EACV,MAAM,UAAU,CAAC;AAGlB,KAAK,YAAY,GAAG,qBAAqB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AACxE,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,mBAAmB,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/G,kDAAkD;IAClD,oBAAoB,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAChD,2CAA2C;IAC3C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,IAAI,CAAC;CAChF;AAED,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;AACnC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AACpC,KAAK,eAAe,CAAC,CAAC,IAAI;IAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAEzD,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAiC3E;AAmUD;;GAEG;AACH,eAAO,MAAM,6BAA6B,qIAAoD,CAAC"}
1
+ {"version":3,"file":"local-variables-sync.d.ts","sourceRoot":"","sources":["../../../../src/integrations/local-variables/local-variables-sync.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAoB,MAAM,gBAAgB,CAAC;AAOxF,OAAO,KAAK,EAEV,gCAAgC,EAGhC,SAAS,EACV,MAAM,UAAU,CAAC;AAGlB,KAAK,YAAY,GAAG,qBAAqB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AACxE,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,mBAAmB,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/G,kDAAkD;IAClD,oBAAoB,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAChD,2CAA2C;IAC3C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,IAAI,CAAC;CAChF;AAED,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;AACnC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AACpC,KAAK,eAAe,CAAC,CAAC,IAAI;IAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAEzD,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAiC3E;AAwUD;;GAEG;AACH,eAAO,MAAM,6BAA6B,6IAAoD,CAAC"}
@@ -1,6 +1,9 @@
1
1
  type ConnectApp = {
2
2
  use: (middleware: any) => void;
3
3
  };
4
+ export declare const instrumentConnect: ((options?: unknown) => void) & {
5
+ id: string;
6
+ };
4
7
  export declare const connectIntegration: () => import("@sentry/types").Integration;
5
8
  export declare const setupConnectErrorHandler: (app: ConnectApp) => void;
6
9
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/connect.ts"],"names":[],"mappings":"AAaA,KAAK,UAAU,GAAG;IAEhB,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC;AAWF,eAAO,MAAM,kBAAkB,2CAAyC,CAAC;AAQzE,eAAO,MAAM,wBAAwB,QAAS,UAAU,KAAG,IAc1D,CAAC"}
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/connect.ts"],"names":[],"mappings":"AAaA,KAAK,UAAU,GAAG;IAEhB,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAC;CAChC,CAAC;AAIF,eAAO,MAAM,iBAAiB;;CAA+E,CAAC;AAW9G,eAAO,MAAM,kBAAkB,2CAAyC,CAAC;AAQzE,eAAO,MAAM,wBAAwB,QAAS,UAAU,KAAG,IAc1D,CAAC"}
@@ -1,5 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  import type * as http from 'node:http';
3
+ export declare const instrumentExpress: ((options?: unknown) => void) & {
4
+ id: string;
5
+ };
3
6
  /**
4
7
  * Express integration
5
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/express.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAuDvC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,2CAAyC,CAAC;AAEzE,UAAU,eAAgB,SAAQ,KAAK;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH;AAED,KAAK,iBAAiB,GAAG,CACvB,KAAK,EAAE,eAAe,EACt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AGG;IACH,iBAAiB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC;CACjE,GAAG,iBAAiB,CAqCpB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE;IAAE,GAAG,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,OAAO,CAAA;CAAE,GAAG,IAAI,CAGvG"}
@@ -2,6 +2,9 @@ interface Fastify {
2
2
  register: (plugin: any) => void;
3
3
  addHook: (hook: string, handler: (request: any, reply: any, error: Error) => void) => void;
4
4
  }
5
+ export declare const instrumentFastify: ((options?: unknown) => void) & {
6
+ id: string;
7
+ };
5
8
  /**
6
9
  * Express integration
7
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/fastify.ts"],"names":[],"mappings":"AAeA,UAAU,OAAO;IAEf,QAAQ,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,KAAK,IAAI,CAAC;CAC5F;AA8BD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,2CAAyC,CAAC;AAEzE;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0C/D"}
1
+ {"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/fastify.ts"],"names":[],"mappings":"AAeA,UAAU,OAAO;IAEf,QAAQ,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,KAAK,IAAI,CAAC;CAC5F;AAiBD,eAAO,MAAM,iBAAiB;;CAQ7B,CAAC;AAWF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,2CAAyC,CAAC;AAEzE;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0C/D"}
@@ -11,11 +11,14 @@ interface GraphqlOptions {
11
11
  */
12
12
  ignoreTrivalResolveSpans?: boolean;
13
13
  }
14
+ export declare const instrumentGraphql: ((options?: GraphqlOptions | undefined) => void) & {
15
+ id: string;
16
+ };
14
17
  /**
15
18
  * GraphQL integration
16
19
  *
17
20
  * Capture tracing data for GraphQL.
18
21
  */
19
- export declare const graphqlIntegration: (_options?: GraphqlOptions | undefined) => import("@sentry/types").Integration;
22
+ export declare const graphqlIntegration: (options?: GraphqlOptions | undefined) => import("@sentry/types").Integration;
20
23
  export {};
21
24
  //# sourceMappingURL=graphql.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/graphql.ts"],"names":[],"mappings":"AAOA,UAAU,cAAc;IACtB,yCAAyC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAwBD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,gFAAyC,CAAC"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/graphql.ts"],"names":[],"mappings":"AAOA,UAAU,cAAc;IACtB,yCAAyC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAID,eAAO,MAAM,iBAAiB;;CAgB7B,CAAC;AAWF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,+EAAyC,CAAC"}
@@ -1,4 +1,7 @@
1
1
  import type { Server } from './types';
2
+ export declare const instrumentHapi: ((options?: unknown) => void) & {
3
+ id: string;
4
+ };
2
5
  /**
3
6
  * Hapi integration
4
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/hapi/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAsC,MAAM,EAAE,MAAM,SAAS,CAAC;AAW1E;;;;;GAKG;AACH,eAAO,MAAM,eAAe,2CAAsC,CAAC;AAsBnE,eAAO,MAAM,eAAe;;;0BAIW,OAAO,GAAG,EAAE,GAAG,CAAC;CA6BtD,CAAC;AAEF;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAezE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/hapi/index.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAsC,MAAM,EAAE,MAAM,SAAS,CAAC;AAI1E,eAAO,MAAM,cAAc;;CAA4E,CAAC;AAWxG;;;;;GAKG;AACH,eAAO,MAAM,eAAe,2CAAsC,CAAC;AAsBnE,eAAO,MAAM,eAAe;;;0BAIW,OAAO,GAAG,EAAE,GAAG,CAAC;CA6BtD,CAAC;AAEF;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAezE"}
@@ -3,4 +3,10 @@ import type { Integration } from '@sentry/types';
3
3
  * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.
4
4
  */
5
5
  export declare function getAutoPerformanceIntegrations(): Integration[];
6
+ /**
7
+ * Get a list of methods to instrument OTEL, when preload instrumentation.
8
+ */
9
+ export declare function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & {
10
+ id: string;
11
+ })[];
6
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAgBjD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAoB9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAiBjD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAoB9D;AAED;;GAEG;AAEH,wBAAgB,wCAAwC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,CAiBzG"}
@@ -1,3 +1,6 @@
1
+ export declare const instrumentKoa: ((options?: unknown) => void) & {
2
+ id: string;
3
+ };
1
4
  export declare const koaIntegration: () => import("@sentry/types").Integration;
2
5
  export declare const setupKoaErrorHandler: (app: {
3
6
  use: (arg0: (ctx: any, next: any) => Promise<void>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"koa.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/koa.ts"],"names":[],"mappings":"AAiEA,eAAO,MAAM,cAAc,2CAAqC,CAAC;AAGjE,eAAO,MAAM,oBAAoB;sBAA6B,GAAG,QAAQ,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;MAAK,IAU3G,CAAC"}
1
+ {"version":3,"file":"koa.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/koa.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa;;CAmBzB,CAAC;AAWF,eAAO,MAAM,cAAc,2CAAqC,CAAC;AAGjE,eAAO,MAAM,oBAAoB;sBAA6B,GAAG,QAAQ,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;MAAK,IAU3G,CAAC"}
@@ -1,3 +1,6 @@
1
+ export declare const instrumentMongo: ((options?: unknown) => void) & {
2
+ id: string;
3
+ };
1
4
  /**
2
5
  * MongoDB integration
3
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mongo.ts"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2CAAuC,CAAC"}
1
+ {"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mongo.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe;;CAQ3B,CAAC;AAWF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2CAAuC,CAAC"}
@@ -1,3 +1,6 @@
1
+ export declare const instrumentMongoose: ((options?: unknown) => void) & {
2
+ id: string;
3
+ };
1
4
  /**
2
5
  * Mongoose integration
3
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"mongoose.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mongoose.ts"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,2CAA0C,CAAC"}
1
+ {"version":3,"file":"mongoose.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mongoose.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB;;CAQ9B,CAAC;AAWF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,2CAA0C,CAAC"}
@@ -1,3 +1,6 @@
1
+ export declare const instrumentMysql: ((options?: unknown) => void) & {
2
+ id: string;
3
+ };
1
4
  /**
2
5
  * MySQL integration
3
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mysql.ts"],"names":[],"mappings":"AAcA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2CAAuC,CAAC"}
1
+ {"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mysql.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe;;CAA+E,CAAC;AAW5G;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,2CAAuC,CAAC"}
@@ -1,3 +1,6 @@
1
+ export declare const instrumentMysql2: ((options?: unknown) => void) & {
2
+ id: string;
3
+ };
1
4
  /**
2
5
  * MySQL2 integration
3
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"mysql2.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mysql2.ts"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2CAAwC,CAAC"}
1
+ {"version":3,"file":"mysql2.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/mysql2.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB;;CAQ5B,CAAC;AAWF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2CAAwC,CAAC"}
@@ -20,6 +20,9 @@ interface MinimalNestJsApp {
20
20
  }) => any;
21
21
  }) => void;
22
22
  }
23
+ export declare const instrumentNest: ((options?: unknown) => void) & {
24
+ id: string;
25
+ };
23
26
  /**
24
27
  * Nest framework integration
25
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"nest.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/nest.ts"],"names":[],"mappings":"AAeA,UAAU,6BAA6B;IACrC,OAAO,EAAE,MAAM,MAAM,CAAC;IAEtB,YAAY,EAAE,MAAM;QAIlB,UAAU,EAAE,MAAM;YAChB,KAAK,CAAC,EAAE;gBACN,IAAI,CAAC,EAAE,MAAM,CAAC;aACf,CAAC;YACF,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;KACH,CAAC;CACH;AAED,UAAU,iBAAiB;IAEzB,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC;CACxC;AAED,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,CAAC,IAAI,EAA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,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,CA4ChG"}
@@ -1,3 +1,6 @@
1
+ export declare const instrumentPostgres: ((options?: unknown) => void) & {
2
+ id: string;
3
+ };
1
4
  /**
2
5
  * Postgres integration
3
6
  *