@sentry/node 8.39.0-dev.0 → 8.40.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 (199) hide show
  1. package/build/cjs/cron/node-cron.js +1 -1
  2. package/build/cjs/cron/node-schedule.js +1 -1
  3. package/build/cjs/index.js +10 -10
  4. package/build/cjs/integrations/anr/index.js +7 -8
  5. package/build/cjs/integrations/anr/index.js.map +1 -1
  6. package/build/cjs/integrations/{processThread.js → childProcess.js} +11 -4
  7. package/build/cjs/integrations/childProcess.js.map +1 -0
  8. package/build/cjs/integrations/console.js +3 -4
  9. package/build/cjs/integrations/console.js.map +1 -1
  10. package/build/cjs/integrations/context.js +1 -1
  11. package/build/cjs/integrations/contextlines.js +9 -10
  12. package/build/cjs/integrations/contextlines.js.map +1 -1
  13. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +116 -7
  14. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  15. package/build/cjs/integrations/http/index.js +1 -1
  16. package/build/cjs/integrations/local-variables/local-variables-async.js +6 -7
  17. package/build/cjs/integrations/local-variables/local-variables-async.js.map +1 -1
  18. package/build/cjs/integrations/local-variables/local-variables-sync.js +6 -7
  19. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +1 -1
  20. package/build/cjs/integrations/modules.js +1 -2
  21. package/build/cjs/integrations/modules.js.map +1 -1
  22. package/build/cjs/integrations/node-fetch.js +4 -5
  23. package/build/cjs/integrations/node-fetch.js.map +1 -1
  24. package/build/cjs/integrations/onuncaughtexception.js +1 -2
  25. package/build/cjs/integrations/onuncaughtexception.js.map +1 -1
  26. package/build/cjs/integrations/onunhandledrejection.js +2 -3
  27. package/build/cjs/integrations/onunhandledrejection.js.map +1 -1
  28. package/build/cjs/integrations/spotlight.js +5 -6
  29. package/build/cjs/integrations/spotlight.js.map +1 -1
  30. package/build/cjs/integrations/tracing/dataloader.js +1 -1
  31. package/build/cjs/integrations/tracing/express.js +2 -3
  32. package/build/cjs/integrations/tracing/express.js.map +1 -1
  33. package/build/cjs/integrations/tracing/fastify.js +1 -1
  34. package/build/cjs/integrations/tracing/hapi/index.js +2 -3
  35. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  36. package/build/cjs/integrations/tracing/index.js +2 -0
  37. package/build/cjs/integrations/tracing/index.js.map +1 -1
  38. package/build/cjs/integrations/tracing/koa.js +2 -3
  39. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  40. package/build/cjs/integrations/tracing/mongo.js +47 -0
  41. package/build/cjs/integrations/tracing/mongo.js.map +1 -1
  42. package/build/cjs/integrations/tracing/nest/helpers.js +19 -3
  43. package/build/cjs/integrations/tracing/nest/helpers.js.map +1 -1
  44. package/build/cjs/integrations/tracing/nest/nest.js +26 -12
  45. package/build/cjs/integrations/tracing/nest/nest.js.map +1 -1
  46. package/build/cjs/integrations/tracing/nest/sentry-nest-event-instrumentation.js +117 -0
  47. package/build/cjs/integrations/tracing/nest/sentry-nest-event-instrumentation.js.map +1 -0
  48. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js +19 -20
  49. package/build/cjs/integrations/tracing/nest/sentry-nest-instrumentation.js.map +1 -1
  50. package/build/cjs/integrations/tracing/prisma.js +1 -1
  51. package/build/cjs/integrations/tracing/redis.js +2 -3
  52. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  53. package/build/cjs/integrations/tracing/tedious.js +1 -1
  54. package/build/cjs/nodeVersion.js +2 -2
  55. package/build/cjs/nodeVersion.js.map +1 -1
  56. package/build/cjs/proxy/base.js +1 -1
  57. package/build/cjs/proxy/index.js +3 -3
  58. package/build/cjs/proxy/index.js.map +1 -1
  59. package/build/cjs/proxy/parse-proxy-response.js +2 -2
  60. package/build/cjs/proxy/parse-proxy-response.js.map +1 -1
  61. package/build/cjs/sdk/api.js +7 -4
  62. package/build/cjs/sdk/api.js.map +1 -1
  63. package/build/cjs/sdk/client.js +3 -4
  64. package/build/cjs/sdk/client.js.map +1 -1
  65. package/build/cjs/sdk/index.js +11 -12
  66. package/build/cjs/sdk/index.js.map +1 -1
  67. package/build/cjs/sdk/initOtel.js +8 -9
  68. package/build/cjs/sdk/initOtel.js.map +1 -1
  69. package/build/cjs/transports/http.js +2 -3
  70. package/build/cjs/transports/http.js.map +1 -1
  71. package/build/cjs/utils/ensureIsWrapped.js +2 -3
  72. package/build/cjs/utils/ensureIsWrapped.js.map +1 -1
  73. package/build/cjs/utils/errorhandling.js +4 -5
  74. package/build/cjs/utils/errorhandling.js.map +1 -1
  75. package/build/cjs/utils/module.js +2 -2
  76. package/build/cjs/utils/module.js.map +1 -1
  77. package/build/cjs/utils/redisCache.js +3 -3
  78. package/build/cjs/utils/redisCache.js.map +1 -1
  79. package/build/esm/cron/node-cron.js +1 -1
  80. package/build/esm/cron/node-schedule.js +1 -1
  81. package/build/esm/index.js +2 -3
  82. package/build/esm/index.js.map +1 -1
  83. package/build/esm/integrations/anr/index.js +3 -4
  84. package/build/esm/integrations/anr/index.js.map +1 -1
  85. package/build/esm/integrations/anr/worker-script.js +2 -2
  86. package/build/esm/integrations/{processThread.js → childProcess.js} +11 -5
  87. package/build/esm/integrations/childProcess.js.map +1 -0
  88. package/build/esm/integrations/console.js +1 -2
  89. package/build/esm/integrations/console.js.map +1 -1
  90. package/build/esm/integrations/context.js +1 -1
  91. package/build/esm/integrations/contextlines.js +2 -3
  92. package/build/esm/integrations/contextlines.js.map +1 -1
  93. package/build/esm/integrations/http/SentryHttpInstrumentation.js +113 -4
  94. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  95. package/build/esm/integrations/http/index.js +1 -1
  96. package/build/esm/integrations/local-variables/local-variables-async.js +3 -4
  97. package/build/esm/integrations/local-variables/local-variables-async.js.map +1 -1
  98. package/build/esm/integrations/local-variables/local-variables-sync.js +2 -3
  99. package/build/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
  100. package/build/esm/integrations/local-variables/worker-script.js +2 -2
  101. package/build/esm/integrations/modules.js +1 -2
  102. package/build/esm/integrations/modules.js.map +1 -1
  103. package/build/esm/integrations/node-fetch.js +2 -3
  104. package/build/esm/integrations/node-fetch.js.map +1 -1
  105. package/build/esm/integrations/onuncaughtexception.js +1 -2
  106. package/build/esm/integrations/onuncaughtexception.js.map +1 -1
  107. package/build/esm/integrations/onunhandledrejection.js +1 -2
  108. package/build/esm/integrations/onunhandledrejection.js.map +1 -1
  109. package/build/esm/integrations/spotlight.js +1 -2
  110. package/build/esm/integrations/spotlight.js.map +1 -1
  111. package/build/esm/integrations/tracing/dataloader.js +1 -1
  112. package/build/esm/integrations/tracing/express.js +2 -3
  113. package/build/esm/integrations/tracing/express.js.map +1 -1
  114. package/build/esm/integrations/tracing/fastify.js +1 -1
  115. package/build/esm/integrations/tracing/hapi/index.js +2 -3
  116. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  117. package/build/esm/integrations/tracing/index.js +2 -0
  118. package/build/esm/integrations/tracing/index.js.map +1 -1
  119. package/build/esm/integrations/tracing/koa.js +2 -3
  120. package/build/esm/integrations/tracing/koa.js.map +1 -1
  121. package/build/esm/integrations/tracing/mongo.js +47 -1
  122. package/build/esm/integrations/tracing/mongo.js.map +1 -1
  123. package/build/esm/integrations/tracing/nest/helpers.js +19 -4
  124. package/build/esm/integrations/tracing/nest/helpers.js.map +1 -1
  125. package/build/esm/integrations/tracing/nest/nest.js +26 -12
  126. package/build/esm/integrations/tracing/nest/nest.js.map +1 -1
  127. package/build/esm/integrations/tracing/nest/sentry-nest-event-instrumentation.js +115 -0
  128. package/build/esm/integrations/tracing/nest/sentry-nest-event-instrumentation.js.map +1 -0
  129. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js +2 -3
  130. package/build/esm/integrations/tracing/nest/sentry-nest-instrumentation.js.map +1 -1
  131. package/build/esm/integrations/tracing/prisma.js +1 -1
  132. package/build/esm/integrations/tracing/redis.js +2 -3
  133. package/build/esm/integrations/tracing/redis.js.map +1 -1
  134. package/build/esm/integrations/tracing/tedious.js +1 -1
  135. package/build/esm/nodeVersion.js +1 -1
  136. package/build/esm/nodeVersion.js.map +1 -1
  137. package/build/esm/package.json +1 -1
  138. package/build/esm/proxy/base.js +1 -1
  139. package/build/esm/proxy/index.js +2 -2
  140. package/build/esm/proxy/index.js.map +1 -1
  141. package/build/esm/proxy/parse-proxy-response.js +1 -1
  142. package/build/esm/proxy/parse-proxy-response.js.map +1 -1
  143. package/build/esm/sdk/api.js +4 -1
  144. package/build/esm/sdk/api.js.map +1 -1
  145. package/build/esm/sdk/client.js +2 -3
  146. package/build/esm/sdk/client.js.map +1 -1
  147. package/build/esm/sdk/index.js +3 -4
  148. package/build/esm/sdk/index.js.map +1 -1
  149. package/build/esm/sdk/initOtel.js +2 -3
  150. package/build/esm/sdk/initOtel.js.map +1 -1
  151. package/build/esm/transports/http.js +2 -3
  152. package/build/esm/transports/http.js.map +1 -1
  153. package/build/esm/utils/ensureIsWrapped.js +2 -3
  154. package/build/esm/utils/ensureIsWrapped.js.map +1 -1
  155. package/build/esm/utils/errorhandling.js +1 -2
  156. package/build/esm/utils/errorhandling.js.map +1 -1
  157. package/build/esm/utils/module.js +1 -1
  158. package/build/esm/utils/module.js.map +1 -1
  159. package/build/esm/utils/redisCache.js +1 -1
  160. package/build/esm/utils/redisCache.js.map +1 -1
  161. package/build/types/index.d.ts +3 -3
  162. package/build/types/index.d.ts.map +1 -1
  163. package/build/types/integrations/anr/index.d.ts.map +1 -1
  164. package/build/types/integrations/childProcess.d.ts +20 -0
  165. package/build/types/integrations/childProcess.d.ts.map +1 -0
  166. package/build/types/integrations/contextlines.d.ts.map +1 -1
  167. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
  168. package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +1 -1
  169. package/build/types/integrations/onunhandledrejection.d.ts.map +1 -1
  170. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  171. package/build/types/integrations/tracing/mongo.d.ts +4 -0
  172. package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
  173. package/build/types/integrations/tracing/nest/helpers.d.ts +8 -0
  174. package/build/types/integrations/tracing/nest/helpers.d.ts.map +1 -1
  175. package/build/types/integrations/tracing/nest/nest.d.ts +6 -2
  176. package/build/types/integrations/tracing/nest/nest.d.ts.map +1 -1
  177. package/build/types/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts +27 -0
  178. package/build/types/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts.map +1 -0
  179. package/build/types/integrations/tracing/nest/types.d.ts +8 -0
  180. package/build/types/integrations/tracing/nest/types.d.ts.map +1 -1
  181. package/build/types/sdk/api.d.ts.map +1 -1
  182. package/build/types/sdk/index.d.ts.map +1 -1
  183. package/build/types/transports/http-module.d.ts +3 -1
  184. package/build/types/transports/http-module.d.ts.map +1 -1
  185. package/build/types/transports/http.d.ts.map +1 -1
  186. package/build/types-ts3.8/index.d.ts +3 -3
  187. package/build/types-ts3.8/integrations/childProcess.d.ts +20 -0
  188. package/build/types-ts3.8/integrations/tracing/mongo.d.ts +4 -0
  189. package/build/types-ts3.8/integrations/tracing/nest/helpers.d.ts +8 -0
  190. package/build/types-ts3.8/integrations/tracing/nest/nest.d.ts +6 -2
  191. package/build/types-ts3.8/integrations/tracing/nest/sentry-nest-event-instrumentation.d.ts +27 -0
  192. package/build/types-ts3.8/integrations/tracing/nest/types.d.ts +8 -0
  193. package/build/types-ts3.8/transports/http-module.d.ts +2 -1
  194. package/package.json +4 -5
  195. package/build/cjs/integrations/processThread.js.map +0 -1
  196. package/build/esm/integrations/processThread.js.map +0 -1
  197. package/build/types/integrations/processThread.d.ts +0 -14
  198. package/build/types/integrations/processThread.d.ts.map +0 -1
  199. package/build/types-ts3.8/integrations/processThread.d.ts +0 -14
@@ -1,6 +1,10 @@
1
1
  export declare const instrumentMongo: ((options?: unknown) => void) & {
2
2
  id: string;
3
3
  };
4
+ /**
5
+ * Replaces values in document with '?', hiding PII and helping grouping.
6
+ */
7
+ export declare function _defaultDbStatementSerializer(commandObj: Record<string, unknown>): string;
4
8
  /**
5
9
  * Adds Sentry tracing instrumentation for the [mongodb](https://www.npmjs.com/package/mongodb) library.
6
10
  *
@@ -17,6 +17,14 @@ export declare function getMiddlewareSpanOptions(target: InjectableTarget | Catc
17
17
  "sentry.origin": string;
18
18
  };
19
19
  };
20
+ /**
21
+ * Returns span options for nest event spans.
22
+ */
23
+ export declare function getEventSpanOptions(event: string): {
24
+ name: string;
25
+ attributes: Record<string, string>;
26
+ forceTransaction: boolean;
27
+ };
20
28
  /**
21
29
  * Adds instrumentation to a js observable and attaches the span to an active parent span.
22
30
  */
@@ -3,13 +3,17 @@ export declare const instrumentNest: (() => void) & {
3
3
  id: string;
4
4
  };
5
5
  /**
6
- * Nest framework integration
6
+ * Integration capturing tracing data for NestJS.
7
7
  *
8
- * Capture tracing data for nest.
8
+ * @deprecated The `nestIntegration` is deprecated. Instead, use the NestJS SDK directly (`@sentry/nestjs`), or use the `nestIntegration` export from `@sentry/nestjs`.
9
9
  */
10
10
  export declare const nestIntegration: () => import("@sentry/types").Integration;
11
11
  /**
12
12
  * Setup an error handler for Nest.
13
+ *
14
+ * @deprecated `setupNestErrorHandler` is deprecated.
15
+ * Instead use the `@sentry/nestjs` package, which has more functional APIs for capturing errors.
16
+ * See the [`@sentry/nestjs` Setup Guide](https://docs.sentry.io/platforms/javascript/guides/nestjs/) for how to set up the Sentry NestJS SDK.
13
17
  */
14
18
  export declare function setupNestErrorHandler(app: MinimalNestJsApp, baseFilter: NestJsErrorFilter): void;
15
19
  //# sourceMappingURL=nest.d.ts.map
@@ -0,0 +1,27 @@
1
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
+ /**
4
+ * Custom instrumentation for nestjs event-emitter
5
+ *
6
+ * This hooks into the `OnEvent` decorator, which is applied on event handlers.
7
+ */
8
+ export declare class SentryNestEventInstrumentation extends InstrumentationBase {
9
+ static readonly COMPONENT = "@nestjs/event-emitter";
10
+ static readonly COMMON_ATTRIBUTES: {
11
+ component: string;
12
+ };
13
+ constructor(config?: InstrumentationConfig);
14
+ /**
15
+ * Initializes the instrumentation by defining the modules to be patched.
16
+ */
17
+ init(): InstrumentationNodeModuleDefinition;
18
+ /**
19
+ * Wraps the @OnEvent decorator.
20
+ */
21
+ private _getOnEventFileInstrumentation;
22
+ /**
23
+ * Creates a wrapper function for the @OnEvent decorator.
24
+ */
25
+ private _createWrapOnEvent;
26
+ }
27
+ //# sourceMappingURL=sentry-nest-event-instrumentation.d.ts.map
@@ -61,6 +61,14 @@ export interface CatchTarget {
61
61
  catch?: (...args: any[]) => any;
62
62
  };
63
63
  }
64
+ /**
65
+ * Represents a target method in NestJS annotated with @OnEvent.
66
+ */
67
+ export interface OnEventTarget {
68
+ name: string;
69
+ sentryPatched?: boolean;
70
+ __SENTRY_INTERNAL__?: boolean;
71
+ }
64
72
  /**
65
73
  * Represents an express NextFunction.
66
74
  */
@@ -9,7 +9,8 @@ export type HTTPModuleRequestOptions = HTTPRequestOptions | HTTPSRequestOptions
9
9
  export interface HTTPModuleRequestIncomingMessage {
10
10
  headers: IncomingHttpHeaders;
11
11
  statusCode?: number;
12
- on(event: 'data' | 'end', listener: () => void): void;
12
+ on(event: 'data' | 'end', listener: (chunk: Buffer) => void): void;
13
+ off(event: 'data' | 'end', listener: (chunk: Buffer) => void): void;
13
14
  setEncoding(encoding: string): void;
14
15
  }
15
16
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "8.39.0-dev.0",
3
+ "version": "8.40.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",
@@ -97,10 +97,9 @@
97
97
  "@opentelemetry/sdk-trace-base": "^1.26.0",
98
98
  "@opentelemetry/semantic-conventions": "^1.27.0",
99
99
  "@prisma/instrumentation": "5.19.1",
100
- "@sentry/core": "8.39.0-dev.0",
101
- "@sentry/opentelemetry": "8.39.0-dev.0",
102
- "@sentry/types": "8.39.0-dev.0",
103
- "@sentry/utils": "8.39.0-dev.0",
100
+ "@sentry/core": "8.40.0",
101
+ "@sentry/opentelemetry": "8.40.0",
102
+ "@sentry/types": "8.40.0",
104
103
  "import-in-the-middle": "^1.11.2"
105
104
  },
106
105
  "devDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"processThread.js","sources":["../../../src/integrations/processThread.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { Worker } from 'node:worker_threads';\nimport { addBreadcrumb, defineIntegration } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\ninterface Options {\n /**\n * Whether to include child process arguments in breadcrumbs data.\n *\n * @default false\n */\n includeChildProcessArgs?: boolean;\n}\n\nconst INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs';\n\nconst _processThreadBreadcrumbIntegration = ((options: Options = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(_client) {\n // eslint-disable-next-line deprecation/deprecation\n diagnosticsChannel.channel('child_process').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'process' in event) {\n captureChildProcessEvents(event.process as ChildProcess, options);\n }\n });\n\n // eslint-disable-next-line deprecation/deprecation\n diagnosticsChannel.channel('worker_threads').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'worker' in event) {\n captureWorkerThreadEvents(event.worker as Worker);\n }\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Capture breadcrumbs for child processes and worker threads.\n */\nexport const processThreadBreadcrumbIntegration = defineIntegration(_processThreadBreadcrumbIntegration);\n\nfunction captureChildProcessEvents(child: ChildProcess, options: Options): void {\n let hasExited = false;\n let data: Record<string, unknown> | undefined;\n\n child\n .on('spawn', () => {\n // This is Sentry getting macOS OS context\n if (child.spawnfile === '/usr/bin/sw_vers') {\n hasExited = true;\n return;\n }\n\n data = { spawnfile: child.spawnfile };\n if (options.includeChildProcessArgs) {\n data.spawnargs = child.spawnargs;\n }\n })\n .on('exit', code => {\n if (!hasExited) {\n hasExited = true;\n\n // Only log for non-zero exit codes\n if (code !== null && code !== 0) {\n addBreadcrumb({\n category: 'child_process',\n message: `Child process exited with code '${code}'`,\n level: 'warning',\n data,\n });\n }\n }\n })\n .on('error', error => {\n if (!hasExited) {\n hasExited = true;\n\n addBreadcrumb({\n category: 'child_process',\n message: `Child process errored with '${error.message}'`,\n level: 'error',\n data,\n });\n }\n });\n}\n\nfunction captureWorkerThreadEvents(worker: Worker): void {\n let threadId: number | undefined;\n\n worker\n .on('online', () => {\n threadId = worker.threadId;\n })\n .on('error', error => {\n addBreadcrumb({\n category: 'worker_thread',\n message: `Worker thread errored with '${error.message}'`,\n level: 'error',\n data: { threadId },\n });\n });\n}\n"],"names":["defineIntegration","addBreadcrumb"],"mappings":";;;;;AAeA,MAAM,gBAAA,GAAmB,6BAA6B;;AAEtD,MAAM,mCAAA,IAAuC,CAAC,OAAO,GAAY,EAAE,KAAK;AACxE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,OAAO,EAAE;AACnB;AACA,MAAM,kBAAkB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,KAAc;AAChF,QAAQ,IAAI,KAAM,IAAG,OAAO,KAAA,KAAU,QAAA,IAAY,SAAA,IAAa,KAAK,EAAE;AACtE,UAAU,yBAAyB,CAAC,KAAK,CAAC,OAAQ,GAAiB,OAAO,CAAC;AAC3E;AACA,OAAO,CAAC;;AAER;AACA,MAAM,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,KAAc;AACjF,QAAQ,IAAI,KAAM,IAAG,OAAO,KAAA,KAAU,Q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,UAAU,OAAO,EAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,UAAU,KAAK,EAAE,OAAO;AACxB,UAAU,IAAI;AACd,SAAS,CAAC;AACV;AACA,KAAK,CAAC;AACN;;AAEA,SAAS,yBAAyB,CAAC,MAAM,EAAgB;AACzD,EAAE,IAAI,QAAQ;;AAEd,EAAE;AACF,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM;AACxB,MAAM,QAAS,GAAE,MAAM,CAAC,QAAQ;AAChC,KAAK;AACL,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS;AAC1B,MAAMA,kBAAa,CAAC;AACpB,QAAQ,QAAQ,EAAE,eAAe;AACjC,QAAQ,OAAO,EAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAChE,QAAQ,KAAK,EAAE,OAAO;AACtB,QAAQ,IAAI,EAAE,EAAE,QAAA,EAAU;AAC1B,OAAO,CAAC;AACR,KAAK,CAAC;AACN;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"processThread.js","sources":["../../../src/integrations/processThread.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { Worker } from 'node:worker_threads';\nimport { addBreadcrumb, defineIntegration } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\ninterface Options {\n /**\n * Whether to include child process arguments in breadcrumbs data.\n *\n * @default false\n */\n includeChildProcessArgs?: boolean;\n}\n\nconst INTEGRATION_NAME = 'ProcessAndThreadBreadcrumbs';\n\nconst _processThreadBreadcrumbIntegration = ((options: Options = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(_client) {\n // eslint-disable-next-line deprecation/deprecation\n diagnosticsChannel.channel('child_process').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'process' in event) {\n captureChildProcessEvents(event.process as ChildProcess, options);\n }\n });\n\n // eslint-disable-next-line deprecation/deprecation\n diagnosticsChannel.channel('worker_threads').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'worker' in event) {\n captureWorkerThreadEvents(event.worker as Worker);\n }\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Capture breadcrumbs for child processes and worker threads.\n */\nexport const processThreadBreadcrumbIntegration = defineIntegration(_processThreadBreadcrumbIntegration);\n\nfunction captureChildProcessEvents(child: ChildProcess, options: Options): void {\n let hasExited = false;\n let data: Record<string, unknown> | undefined;\n\n child\n .on('spawn', () => {\n // This is Sentry getting macOS OS context\n if (child.spawnfile === '/usr/bin/sw_vers') {\n hasExited = true;\n return;\n }\n\n data = { spawnfile: child.spawnfile };\n if (options.includeChildProcessArgs) {\n data.spawnargs = child.spawnargs;\n }\n })\n .on('exit', code => {\n if (!hasExited) {\n hasExited = true;\n\n // Only log for non-zero exit codes\n if (code !== null && code !== 0) {\n addBreadcrumb({\n category: 'child_process',\n message: `Child process exited with code '${code}'`,\n level: 'warning',\n data,\n });\n }\n }\n })\n .on('error', error => {\n if (!hasExited) {\n hasExited = true;\n\n addBreadcrumb({\n category: 'child_process',\n message: `Child process errored with '${error.message}'`,\n level: 'error',\n data,\n });\n }\n });\n}\n\nfunction captureWorkerThreadEvents(worker: Worker): void {\n let threadId: number | undefined;\n\n worker\n .on('online', () => {\n threadId = worker.threadId;\n })\n .on('error', error => {\n addBreadcrumb({\n category: 'worker_thread',\n message: `Worker thread errored with '${error.message}'`,\n level: 'error',\n data: { threadId },\n });\n });\n}\n"],"names":[],"mappings":";;;AAeA,MAAM,gBAAA,GAAmB,6BAA6B;;AAEtD,MAAM,mCAAA,IAAuC,CAAC,OAAO,GAAY,EAAE,KAAK;AACxE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,OAAO,EAAE;AACnB;AACA,MAAM,kBAAkB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,KAAc;AA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AAE,CAAC,gCAAgC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/D,YAAY,KAAK,EAAE,SAAS;AAC5B,YAAY,IAAI;AAChB,WAAW,CAAC;AACZ;AACA;AACA,KAAK;AACL,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS;AAC1B,MAAM,IAAI,CAAC,SAAS,EAAE;AACtB,QAAQ,SAAA,GAAY,IAAI;;AAExB,QAAQ,aAAa,CAAC;AACtB,UAAU,QAAQ,EAAE,eAAe;AACnC,UAAU,OAAO,EAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,UAAU,KAAK,EAAE,OAAO;AACxB,UAAU,IAAI;AACd,SAAS,CAAC;AACV;AACA,KAAK,CAAC;AACN;;AAEA,SAAS,yBAAyB,CAAC,MAAM,EAAgB;AACzD,EAAE,IAAI,QAAQ;;AAEd,EAAE;AACF,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM;AACxB,MAAM,QAAS,GAAE,MAAM,CAAC,QAAQ;AAChC,KAAK;AACL,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS;AAC1B,MAAM,aAAa,CAAC;AACpB,QAAQ,QAAQ,EAAE,eAAe;AACjC,QAAQ,OAAO,EAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAChE,QAAQ,KAAK,EAAE,OAAO;AACtB,QAAQ,IAAI,EAAE,EAAE,QAAA,EAAU;AAC1B,OAAO,CAAC;AACR,KAAK,CAAC;AACN;;;;"}
@@ -1,14 +0,0 @@
1
- interface Options {
2
- /**
3
- * Whether to include child process arguments in breadcrumbs data.
4
- *
5
- * @default false
6
- */
7
- includeChildProcessArgs?: boolean;
8
- }
9
- /**
10
- * Capture breadcrumbs for child processes and worker threads.
11
- */
12
- export declare const processThreadBreadcrumbIntegration: (options?: Options | undefined) => import("@sentry/types").Integration;
13
- export {};
14
- //# sourceMappingURL=processThread.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processThread.d.ts","sourceRoot":"","sources":["../../../src/integrations/processThread.ts"],"names":[],"mappings":"AAMA,UAAU,OAAO;IACf;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAyBD;;GAEG;AACH,eAAO,MAAM,kCAAkC,wEAAyD,CAAC"}
@@ -1,14 +0,0 @@
1
- interface Options {
2
- /**
3
- * Whether to include child process arguments in breadcrumbs data.
4
- *
5
- * @default false
6
- */
7
- includeChildProcessArgs?: boolean;
8
- }
9
- /**
10
- * Capture breadcrumbs for child processes and worker threads.
11
- */
12
- export declare const processThreadBreadcrumbIntegration: (options?: Options | undefined) => import("@sentry/types").Integration;
13
- export {};
14
- //# sourceMappingURL=processThread.d.ts.map