@sentry/node 11.0.0-alpha.0 → 11.0.0-alpha.2

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 (174) hide show
  1. package/build/cjs/bundler-plugin/esbuild.js.map +1 -1
  2. package/build/cjs/bundler-plugin/rollup.js.map +1 -1
  3. package/build/cjs/bundler-plugin/vite.js.map +1 -1
  4. package/build/cjs/bundler-plugin/webpack.js.map +1 -1
  5. package/build/cjs/index.js +53 -53
  6. package/build/cjs/integrations/anr/index.js +1 -1
  7. package/build/cjs/integrations/childProcess.js +0 -24
  8. package/build/cjs/integrations/childProcess.js.map +1 -1
  9. package/build/cjs/integrations/fs/vendored/instrumentation.js +2 -1
  10. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -1
  11. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +2 -8
  12. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  13. package/build/cjs/integrations/http/httpServerIntegration.js.map +1 -1
  14. package/build/cjs/integrations/http/httpServerSpansIntegration.js +34 -62
  15. package/build/cjs/integrations/http/httpServerSpansIntegration.js.map +1 -1
  16. package/build/cjs/integrations/http/index.js +9 -27
  17. package/build/cjs/integrations/http/index.js.map +1 -1
  18. package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
  19. package/build/cjs/integrations/node-fetch/undici-instrumentation.js +3 -5
  20. package/build/cjs/integrations/node-fetch/undici-instrumentation.js.map +1 -1
  21. package/build/cjs/integrations/pino.js +2 -3
  22. package/build/cjs/integrations/pino.js.map +1 -1
  23. package/build/cjs/integrations/processSession.js +1 -1
  24. package/build/cjs/integrations/processSession.js.map +1 -1
  25. package/build/cjs/integrations/tracing/hapi.js +10 -0
  26. package/build/cjs/integrations/tracing/hapi.js.map +1 -0
  27. package/build/cjs/integrations/tracing/index.js +1 -34
  28. package/build/cjs/integrations/tracing/index.js.map +1 -1
  29. package/build/cjs/integrations/tracing/koa.js +10 -0
  30. package/build/cjs/integrations/tracing/koa.js.map +1 -0
  31. package/build/cjs/integrations/workerThreads.js +35 -0
  32. package/build/cjs/integrations/workerThreads.js.map +1 -0
  33. package/build/cjs/sdk/client.js +23 -13
  34. package/build/cjs/sdk/client.js.map +1 -1
  35. package/build/cjs/sdk/index.js +19 -34
  36. package/build/cjs/sdk/index.js.map +1 -1
  37. package/build/cjs/sdk/initOtel.js +1 -10
  38. package/build/cjs/sdk/initOtel.js.map +1 -1
  39. package/build/cjs/transports/http.js +10 -3
  40. package/build/cjs/transports/http.js.map +1 -1
  41. package/build/cjs/utils/outgoingFetchRequest.js +1 -1
  42. package/build/cjs/utils/outgoingFetchRequest.js.map +1 -1
  43. package/build/esm/bundler-plugin/esbuild.js.map +1 -1
  44. package/build/esm/bundler-plugin/rollup.js.map +1 -1
  45. package/build/esm/bundler-plugin/vite.js.map +1 -1
  46. package/build/esm/bundler-plugin/webpack.js.map +1 -1
  47. package/build/esm/index.js +6 -8
  48. package/build/esm/index.js.map +1 -1
  49. package/build/esm/integrations/anr/index.js +1 -1
  50. package/build/esm/integrations/anr/worker-script.js +2 -2
  51. package/build/esm/integrations/childProcess.js +1 -25
  52. package/build/esm/integrations/childProcess.js.map +1 -1
  53. package/build/esm/integrations/fs/vendored/instrumentation.js +2 -1
  54. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -1
  55. package/build/esm/integrations/http/SentryHttpInstrumentation.js +3 -9
  56. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  57. package/build/esm/integrations/http/httpServerIntegration.js.map +1 -1
  58. package/build/esm/integrations/http/httpServerSpansIntegration.js +36 -64
  59. package/build/esm/integrations/http/httpServerSpansIntegration.js.map +1 -1
  60. package/build/esm/integrations/http/index.js +10 -28
  61. package/build/esm/integrations/http/index.js.map +1 -1
  62. package/build/esm/integrations/local-variables/local-variables-async.js +1 -1
  63. package/build/esm/integrations/local-variables/worker-script.js +1 -1
  64. package/build/esm/integrations/node-fetch/undici-instrumentation.js +5 -7
  65. package/build/esm/integrations/node-fetch/undici-instrumentation.js.map +1 -1
  66. package/build/esm/integrations/pino.js +2 -3
  67. package/build/esm/integrations/pino.js.map +1 -1
  68. package/build/esm/integrations/processSession.js +1 -1
  69. package/build/esm/integrations/processSession.js.map +1 -1
  70. package/build/esm/integrations/tracing/hapi.js +8 -0
  71. package/build/esm/integrations/tracing/hapi.js.map +1 -0
  72. package/build/esm/integrations/tracing/index.js +2 -35
  73. package/build/esm/integrations/tracing/index.js.map +1 -1
  74. package/build/esm/integrations/tracing/koa.js +8 -0
  75. package/build/esm/integrations/tracing/koa.js.map +1 -0
  76. package/build/esm/integrations/workerThreads.js +33 -0
  77. package/build/esm/integrations/workerThreads.js.map +1 -0
  78. package/build/esm/package.json +1 -1
  79. package/build/esm/sdk/client.js +23 -13
  80. package/build/esm/sdk/client.js.map +1 -1
  81. package/build/esm/sdk/index.js +14 -29
  82. package/build/esm/sdk/index.js.map +1 -1
  83. package/build/esm/sdk/initOtel.js +4 -12
  84. package/build/esm/sdk/initOtel.js.map +1 -1
  85. package/build/esm/transports/http.js +10 -3
  86. package/build/esm/transports/http.js.map +1 -1
  87. package/build/esm/utils/outgoingFetchRequest.js +2 -2
  88. package/build/esm/utils/outgoingFetchRequest.js.map +1 -1
  89. package/build/types/bundler-plugin/esbuild.d.ts +3 -4
  90. package/build/types/bundler-plugin/esbuild.d.ts.map +1 -1
  91. package/build/types/bundler-plugin/rollup.d.ts +3 -4
  92. package/build/types/bundler-plugin/rollup.d.ts.map +1 -1
  93. package/build/types/bundler-plugin/vite.d.ts +3 -4
  94. package/build/types/bundler-plugin/vite.d.ts.map +1 -1
  95. package/build/types/bundler-plugin/webpack.d.ts +2 -2
  96. package/build/types/bundler-plugin/webpack.d.ts.map +1 -1
  97. package/build/types/index.d.ts +7 -7
  98. package/build/types/index.d.ts.map +1 -1
  99. package/build/types/integrations/childProcess.d.ts +2 -7
  100. package/build/types/integrations/childProcess.d.ts.map +1 -1
  101. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -1
  102. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +6 -61
  103. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
  104. package/build/types/integrations/http/httpServerIntegration.d.ts +1 -1
  105. package/build/types/integrations/http/httpServerSpansIntegration.d.ts +1 -9
  106. package/build/types/integrations/http/httpServerSpansIntegration.d.ts.map +1 -1
  107. package/build/types/integrations/http/index.d.ts +16 -74
  108. package/build/types/integrations/http/index.d.ts.map +1 -1
  109. package/build/types/integrations/pino.d.ts.map +1 -1
  110. package/build/types/integrations/tracing/hapi.d.ts +13 -0
  111. package/build/types/integrations/tracing/hapi.d.ts.map +1 -0
  112. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  113. package/build/types/integrations/tracing/koa.d.ts +27 -0
  114. package/build/types/integrations/tracing/koa.d.ts.map +1 -0
  115. package/build/types/integrations/workerThreads.d.ts +8 -0
  116. package/build/types/integrations/workerThreads.d.ts.map +1 -0
  117. package/build/types/sdk/client.d.ts +2 -0
  118. package/build/types/sdk/client.d.ts.map +1 -1
  119. package/build/types/sdk/index.d.ts.map +1 -1
  120. package/build/types/sdk/initOtel.d.ts +0 -9
  121. package/build/types/sdk/initOtel.d.ts.map +1 -1
  122. package/build/types/transports/http.d.ts +1 -1
  123. package/build/types/transports/http.d.ts.map +1 -1
  124. package/build/types/types.d.ts +18 -35
  125. package/build/types/types.d.ts.map +1 -1
  126. package/package.json +7 -6
  127. package/build/cjs/integrations/tracing/express.js +0 -11
  128. package/build/cjs/integrations/tracing/express.js.map +0 -1
  129. package/build/cjs/integrations/tracing/fastify/index.js +0 -40
  130. package/build/cjs/integrations/tracing/fastify/index.js.map +0 -1
  131. package/build/cjs/integrations/tracing/hapi/index.js +0 -44
  132. package/build/cjs/integrations/tracing/hapi/index.js.map +0 -1
  133. package/build/cjs/integrations/tracing/koa/index.js +0 -22
  134. package/build/cjs/integrations/tracing/koa/index.js.map +0 -1
  135. package/build/cjs/integrations/tracing/redis/cache.js +0 -42
  136. package/build/cjs/integrations/tracing/redis/cache.js.map +0 -1
  137. package/build/cjs/integrations/tracing/redis/index.js +0 -34
  138. package/build/cjs/integrations/tracing/redis/index.js.map +0 -1
  139. package/build/cjs/utils/redisCache.js +0 -98
  140. package/build/cjs/utils/redisCache.js.map +0 -1
  141. package/build/esm/integrations/tracing/express.js +0 -9
  142. package/build/esm/integrations/tracing/express.js.map +0 -1
  143. package/build/esm/integrations/tracing/fastify/index.js +0 -37
  144. package/build/esm/integrations/tracing/fastify/index.js.map +0 -1
  145. package/build/esm/integrations/tracing/hapi/index.js +0 -41
  146. package/build/esm/integrations/tracing/hapi/index.js.map +0 -1
  147. package/build/esm/integrations/tracing/koa/index.js +0 -20
  148. package/build/esm/integrations/tracing/koa/index.js.map +0 -1
  149. package/build/esm/integrations/tracing/redis/cache.js +0 -39
  150. package/build/esm/integrations/tracing/redis/cache.js.map +0 -1
  151. package/build/esm/integrations/tracing/redis/index.js +0 -28
  152. package/build/esm/integrations/tracing/redis/index.js.map +0 -1
  153. package/build/esm/utils/redisCache.js +0 -89
  154. package/build/esm/utils/redisCache.js.map +0 -1
  155. package/build/types/integrations/tracing/express.d.ts +0 -6
  156. package/build/types/integrations/tracing/express.d.ts.map +0 -1
  157. package/build/types/integrations/tracing/fastify/index.d.ts +0 -115
  158. package/build/types/integrations/tracing/fastify/index.d.ts.map +0 -1
  159. package/build/types/integrations/tracing/fastify/types.d.ts +0 -33
  160. package/build/types/integrations/tracing/fastify/types.d.ts.map +0 -1
  161. package/build/types/integrations/tracing/hapi/index.d.ts +0 -29
  162. package/build/types/integrations/tracing/hapi/index.d.ts.map +0 -1
  163. package/build/types/integrations/tracing/hapi/types.d.ts +0 -166
  164. package/build/types/integrations/tracing/hapi/types.d.ts.map +0 -1
  165. package/build/types/integrations/tracing/koa/index.d.ts +0 -26
  166. package/build/types/integrations/tracing/koa/index.d.ts.map +0 -1
  167. package/build/types/integrations/tracing/redis/cache.d.ts +0 -22
  168. package/build/types/integrations/tracing/redis/cache.d.ts.map +0 -1
  169. package/build/types/integrations/tracing/redis/index.d.ts +0 -21
  170. package/build/types/integrations/tracing/redis/index.d.ts.map +0 -1
  171. package/build/types/integrations/tracing/redis/vendored/types.d.ts +0 -9
  172. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +0 -1
  173. package/build/types/utils/redisCache.d.ts +0 -17
  174. package/build/types/utils/redisCache.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"redisCache.js","sources":["../../../src/utils/redisCache.ts"],"sourcesContent":["export type IORedisCommandArgs = Array<string | Buffer | number | unknown[]>;\n\nconst SINGLE_ARG_COMMANDS = ['get', 'set', 'setex'];\n\nexport const GET_COMMANDS = ['get', 'mget'];\nexport const SET_COMMANDS = ['set', 'setex'];\nexport const REMOVE_COMMANDS = ['del', 'unlink'];\n// todo: expire (no matching cache convention op yet)\n\n/** Checks if a given command is in the list of redis commands.\n * Useful because commands can come in lowercase or uppercase (depending on the library). */\nexport function isInCommands(redisCommands: string[], command: string): boolean {\n return redisCommands.includes(command.toLowerCase());\n}\n\n/** Determine cache operation based on redis statement */\nexport function getCacheOperation(command: string): 'cache.get' | 'cache.put' | 'cache.remove' | undefined {\n if (isInCommands(GET_COMMANDS, command)) {\n return 'cache.get';\n } else if (isInCommands(SET_COMMANDS, command)) {\n return 'cache.put';\n } else if (isInCommands(REMOVE_COMMANDS, command)) {\n return 'cache.remove';\n } else {\n return undefined;\n }\n}\n\nfunction keyHasPrefix(key: string, prefixes: string[]): boolean {\n return prefixes.some(prefix => key.startsWith(prefix));\n}\n\n/** Safely converts a redis key to a string (comma-separated if there are multiple keys) */\nexport function getCacheKeySafely(redisCommand: string, cmdArgs: IORedisCommandArgs): string[] | undefined {\n try {\n if (cmdArgs.length === 0) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const processArg = (arg: string | Buffer | number | any[]): string[] => {\n if (typeof arg === 'string' || typeof arg === 'number' || Buffer.isBuffer(arg)) {\n return [arg.toString()];\n } else if (Array.isArray(arg)) {\n return flatten(arg.map(arg => processArg(arg)));\n } else {\n return ['<unknown>'];\n }\n };\n\n const firstArg = cmdArgs[0];\n if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && firstArg != null) {\n return processArg(firstArg);\n }\n\n return flatten(cmdArgs.map(arg => processArg(arg)));\n } catch {\n return undefined;\n }\n}\n\n/** Determines whether a redis operation should be considered as \"cache operation\" by checking if a key is prefixed.\n * We only support certain commands (such as 'set', 'get', 'mget'). */\nexport function shouldConsiderForCache(redisCommand: string, keys: string[], prefixes: string[]): boolean {\n if (!getCacheOperation(redisCommand)) {\n return false;\n }\n\n for (const key of keys) {\n if (keyHasPrefix(key, prefixes)) {\n return true;\n }\n }\n return false;\n}\n\n/** Calculates size based on the cache response value */\nexport function calculateCacheItemSize(response: unknown): number | undefined {\n const getSize = (value: unknown): number | undefined => {\n try {\n if (Buffer.isBuffer(value)) return value.byteLength;\n else if (typeof value === 'string') return value.length;\n else if (typeof value === 'number') return value.toString().length;\n else if (value === null || value === undefined) return 0;\n return JSON.stringify(value).length;\n } catch {\n return undefined;\n }\n };\n\n return Array.isArray(response)\n ? response.reduce((acc: number | undefined, curr) => {\n const size = getSize(curr);\n return typeof size === 'number' ? (acc !== undefined ? acc + size : size) : acc;\n }, 0)\n : getSize(response);\n}\n\ntype NestedArray<T> = Array<NestedArray<T> | T>;\n\nfunction flatten<T>(input: NestedArray<T>): T[] {\n const result: T[] = [];\n\n const flattenHelper = (input: NestedArray<T>): void => {\n input.forEach((el: T | NestedArray<T>) => {\n if (Array.isArray(el)) {\n flattenHelper(el);\n } else {\n result.push(el);\n }\n });\n };\n\n flattenHelper(input);\n return result;\n}\n"],"names":["arg","input"],"mappings":"AAEA,MAAM,mBAAA,GAAsB,CAAC,KAAA,EAAO,KAAA,EAAO,OAAO,CAAA;AAE3C,MAAM,YAAA,GAAe,CAAC,KAAA,EAAO,MAAM;AACnC,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CAAA;AACvD,MAAA,OAAO,IAAA,CAAK,SAAA,CAAU,KAAK,CAAA,CAAE,MAAA;AAAA,IAC/B,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,MAAA;AAAA,IACT;AAAA,EACF,CAAA;AAEA,EAAA,OAAO,KAAA,CAAM,QAAQ,QAAQ,CAAA,GACzB,SAAS,MAAA,CAAO,CAAC,KAAyB,IAAA,KAAS;AACjD,IAAA,MAAM,IAAA,GAAO,QAAQ,IAAI,CAAA;AACzB,IAAA,OAAO,OAAO,IAAA,KAAS,QAAA,GAAY,QAAQ,MAAA,GAAY,GAAA,GAAM,OAAO,IAAA,GAAQ,GAAA;AAAA,EAC9E,CAAA,EAAG,CAAC,CAAA,GACJ,OAAA,CAAQ,QAAQ,CAAA;AACtB;AAIA,SAAS,QAAW,KAAA,EAA4B;AAC9C,EAAA,MAAM,SAAc,EAAC;AAErB,EAAA,MAAM,aAAA,GAAgB,CAACC,MAAAA,KAAgC;AACrD,IAAAA,MAAAA,CAAM,OAAA,CAAQ,CAAC,EAAA,KAA2B;AACxC,MAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,EAAE,CAAA,EAAG;AACrB,QAAA,aAAA,CAAc,EAAE,CAAA;AAAA,MAClB,CAAA,MAAO;AACL,QAAA,MAAA,CAAO,KAAK,EAAE,CAAA;AAAA,MAChB;AAAA,IACF,CAAC,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,aAAA,CAAc,KAAK,CAAA;AACnB,EAAA,OAAO,MAAA;AACT;;;;"}
@@ -1,6 +0,0 @@
1
- import { type ExpressHandlerOptions } from '@sentry/core';
2
- export { expressErrorHandler } from '@sentry/core';
3
- export declare function setupExpressErrorHandler(app: {
4
- use: (middleware: any) => unknown;
5
- }, options?: ExpressHandlerOptions): void;
6
- //# sourceMappingURL=express.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/express.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4D,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,wBAAgB,wBAAwB,CAEtC,GAAG,EAAE;IAAE,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,EAC1C,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAEN"}
@@ -1,115 +0,0 @@
1
- import type { Integration } from '@sentry/core';
2
- import type { FastifyMinimal, FastifyReply, FastifyRequest } from './types';
3
- import { instrumentFastify } from '@sentry/server-utils';
4
- export { instrumentFastify };
5
- /**
6
- * Options for the Fastify integration.
7
- *
8
- * `shouldHandleError` - Callback method deciding whether error should be captured and sent to Sentry
9
- * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.
10
- * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.
11
- *
12
- * @example
13
- *
14
- * ```javascript
15
- * Sentry.init({
16
- * integrations: [
17
- * Sentry.fastifyIntegration({
18
- * shouldHandleError(_error, _request, reply) {
19
- * return reply.statusCode >= 500;
20
- * },
21
- * });
22
- * },
23
- * });
24
- * ```
25
- *
26
- */
27
- interface FastifyIntegrationOptions {
28
- /**
29
- * Callback method deciding whether error should be captured and sent to Sentry
30
- * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.
31
- * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.
32
- *
33
- * @param error Captured Fastify error
34
- * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)
35
- * @param reply Fastify reply (or any object containing at least statusCode)
36
- */
37
- shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;
38
- }
39
- interface FastifyHandlerOptions {
40
- /**
41
- * Callback method deciding whether error should be captured and sent to Sentry
42
- *
43
- * @param error Captured Fastify error
44
- * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)
45
- * @param reply Fastify reply (or any object containing at least statusCode)
46
- *
47
- * @example
48
- *
49
- *
50
- * ```javascript
51
- * setupFastifyErrorHandler(app, {
52
- * shouldHandleError(_error, _request, reply) {
53
- * return reply.statusCode >= 400;
54
- * },
55
- * });
56
- * ```
57
- *
58
- *
59
- * If using TypeScript, you can cast the request and reply to get full type safety.
60
- *
61
- * ```typescript
62
- * import type { FastifyRequest, FastifyReply } from 'fastify';
63
- *
64
- * setupFastifyErrorHandler(app, {
65
- * shouldHandleError(error, minimalRequest, minimalReply) {
66
- * const request = minimalRequest as FastifyRequest;
67
- * const reply = minimalReply as FastifyReply;
68
- * return reply.statusCode >= 500;
69
- * },
70
- * });
71
- * ```
72
- */
73
- shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;
74
- }
75
- /**
76
- * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).
77
- *
78
- * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.
79
- *
80
- * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).
81
- *
82
- * @example
83
- * ```javascript
84
- * const Sentry = require('@sentry/node');
85
- *
86
- * Sentry.init({
87
- * integrations: [Sentry.fastifyIntegration()],
88
- * })
89
- * ```
90
- */
91
- export declare const fastifyIntegration: (options?: Partial<FastifyIntegrationOptions> | undefined) => Integration & {
92
- name: "Fastify";
93
- };
94
- /**
95
- * Add an Fastify error handler to capture errors to Sentry.
96
- *
97
- * @param fastify The Fastify instance to which to add the error handler
98
- * @param options Configuration options for the handler
99
- *
100
- * @example
101
- * ```javascript
102
- * const Sentry = require('@sentry/node');
103
- * const Fastify = require("fastify");
104
- *
105
- * const app = Fastify();
106
- *
107
- * Sentry.setupFastifyErrorHandler(app);
108
- *
109
- * // Add your routes, etc.
110
- *
111
- * app.listen({ port: 3000 });
112
- * ```
113
- */
114
- export declare function setupFastifyErrorHandler(fastify: FastifyMinimal, options?: Partial<FastifyHandlerOptions>): void;
115
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/fastify/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAmB,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAEL,iBAAiB,EAElB,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,UAAU,yBAAyB;IACjC;;;;;;;;OAQG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;CAC5F;AAED,UAAU,qBAAqB;IAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,iBAAiB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;CAC5F;AAaD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB;;CAE9B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAoBhH"}
@@ -1,33 +0,0 @@
1
- export type HandlerOriginal = ((request: FastifyRequest, reply: FastifyReply, done: HookHandlerDoneFunction) => Promise<void>) | ((request: FastifyRequest, reply: FastifyReply, done: HookHandlerDoneFunction) => void);
2
- export type FastifyError = any;
3
- export type HookHandlerDoneFunction = <TError extends Error = FastifyError>(err?: TError) => void;
4
- export type FastifyErrorCodes = any;
5
- export type FastifyPlugin = (instance: FastifyInstance, opts: any, done: HookHandlerDoneFunction) => unknown | Promise<unknown>;
6
- export interface FastifyInstance {
7
- version: string;
8
- register: (plugin: any) => FastifyInstance;
9
- after: (listener?: (err: Error) => void) => FastifyInstance;
10
- addHook(hook: string, handler: HandlerOriginal): FastifyInstance;
11
- addHook(hook: 'onError', handler: (request: FastifyRequest, reply: FastifyReply, error: Error) => void): FastifyInstance;
12
- addHook(hook: 'onRequest', handler: (request: FastifyRequest, reply: FastifyReply) => void): FastifyInstance;
13
- }
14
- /**
15
- * Minimal type for `setupFastifyErrorHandler` parameter.
16
- * Uses structural typing without overloads to avoid exactOptionalPropertyTypes issues.
17
- * https://github.com/getsentry/sentry-javascript/issues/18619
18
- */
19
- export type FastifyMinimal = {
20
- register: (plugin: (instance: any, opts: any, done: () => void) => void) => unknown;
21
- };
22
- export interface FastifyReply {
23
- send: () => FastifyReply;
24
- statusCode: number;
25
- }
26
- export interface FastifyRequest {
27
- method?: string;
28
- routeOptions?: {
29
- url?: string;
30
- };
31
- routerPath?: string;
32
- }
33
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/fastify/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,eAAe,GACvB,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAChG,CAAC,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,uBAAuB,KAAK,IAAI,CAAC,CAAC;AAE5F,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC;AAE/B,MAAM,MAAM,uBAAuB,GAAG,CAAC,MAAM,SAAS,KAAK,GAAG,YAAY,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;AAElG,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAEpC,MAAM,MAAM,aAAa,GAAG,CAC1B,QAAQ,EAAE,eAAe,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;
4
- version: string;
5
- register: (serverArg: Record<any, any>) => Promise<void>;
6
- };
7
- /**
8
- * Add a Hapi plugin to capture errors to Sentry.
9
- *
10
- * @param server The Hapi server to attach the error handler to
11
- *
12
- * @example
13
- * ```javascript
14
- * const Sentry = require('@sentry/node');
15
- * const Hapi = require('@hapi/hapi');
16
- *
17
- * const init = async () => {
18
- * const server = Hapi.server();
19
- *
20
- * // all your routes here
21
- *
22
- * await Sentry.setupHapiErrorHandler(server);
23
- *
24
- * await server.start();
25
- * };
26
- * ```
27
- */
28
- export declare function setupHapiErrorHandler(server: Server): Promise<void>;
29
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/hapi/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,MAAM,EAAE,MAAM,SAAS,CAAC;AAe7D,eAAO,MAAM,eAAe;IAC1B,IAAI;IACJ,OAAO;IAEP,QAAQ,cAA6B,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;CAmBtD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE"}
@@ -1,166 +0,0 @@
1
- import type * as stream from 'stream';
2
- interface Podium {
3
- new (events?: Events[]): Podium;
4
- new (events?: Events): Podium;
5
- registerEvent(events: Events[]): void;
6
- registerEvent(events: Events): void;
7
- registerPodium?(podiums: Podium[]): void;
8
- registerPodium?(podiums: Podium): void;
9
- emit(criteria: string | {
10
- name: string;
11
- channel?: string | undefined;
12
- tags?: string | string[] | undefined;
13
- }, data: any, callback?: () => void): void;
14
- on(criteria: string | Criteria, listener: Listener): void;
15
- addListener(criteria: string | Criteria, listener: Listener): void;
16
- once(criteria: string | Criteria, listener: Listener): void;
17
- removeListener(name: string, listener: Listener): Podium;
18
- removeAllListeners(name: string): Podium;
19
- hasListeners(name: string): boolean;
20
- }
21
- export interface Boom<Data = any> extends Error {
22
- isBoom: boolean;
23
- isServer: boolean;
24
- message: string;
25
- output: Output;
26
- reformat: () => string;
27
- isMissing?: boolean | undefined;
28
- data: Data;
29
- }
30
- export interface Output {
31
- statusCode: number;
32
- headers: {
33
- [index: string]: string;
34
- };
35
- payload: Payload;
36
- }
37
- export interface Payload {
38
- statusCode: number;
39
- error: string;
40
- message: string;
41
- attributes?: any;
42
- }
43
- export type Events = string | EventOptionsObject | Podium;
44
- export interface EventOptionsObject {
45
- name: string;
46
- channels?: string | string[] | undefined;
47
- clone?: boolean | undefined;
48
- spread?: boolean | undefined;
49
- tags?: boolean | undefined;
50
- shared?: boolean | undefined;
51
- }
52
- export interface CriteriaObject {
53
- name: string;
54
- block?: boolean | number | undefined;
55
- channels?: string | string[] | undefined;
56
- clone?: boolean | undefined;
57
- count?: number | undefined;
58
- filter?: string | string[] | CriteriaFilterOptionsObject | undefined;
59
- spread?: boolean | undefined;
60
- tags?: boolean | undefined;
61
- listener?: Listener | undefined;
62
- }
63
- export interface CriteriaFilterOptionsObject {
64
- tags?: string | string[] | undefined;
65
- all?: boolean | undefined;
66
- }
67
- export type Criteria = string | CriteriaObject;
68
- export interface Listener {
69
- (data: any, tags?: Tags, callback?: () => void): void;
70
- }
71
- export type Tags = {
72
- [tag: string]: boolean;
73
- };
74
- interface UserCredentials {
75
- }
76
- interface AppCredentials {
77
- }
78
- interface AuthCredentials {
79
- scope?: string[] | undefined;
80
- user?: UserCredentials | undefined;
81
- app?: AppCredentials | undefined;
82
- }
83
- interface RequestAuth {
84
- artifacts: object;
85
- credentials: AuthCredentials;
86
- error: Error;
87
- isAuthenticated: boolean;
88
- isAuthorized: boolean;
89
- mode: string;
90
- strategy: string;
91
- }
92
- interface RequestEvents extends Podium {
93
- on(criteria: 'peek', listener: PeekListener): void;
94
- on(criteria: 'finish' | 'disconnect', listener: (data: undefined) => void): void;
95
- once(criteria: 'peek', listener: PeekListener): void;
96
- once(criteria: 'finish' | 'disconnect', listener: (data: undefined) => void): void;
97
- }
98
- declare namespace Lifecycle {
99
- type Method = (request: Request, h: ResponseToolkit, err?: Error) => ReturnValue;
100
- type ReturnValue = ReturnValueTypes | Promise<ReturnValueTypes>;
101
- type ReturnValueTypes = (null | string | number | boolean) | Buffer | (Error | Boom) | stream.Stream | (object | object[]) | symbol | ResponseToolkit;
102
- type FailAction = 'error' | 'log' | 'ignore' | Method;
103
- }
104
- declare namespace Util {
105
- interface Dictionary<T> {
106
- [key: string]: T;
107
- }
108
- type HTTP_METHODS_PARTIAL_LOWERCASE = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'options';
109
- type HTTP_METHODS_PARTIAL = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | HTTP_METHODS_PARTIAL_LOWERCASE;
110
- type HTTP_METHODS = 'HEAD' | 'head' | HTTP_METHODS_PARTIAL;
111
- }
112
- interface RequestRoute {
113
- method: Util.HTTP_METHODS_PARTIAL;
114
- path: string;
115
- vhost?: string | string[] | undefined;
116
- realm: any;
117
- fingerprint: string;
118
- auth: {
119
- access(request: Request): boolean;
120
- };
121
- }
122
- export interface Request extends Podium {
123
- app: ApplicationState;
124
- readonly auth: RequestAuth;
125
- events: RequestEvents;
126
- readonly headers: Util.Dictionary<string>;
127
- readonly path: string;
128
- response: ResponseObject | Boom | null;
129
- readonly route: RequestRoute;
130
- readonly url: URL;
131
- }
132
- interface ResponseObjectHeaderOptions {
133
- append?: boolean | undefined;
134
- separator?: string | undefined;
135
- override?: boolean | undefined;
136
- duplicate?: boolean | undefined;
137
- }
138
- export interface ResponseObject extends Podium {
139
- readonly statusCode: number;
140
- header(name: string, value: string, options?: ResponseObjectHeaderOptions): ResponseObject;
141
- }
142
- interface ResponseToolkit {
143
- readonly continue: symbol;
144
- }
145
- export interface RequestEvent {
146
- timestamp: string;
147
- tags: string[];
148
- channel: 'internal' | 'app' | 'error';
149
- data: object;
150
- error: object;
151
- }
152
- interface ServerEvents {
153
- on(criteria: any, listener: any): void;
154
- }
155
- export type Server = Record<string, any> & {
156
- events: ServerEvents;
157
- register: any;
158
- ext(event: any, method: Lifecycle.Method, options?: Record<string, any>): void;
159
- initialize(): Promise<void>;
160
- start(): Promise<void>;
161
- };
162
- interface ApplicationState {
163
- }
164
- type PeekListener = (chunk: string, encoding: string) => void;
165
- export {};
166
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/hapi/types.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEtC,UAAU,MAAM;IACd,KAAK,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAChC,KAAK,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE9B,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACtC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC,cAAc,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzC,cAAc,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvC,IAAI,CACF,QAAQ,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,EACvG,IAAI,EAAE,GAAG,EACT,QAAQ,CAAC,EAAE,MAAM,IAAI,GACpB,IAAI,CAAC;IAER,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1D,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,QAAQ,EAAE,QAA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2
- * Add an Koa error handler to capture errors to Sentry.
3
- *
4
- * The error handler must be before any other middleware and after all controllers.
5
- *
6
- * @param app The Express instances
7
- * @param options {ExpressHandlerOptions} Configuration options for the handler
8
- *
9
- * @example
10
- * ```javascript
11
- * const Sentry = require('@sentry/node');
12
- * const Koa = require("koa");
13
- *
14
- * const app = new Koa();
15
- *
16
- * Sentry.setupKoaErrorHandler(app);
17
- *
18
- * // Add your routes, etc.
19
- *
20
- * app.listen(3000);
21
- * ```
22
- */
23
- export declare const setupKoaErrorHandler: (app: {
24
- use: (arg0: (ctx: any, next: any) => Promise<void>) => void;
25
- }) => void;
26
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/koa/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,oBAAoB,QAAS;IAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAA;CAAE,KAAG,IAc3G,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { IORedisResponseCustomAttributeFunction } from './vendored/types';
2
- export interface RedisOptions {
3
- /**
4
- * Define cache prefixes for cache keys that should be captured as a cache span.
5
- *
6
- * Setting this to, for example, `['user:']` will capture cache keys that start with `user:`.
7
- */
8
- cachePrefixes?: string[];
9
- /**
10
- * Maximum length of the cache key added to the span description. If the key exceeds this length, it will be truncated.
11
- *
12
- * Passing `0` will use the full cache key without truncation.
13
- *
14
- * By default, the full cache key is used.
15
- */
16
- maxCacheKeyLength?: number;
17
- }
18
- export declare let _redisOptions: RedisOptions;
19
- /** Set the options consumed by {@link cacheResponseHook}. */
20
- export declare function setRedisOptions(options: RedisOptions): void;
21
- export declare const cacheResponseHook: IORedisResponseCustomAttributeFunction;
22
- //# sourceMappingURL=cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/redis/cache.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,kBAAkB,CAAC;AAM/E,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAGD,eAAO,IAAI,aAAa,EAAE,YAAiB,CAAC;AAE5C,6DAA6D;AAC7D,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAE3D;AAGD,eAAO,MAAM,iBAAiB,EAAE,sCAsD/B,CAAC"}
@@ -1,21 +0,0 @@
1
- import { type RedisOptions } from './cache';
2
- export { _redisOptions, cacheResponseHook } from './cache';
3
- /**
4
- * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and
5
- * [ioredis](https://www.npmjs.com/package/ioredis) libraries.
6
- *
7
- * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/).
8
- *
9
- * @example
10
- * ```javascript
11
- * const Sentry = require('@sentry/node');
12
- *
13
- * Sentry.init({
14
- * integrations: [Sentry.redisIntegration()],
15
- * });
16
- * ```
17
- */
18
- export declare const redisIntegration: (options?: RedisOptions | undefined) => import("@sentry/core").Integration & {
19
- name: "Redis";
20
- };
21
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,YAAY,EAAmB,MAAM,SAAS,CAAC;AAKhF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA8B3D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB;;CAAuC,CAAC"}
@@ -1,9 +0,0 @@
1
- import type { Span } from '@sentry/core';
2
- export type CommandArgs = Array<string | Buffer | number | any[]>;
3
- /**
4
- * Function that can be used to add custom attributes to span on response from redis server (ioredis)
5
- */
6
- export interface IORedisResponseCustomAttributeFunction {
7
- (span: Span, cmdName: string, cmdArgs: CommandArgs, response: unknown): void;
8
- }
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/redis/vendored/types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,sCAAsC;IACrD,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9E"}
@@ -1,17 +0,0 @@
1
- export type IORedisCommandArgs = Array<string | Buffer | number | unknown[]>;
2
- export declare const GET_COMMANDS: string[];
3
- export declare const SET_COMMANDS: string[];
4
- export declare const REMOVE_COMMANDS: string[];
5
- /** Checks if a given command is in the list of redis commands.
6
- * Useful because commands can come in lowercase or uppercase (depending on the library). */
7
- export declare function isInCommands(redisCommands: string[], command: string): boolean;
8
- /** Determine cache operation based on redis statement */
9
- export declare function getCacheOperation(command: string): 'cache.get' | 'cache.put' | 'cache.remove' | undefined;
10
- /** Safely converts a redis key to a string (comma-separated if there are multiple keys) */
11
- export declare function getCacheKeySafely(redisCommand: string, cmdArgs: IORedisCommandArgs): string[] | undefined;
12
- /** Determines whether a redis operation should be considered as "cache operation" by checking if a key is prefixed.
13
- * We only support certain commands (such as 'set', 'get', 'mget'). */
14
- export declare function shouldConsiderForCache(redisCommand: string, keys: string[], prefixes: string[]): boolean;
15
- /** Calculates size based on the cache response value */
16
- export declare function calculateCacheItemSize(response: unknown): number | undefined;
17
- //# sourceMappingURL=redisCache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redisCache.d.ts","sourceRoot":"","sources":["../../../src/utils/redisCache.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC,CAAC;AAI7E,eAAO,MAAM,YAAY,UAAkB,CAAC;AAC5C,eAAO,MAAM,YAAY,UAAmB,CAAC;AAC7C,eAAO,MAAM,eAAe,UAAoB,CAAC;AAGjD;6FAC6F;AAC7F,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9E;AAED,yDAAyD;AACzD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,SAAS,CAUzG;AAMD,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,GAAG,SAAS,CA0BzG;AAED;uEACuE;AACvE,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAWxG;AAED,wDAAwD;AACxD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAmB5E"}