@sentry/server-utils 10.63.0 → 10.64.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 (206) hide show
  1. package/build/cjs/index.js +6 -2
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/tracing-channel/anthropic.js +101 -0
  4. package/build/cjs/integrations/tracing-channel/anthropic.js.map +1 -0
  5. package/build/cjs/integrations/tracing-channel/hapi-types.js +30 -0
  6. package/build/cjs/integrations/tracing-channel/hapi-types.js.map +1 -0
  7. package/build/cjs/integrations/tracing-channel/hapi-utils.js +177 -0
  8. package/build/cjs/integrations/tracing-channel/hapi-utils.js.map +1 -0
  9. package/build/cjs/integrations/tracing-channel/hapi.js +52 -0
  10. package/build/cjs/integrations/tracing-channel/hapi.js.map +1 -0
  11. package/build/cjs/integrations/tracing-channel/ioredis.js +96 -0
  12. package/build/cjs/integrations/tracing-channel/ioredis.js.map +1 -0
  13. package/build/cjs/integrations/tracing-channel/mysql.js +1 -0
  14. package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -1
  15. package/build/cjs/integrations/tracing-channel/openai.js +83 -0
  16. package/build/cjs/integrations/tracing-channel/openai.js.map +1 -0
  17. package/build/cjs/integrations/tracing-channel/postgres.js +170 -0
  18. package/build/cjs/integrations/tracing-channel/postgres.js.map +1 -0
  19. package/build/cjs/integrations/tracing-channel/vercel-ai.js +25 -0
  20. package/build/cjs/integrations/tracing-channel/vercel-ai.js.map +1 -0
  21. package/build/cjs/mongoose/index.js +23 -0
  22. package/build/cjs/mongoose/index.js.map +1 -0
  23. package/build/cjs/mongoose/mongoose-dc-subscriber.js +97 -0
  24. package/build/cjs/mongoose/mongoose-dc-subscriber.js.map +1 -0
  25. package/build/cjs/orchestrion/bundler/vite.js +3 -3
  26. package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
  27. package/build/cjs/orchestrion/channels.js +17 -2
  28. package/build/cjs/orchestrion/channels.js.map +1 -1
  29. package/build/cjs/orchestrion/config/anthropic-ai.js +43 -0
  30. package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -0
  31. package/build/cjs/orchestrion/config/hapi.js +26 -0
  32. package/build/cjs/orchestrion/config/hapi.js.map +1 -0
  33. package/build/cjs/orchestrion/config/index.js +35 -0
  34. package/build/cjs/orchestrion/config/index.js.map +1 -0
  35. package/build/cjs/orchestrion/config/ioredis.js +35 -0
  36. package/build/cjs/orchestrion/config/ioredis.js.map +1 -0
  37. package/build/cjs/orchestrion/config/lru-memoizer.js +17 -0
  38. package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -0
  39. package/build/cjs/orchestrion/config/mysql.js +16 -0
  40. package/build/cjs/orchestrion/config/mysql.js.map +1 -0
  41. package/build/cjs/orchestrion/config/openai.js +40 -0
  42. package/build/cjs/orchestrion/config/openai.js.map +1 -0
  43. package/build/cjs/orchestrion/config/pg.js +51 -0
  44. package/build/cjs/orchestrion/config/pg.js.map +1 -0
  45. package/build/cjs/orchestrion/config/vercel-ai.js +44 -0
  46. package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -0
  47. package/build/cjs/orchestrion/detect.js +6 -1
  48. package/build/cjs/orchestrion/detect.js.map +1 -1
  49. package/build/cjs/orchestrion/index.js +27 -5
  50. package/build/cjs/orchestrion/index.js.map +1 -1
  51. package/build/cjs/orchestrion/runtime/register.js +10 -7
  52. package/build/cjs/orchestrion/runtime/register.js.map +1 -1
  53. package/build/cjs/redis/redis-statement-serializer.js +34 -0
  54. package/build/cjs/redis/redis-statement-serializer.js.map +1 -0
  55. package/build/cjs/tracing-channel.js +1 -1
  56. package/build/cjs/tracing-channel.js.map +1 -1
  57. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +11 -4
  58. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  59. package/build/cjs/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js +256 -0
  60. package/build/cjs/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +1 -0
  61. package/build/esm/index.js +2 -0
  62. package/build/esm/index.js.map +1 -1
  63. package/build/esm/integrations/tracing-channel/anthropic.js +99 -0
  64. package/build/esm/integrations/tracing-channel/anthropic.js.map +1 -0
  65. package/build/esm/integrations/tracing-channel/hapi-types.js +25 -0
  66. package/build/esm/integrations/tracing-channel/hapi-types.js.map +1 -0
  67. package/build/esm/integrations/tracing-channel/hapi-utils.js +172 -0
  68. package/build/esm/integrations/tracing-channel/hapi-utils.js.map +1 -0
  69. package/build/esm/integrations/tracing-channel/hapi.js +50 -0
  70. package/build/esm/integrations/tracing-channel/hapi.js.map +1 -0
  71. package/build/esm/integrations/tracing-channel/ioredis.js +94 -0
  72. package/build/esm/integrations/tracing-channel/ioredis.js.map +1 -0
  73. package/build/esm/integrations/tracing-channel/mysql.js +2 -1
  74. package/build/esm/integrations/tracing-channel/mysql.js.map +1 -1
  75. package/build/esm/integrations/tracing-channel/openai.js +81 -0
  76. package/build/esm/integrations/tracing-channel/openai.js.map +1 -0
  77. package/build/esm/integrations/tracing-channel/postgres.js +168 -0
  78. package/build/esm/integrations/tracing-channel/postgres.js.map +1 -0
  79. package/build/esm/integrations/tracing-channel/vercel-ai.js +23 -0
  80. package/build/esm/integrations/tracing-channel/vercel-ai.js.map +1 -0
  81. package/build/esm/mongoose/index.js +21 -0
  82. package/build/esm/mongoose/index.js.map +1 -0
  83. package/build/esm/mongoose/mongoose-dc-subscriber.js +89 -0
  84. package/build/esm/mongoose/mongoose-dc-subscriber.js.map +1 -0
  85. package/build/esm/orchestrion/bundler/vite.js +1 -1
  86. package/build/esm/orchestrion/channels.js +17 -2
  87. package/build/esm/orchestrion/channels.js.map +1 -1
  88. package/build/esm/orchestrion/config/anthropic-ai.js +40 -0
  89. package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -0
  90. package/build/esm/orchestrion/config/hapi.js +23 -0
  91. package/build/esm/orchestrion/config/hapi.js.map +1 -0
  92. package/build/esm/orchestrion/config/index.js +31 -0
  93. package/build/esm/orchestrion/config/index.js.map +1 -0
  94. package/build/esm/orchestrion/config/ioredis.js +32 -0
  95. package/build/esm/orchestrion/config/ioredis.js.map +1 -0
  96. package/build/esm/orchestrion/config/lru-memoizer.js +14 -0
  97. package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -0
  98. package/build/esm/orchestrion/config/mysql.js +13 -0
  99. package/build/esm/orchestrion/config/mysql.js.map +1 -0
  100. package/build/esm/orchestrion/config/openai.js +37 -0
  101. package/build/esm/orchestrion/config/openai.js.map +1 -0
  102. package/build/esm/orchestrion/config/pg.js +48 -0
  103. package/build/esm/orchestrion/config/pg.js.map +1 -0
  104. package/build/esm/orchestrion/config/vercel-ai.js +41 -0
  105. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -0
  106. package/build/esm/orchestrion/detect.js +6 -2
  107. package/build/esm/orchestrion/detect.js.map +1 -1
  108. package/build/esm/orchestrion/index.js +21 -3
  109. package/build/esm/orchestrion/index.js.map +1 -1
  110. package/build/esm/orchestrion/runtime/register.js +8 -4
  111. package/build/esm/orchestrion/runtime/register.js.map +1 -1
  112. package/build/esm/package.json +1 -1
  113. package/build/esm/redis/redis-statement-serializer.js +32 -0
  114. package/build/esm/redis/redis-statement-serializer.js.map +1 -0
  115. package/build/esm/tracing-channel.js +2 -2
  116. package/build/esm/tracing-channel.js.map +1 -1
  117. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +14 -8
  118. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  119. package/build/esm/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js +254 -0
  120. package/build/esm/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +1 -0
  121. package/build/types/index.d.ts +2 -0
  122. package/build/types/index.d.ts.map +1 -1
  123. package/build/types/integrations/tracing-channel/anthropic.d.ts +10 -0
  124. package/build/types/integrations/tracing-channel/anthropic.d.ts.map +1 -0
  125. package/build/types/integrations/tracing-channel/hapi-types.d.ts +53 -0
  126. package/build/types/integrations/tracing-channel/hapi-types.d.ts.map +1 -0
  127. package/build/types/integrations/tracing-channel/hapi-utils.d.ts +25 -0
  128. package/build/types/integrations/tracing-channel/hapi-utils.d.ts.map +1 -0
  129. package/build/types/integrations/tracing-channel/hapi.d.ts +9 -0
  130. package/build/types/integrations/tracing-channel/hapi.d.ts.map +1 -0
  131. package/build/types/integrations/tracing-channel/ioredis.d.ts +17 -0
  132. package/build/types/integrations/tracing-channel/ioredis.d.ts.map +1 -0
  133. package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -1
  134. package/build/types/integrations/tracing-channel/openai.d.ts +10 -0
  135. package/build/types/integrations/tracing-channel/openai.d.ts.map +1 -0
  136. package/build/types/integrations/tracing-channel/postgres.d.ts +15 -0
  137. package/build/types/integrations/tracing-channel/postgres.d.ts.map +1 -0
  138. package/build/types/integrations/tracing-channel/vercel-ai.d.ts +13 -0
  139. package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -0
  140. package/build/types/mongoose/index.d.ts +11 -0
  141. package/build/types/mongoose/index.d.ts.map +1 -0
  142. package/build/types/mongoose/mongoose-dc-subscriber.d.ts +63 -0
  143. package/build/types/mongoose/mongoose-dc-subscriber.d.ts.map +1 -0
  144. package/build/types/orchestrion/channels.d.ts +21 -1
  145. package/build/types/orchestrion/channels.d.ts.map +1 -1
  146. package/build/types/orchestrion/config/anthropic-ai.d.ts +31 -0
  147. package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -0
  148. package/build/types/orchestrion/config/hapi.d.ts +17 -0
  149. package/build/types/orchestrion/config/hapi.d.ts.map +1 -0
  150. package/build/types/orchestrion/{config.d.ts → config/index.d.ts} +1 -12
  151. package/build/types/orchestrion/config/index.d.ts.map +1 -0
  152. package/build/types/orchestrion/config/ioredis.d.ts +7 -0
  153. package/build/types/orchestrion/config/ioredis.d.ts.map +1 -0
  154. package/build/types/orchestrion/config/lru-memoizer.d.ts +16 -0
  155. package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -0
  156. package/build/types/orchestrion/config/mysql.d.ts +16 -0
  157. package/build/types/orchestrion/config/mysql.d.ts.map +1 -0
  158. package/build/types/orchestrion/config/openai.d.ts +20 -0
  159. package/build/types/orchestrion/config/openai.d.ts.map +1 -0
  160. package/build/types/orchestrion/config/pg.d.ts +33 -0
  161. package/build/types/orchestrion/config/pg.d.ts.map +1 -0
  162. package/build/types/orchestrion/config/vercel-ai.d.ts +11 -0
  163. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -0
  164. package/build/types/orchestrion/detect.d.ts +10 -0
  165. package/build/types/orchestrion/detect.d.ts.map +1 -1
  166. package/build/types/orchestrion/index.d.ts +53 -3
  167. package/build/types/orchestrion/index.d.ts.map +1 -1
  168. package/build/types/orchestrion/runtime/register.d.ts.map +1 -1
  169. package/build/types/redis/redis-statement-serializer.d.ts +6 -0
  170. package/build/types/redis/redis-statement-serializer.d.ts.map +1 -0
  171. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts +10 -4
  172. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
  173. package/build/types/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts +12 -0
  174. package/build/types/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts.map +1 -0
  175. package/build/types-ts3.8/index.d.ts +2 -0
  176. package/build/types-ts3.8/integrations/tracing-channel/anthropic.d.ts +10 -0
  177. package/build/types-ts3.8/integrations/tracing-channel/hapi-types.d.ts +65 -0
  178. package/build/types-ts3.8/integrations/tracing-channel/hapi-utils.d.ts +25 -0
  179. package/build/types-ts3.8/integrations/tracing-channel/hapi.d.ts +9 -0
  180. package/build/types-ts3.8/integrations/tracing-channel/ioredis.d.ts +17 -0
  181. package/build/types-ts3.8/integrations/tracing-channel/openai.d.ts +10 -0
  182. package/build/types-ts3.8/integrations/tracing-channel/postgres.d.ts +15 -0
  183. package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +13 -0
  184. package/build/types-ts3.8/mongoose/index.d.ts +11 -0
  185. package/build/types-ts3.8/mongoose/mongoose-dc-subscriber.d.ts +63 -0
  186. package/build/types-ts3.8/orchestrion/channels.d.ts +21 -1
  187. package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +31 -0
  188. package/build/types-ts3.8/orchestrion/config/hapi.d.ts +17 -0
  189. package/build/types-ts3.8/orchestrion/{config.d.ts → config/index.d.ts} +1 -12
  190. package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +7 -0
  191. package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +16 -0
  192. package/build/types-ts3.8/orchestrion/config/mysql.d.ts +16 -0
  193. package/build/types-ts3.8/orchestrion/config/openai.d.ts +20 -0
  194. package/build/types-ts3.8/orchestrion/config/pg.d.ts +33 -0
  195. package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +11 -0
  196. package/build/types-ts3.8/orchestrion/detect.d.ts +10 -0
  197. package/build/types-ts3.8/orchestrion/index.d.ts +53 -3
  198. package/build/types-ts3.8/redis/redis-statement-serializer.d.ts +6 -0
  199. package/build/types-ts3.8/vercel-ai/vercel-ai-dc-subscriber.d.ts +10 -4
  200. package/build/types-ts3.8/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts +12 -0
  201. package/package.json +9 -9
  202. package/build/cjs/orchestrion/config.js +0 -44
  203. package/build/cjs/orchestrion/config.js.map +0 -1
  204. package/build/esm/orchestrion/config.js +0 -40
  205. package/build/esm/orchestrion/config.js.map +0 -1
  206. package/build/types/orchestrion/config.d.ts.map +0 -1
@@ -0,0 +1,63 @@
1
+ import { TracingChannel } from 'node:diagnostics_channel';
2
+ export declare const MONGOOSE_DC_CHANNEL_QUERY = "mongoose:query";
3
+ export declare const MONGOOSE_DC_CHANNEL_AGGREGATE = "mongoose:aggregate";
4
+ export declare const MONGOOSE_DC_CHANNEL_MODEL_SAVE = "mongoose:model:save";
5
+ export declare const MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = "mongoose:model:insertMany";
6
+ export declare const MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = "mongoose:model:bulkWrite";
7
+ export declare const MONGOOSE_DC_CHANNEL_CURSOR_NEXT = "mongoose:cursor:next";
8
+ /**
9
+ * Shape of the context object mongoose >= 9.7.0 publishes on its tracing
10
+ * channels (mongoose's `TracingContext`, see `types/tracing.d.ts`).
11
+ *
12
+ * Node's `tracePromise` mutates this same object with `result`/`error` once the
13
+ * operation settles, which `bindTracingChannelToSpan` reads in its lifecycle
14
+ * handlers — hence both are declared optional here.
15
+ *
16
+ * Unlike redis/ioredis, mongoose does NOT pre-sanitize the payload, so `args`
17
+ * carries the raw user query. We redact it before emitting `db.query.text`.
18
+ */
19
+ export interface MongooseTracingData {
20
+ operation: string;
21
+ /** Absent for connection-level `aggregate()` calls, which have no model/collection. */
22
+ collection?: string;
23
+ database?: string;
24
+ serverAddress?: string;
25
+ serverPort?: number;
26
+ /** Cursor channels only: the cursor's fetch batch size and tailable flag. */
27
+ batchSize?: number;
28
+ tailable?: boolean;
29
+ /**
30
+ * Operation-specific arguments. `filter` (queries/cursors) and `pipeline`
31
+ * (aggregations) carry the query shape; `docs`/`ops` carry batch payloads.
32
+ */
33
+ args?: {
34
+ filter?: unknown;
35
+ pipeline?: unknown;
36
+ docs?: unknown;
37
+ ops?: unknown;
38
+ [key: string]: unknown;
39
+ };
40
+ result?: unknown;
41
+ error?: Error;
42
+ }
43
+ /**
44
+ * Platform-provided factory that creates a native tracing channel for the given name. The
45
+ * subscriber binds the span and its lifecycle onto the channel via `bindTracingChannelToSpan`,
46
+ * which propagates the active span through the runtime's async context.
47
+ *
48
+ * Node passes `node:diagnostics_channel`'s `tracingChannel` directly.
49
+ */
50
+ export type MongooseTracingChannelFactory = <T extends object>(name: string) => TracingChannel<T, T>;
51
+ /**
52
+ * Subscribe Sentry span handlers to mongoose's diagnostics-channel events
53
+ * (`mongoose:query`, `:aggregate`, `:model:save`, `:model:insertMany`,
54
+ * `:model:bulkWrite`, `:cursor:next`), published by mongoose >= 9.7.0.
55
+ *
56
+ * On older mongoose versions the channels are never published to, so the
57
+ * subscribers are inert — there is no double-instrumentation against the
58
+ * IITM-based vendored patcher, which is gated to `< 9.7.0`.
59
+ *
60
+ * Idempotent: subsequent calls are a no-op.
61
+ */
62
+ export declare function subscribeMongooseDiagnosticChannels(tracingChannel: MongooseTracingChannelFactory): void;
63
+ //# sourceMappingURL=mongoose-dc-subscriber.d.ts.map
@@ -12,8 +12,28 @@
12
12
  * they don't drift apart and silently stop firing.
13
13
  */
14
14
  export declare const CHANNELS: {
15
- readonly MYSQL_QUERY: "orchestrion:mysql:query";
15
+ readonly HAPI_ROUTE: "orchestrion:@hapi/hapi:route";
16
+ readonly HAPI_EXT: "orchestrion:@hapi/hapi:ext";
17
+ readonly VERCEL_AI_GENERATE_TEXT: "orchestrion:ai:generateText";
18
+ readonly VERCEL_AI_STREAM_TEXT: "orchestrion:ai:streamText";
19
+ readonly VERCEL_AI_EMBED: "orchestrion:ai:embed";
20
+ readonly VERCEL_AI_EMBED_MANY: "orchestrion:ai:embedMany";
21
+ readonly VERCEL_AI_EXECUTE_TOOL_CALL: "orchestrion:ai:executeToolCall";
22
+ readonly VERCEL_AI_RESOLVE_LANGUAGE_MODEL: "orchestrion:ai:resolveLanguageModel";
23
+ readonly ANTHROPIC_CHAT: "orchestrion:@anthropic-ai/sdk:chat";
24
+ readonly ANTHROPIC_MODELS: "orchestrion:@anthropic-ai/sdk:models";
25
+ readonly ANTHROPIC_MESSAGES_STREAM: "orchestrion:@anthropic-ai/sdk:messages-stream";
26
+ readonly OPENAI_CHAT: "orchestrion:openai:chat";
27
+ readonly OPENAI_RESPONSES: "orchestrion:openai:responses";
28
+ readonly OPENAI_EMBEDDINGS: "orchestrion:openai:embeddings";
29
+ readonly OPENAI_CONVERSATIONS: "orchestrion:openai:conversations";
30
+ readonly PG_QUERY: "orchestrion:pg:query";
31
+ readonly PG_CONNECT: "orchestrion:pg:connect";
32
+ readonly PGPOOL_CONNECT: "orchestrion:pg-pool:connect";
33
+ readonly IOREDIS_COMMAND: "orchestrion:ioredis:command";
34
+ readonly IOREDIS_CONNECT: "orchestrion:ioredis:connect";
16
35
  readonly LRU_MEMOIZER_LOAD: "orchestrion:lru-memoizer:load";
36
+ readonly MYSQL_QUERY: "orchestrion:mysql:query";
17
37
  };
18
38
  export type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];
19
39
  //# sourceMappingURL=channels.d.ts.map
@@ -0,0 +1,31 @@
1
+ export declare const anthropicAiConfig: ({
2
+ channelName: string;
3
+ module: {
4
+ name: string;
5
+ versionRange: string;
6
+ filePath: string;
7
+ };
8
+ functionQuery: {
9
+ className: string;
10
+ methodName: string;
11
+ kind: "Auto";
12
+ };
13
+ } | {
14
+ channelName: string;
15
+ module: {
16
+ name: string;
17
+ versionRange: string;
18
+ filePath: string;
19
+ };
20
+ functionQuery: {
21
+ className: string;
22
+ methodName: string;
23
+ kind: "Sync";
24
+ };
25
+ })[];
26
+ export declare const anthropicAiChannels: {
27
+ readonly ANTHROPIC_CHAT: "orchestrion:@anthropic-ai/sdk:chat";
28
+ readonly ANTHROPIC_MODELS: "orchestrion:@anthropic-ai/sdk:models";
29
+ readonly ANTHROPIC_MESSAGES_STREAM: "orchestrion:@anthropic-ai/sdk:messages-stream";
30
+ };
31
+ //# sourceMappingURL=anthropic-ai.d.ts.map
@@ -0,0 +1,17 @@
1
+ export declare const hapiConfig: {
2
+ channelName: string;
3
+ module: {
4
+ name: string;
5
+ versionRange: string;
6
+ filePath: string;
7
+ };
8
+ functionQuery: {
9
+ methodName: string;
10
+ kind: "Sync";
11
+ };
12
+ }[];
13
+ export declare const hapiChannels: {
14
+ readonly HAPI_ROUTE: "orchestrion:@hapi/hapi:route";
15
+ readonly HAPI_EXT: "orchestrion:@hapi/hapi:ext";
16
+ };
17
+ //# sourceMappingURL=hapi.d.ts.map
@@ -1,15 +1,4 @@
1
1
  import { InstrumentationConfig } from '@apm-js-collab/code-transformer';
2
- /**
3
- * The central list of channel injections orchestrion should perform.
4
- *
5
- * This module has NO side effects — it's the only thing both the runtime hook
6
- * (`runtime/import-hook.mjs`) and the bundler plugins (`bundler/vite.ts`, …)
7
- * import from. Adding a new instrumented method is one entry here plus one
8
- * subscriber in `integrations/<lib>/tracing-channel.ts`.
9
- *
10
- * `channelName` here is the unprefixed suffix; the actual diagnostics_channel
11
- * name is `orchestrion:${module.name}:${channelName}` (see `channels.ts`).
12
- */
13
2
  export declare const SENTRY_INSTRUMENTATIONS: InstrumentationConfig[];
14
3
  /**
15
4
  * The unique set of package names instrumented by `SENTRY_INSTRUMENTATIONS`
@@ -32,4 +21,4 @@ export declare const INSTRUMENTED_MODULE_NAMES: string[];
32
21
  * `INSTRUMENTED_MODULE_NAMES` directly rather than this helper.)
33
22
  */
34
23
  export declare function withoutInstrumentedExternals(external: readonly string[] | undefined): string[] | undefined;
35
- //# sourceMappingURL=config.d.ts.map
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { InstrumentationConfig } from '@apm-js-collab/code-transformer';
2
+ export declare const ioredisConfig: InstrumentationConfig[];
3
+ export declare const ioredisChannels: {
4
+ readonly IOREDIS_COMMAND: "orchestrion:ioredis:command";
5
+ readonly IOREDIS_CONNECT: "orchestrion:ioredis:connect";
6
+ };
7
+ //# sourceMappingURL=ioredis.d.ts.map
@@ -0,0 +1,16 @@
1
+ export declare const lruMemoizerConfig: {
2
+ channelName: string;
3
+ module: {
4
+ name: string;
5
+ versionRange: string;
6
+ filePath: string;
7
+ };
8
+ functionQuery: {
9
+ functionName: string;
10
+ kind: "Callback";
11
+ };
12
+ }[];
13
+ export declare const lruMemoizerChannels: {
14
+ readonly LRU_MEMOIZER_LOAD: "orchestrion:lru-memoizer:load";
15
+ };
16
+ //# sourceMappingURL=lru-memoizer.d.ts.map
@@ -0,0 +1,16 @@
1
+ export declare const mysqlConfig: {
2
+ channelName: string;
3
+ module: {
4
+ name: string;
5
+ versionRange: string;
6
+ filePath: string;
7
+ };
8
+ functionQuery: {
9
+ expressionName: string;
10
+ kind: "Auto";
11
+ };
12
+ }[];
13
+ export declare const mysqlChannels: {
14
+ readonly MYSQL_QUERY: "orchestrion:mysql:query";
15
+ };
16
+ //# sourceMappingURL=mysql.d.ts.map
@@ -0,0 +1,20 @@
1
+ export declare const openaiConfig: {
2
+ channelName: string;
3
+ module: {
4
+ name: string;
5
+ versionRange: string;
6
+ filePath: string;
7
+ };
8
+ functionQuery: {
9
+ className: string;
10
+ methodName: string;
11
+ kind: "Auto";
12
+ };
13
+ }[];
14
+ export declare const openaiChannels: {
15
+ readonly OPENAI_CHAT: "orchestrion:openai:chat";
16
+ readonly OPENAI_RESPONSES: "orchestrion:openai:responses";
17
+ readonly OPENAI_EMBEDDINGS: "orchestrion:openai:embeddings";
18
+ readonly OPENAI_CONVERSATIONS: "orchestrion:openai:conversations";
19
+ };
20
+ //# sourceMappingURL=openai.d.ts.map
@@ -0,0 +1,33 @@
1
+ export declare const pgConfig: ({
2
+ channelName: string;
3
+ module: {
4
+ name: string;
5
+ versionRange: string;
6
+ filePath: string;
7
+ };
8
+ functionQuery: {
9
+ className: string;
10
+ methodName: string;
11
+ kind: "Auto";
12
+ expressionName?: undefined;
13
+ };
14
+ } | {
15
+ channelName: string;
16
+ module: {
17
+ name: string;
18
+ versionRange: string;
19
+ filePath: string;
20
+ };
21
+ functionQuery: {
22
+ expressionName: string;
23
+ kind: "Auto";
24
+ className?: undefined;
25
+ methodName?: undefined;
26
+ };
27
+ })[];
28
+ export declare const pgChannels: {
29
+ readonly PG_QUERY: "orchestrion:pg:query";
30
+ readonly PG_CONNECT: "orchestrion:pg:connect";
31
+ readonly PGPOOL_CONNECT: "orchestrion:pg-pool:connect";
32
+ };
33
+ //# sourceMappingURL=pg.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { InstrumentationConfig } from '@apm-js-collab/code-transformer';
2
+ export declare const vercelAiConfig: InstrumentationConfig[];
3
+ export declare const vercelAiChannels: {
4
+ readonly VERCEL_AI_GENERATE_TEXT: "orchestrion:ai:generateText";
5
+ readonly VERCEL_AI_STREAM_TEXT: "orchestrion:ai:streamText";
6
+ readonly VERCEL_AI_EMBED: "orchestrion:ai:embed";
7
+ readonly VERCEL_AI_EMBED_MANY: "orchestrion:ai:embedMany";
8
+ readonly VERCEL_AI_EXECUTE_TOOL_CALL: "orchestrion:ai:executeToolCall";
9
+ readonly VERCEL_AI_RESOLVE_LANGUAGE_MODEL: "orchestrion:ai:resolveLanguageModel";
10
+ };
11
+ //# sourceMappingURL=vercel-ai.d.ts.map
@@ -4,6 +4,16 @@ declare global {
4
4
  bundler?: boolean;
5
5
  } | undefined;
6
6
  }
7
+ /**
8
+ * Whether orchestrion has injected the diagnostics channels into this process,
9
+ * either by the runtime `--import` hook / init-time registration (`runtime`)
10
+ * or a bundler plugin (`bundler`). Both injectors set a flag on the
11
+ * `globalThis.__SENTRY_ORCHESTRION__` marker.
12
+ *
13
+ * Use this to avoid wiring up channel-subscriber integrations when nothing
14
+ * will ever publish to those channels.
15
+ */
16
+ export declare function isOrchestrionInjected(): boolean;
7
17
  /**
8
18
  * Verifies that the diagnostics channels have been injected either by the
9
19
  * runtime `--import` hook (or init-time registration), a bundler plugin, or
@@ -1,4 +1,54 @@
1
- export { detectOrchestrionSetup } from './detect';
2
- export { mysqlChannelIntegration } from '../integrations/tracing-channel/mysql';
3
- export { lruMemoizerChannelIntegration } from '../integrations/tracing-channel/lru-memoizer';
1
+ import { anthropicChannelIntegration } from '../integrations/tracing-channel/anthropic';
2
+ import { hapiChannelIntegration } from '../integrations/tracing-channel/hapi';
3
+ import { ioredisChannelIntegration } from '../integrations/tracing-channel/ioredis';
4
+ import { lruMemoizerChannelIntegration } from '../integrations/tracing-channel/lru-memoizer';
5
+ import { mysqlChannelIntegration } from '../integrations/tracing-channel/mysql';
6
+ import { openaiChannelIntegration } from '../integrations/tracing-channel/openai';
7
+ import { postgresChannelIntegration } from '../integrations/tracing-channel/postgres';
8
+ import { vercelAiChannelIntegration } from '../integrations/tracing-channel/vercel-ai';
9
+ export { detectOrchestrionSetup, isOrchestrionInjected } from './detect';
10
+ export { anthropicChannelIntegration, hapiChannelIntegration, ioredisChannelIntegration, lruMemoizerChannelIntegration, mysqlChannelIntegration, openaiChannelIntegration, postgresChannelIntegration, vercelAiChannelIntegration, };
11
+ export { IORedisChannelIntegrationOptions, IORedisResponseHook } from '../integrations/tracing-channel/ioredis';
12
+ /**
13
+ * The canonical set of orchestrion diagnostics-channel integrations, keyed by their public
14
+ * (OTel-parity) factory name.
15
+ *
16
+ * Single source of truth: add a new channel integration here and every consumer — the `@sentry/node`
17
+ * opt-in helper (`experimentalUseDiagnosticsChannelInjection`) and its public
18
+ * `diagnosticsChannelInjectionIntegrations()` map — picks it up automatically, so there's no separate
19
+ * list to keep in sync.
20
+ *
21
+ * NOTE: `ioredisChannelIntegration` is intentionally NOT here. It only partially replaces the
22
+ * composite OTel `Redis` integration and needs the node SDK's redis cache `responseHook` (which
23
+ * can't live in `server-utils`), so `@sentry/node` wires it up separately.
24
+ */
25
+ export declare const channelIntegrations: {
26
+ readonly postgresIntegration: (options?: {
27
+ ignoreConnectSpans?: boolean;
28
+ } | undefined) => import("@sentry/core").Integration & {
29
+ name: "Postgres";
30
+ };
31
+ readonly mysqlIntegration: () => import("@sentry/core").Integration & {
32
+ name: "Mysql";
33
+ };
34
+ readonly lruMemoizerIntegration: () => import("@sentry/core").Integration & {
35
+ name: "LruMemoizer";
36
+ };
37
+ readonly openaiIntegration: (options?: import("@sentry/core").OpenAiOptions | undefined) => import("@sentry/core").Integration & {
38
+ name: "OpenAI";
39
+ };
40
+ readonly anthropicIntegration: (options?: import("@sentry/core").AnthropicAiOptions | undefined) => import("@sentry/core").Integration & {
41
+ name: "Anthropic_AI";
42
+ };
43
+ readonly vercelAiIntegration: (options?: {
44
+ recordInputs?: boolean;
45
+ recordOutputs?: boolean;
46
+ enableTruncation?: boolean;
47
+ } | undefined) => import("@sentry/core").Integration & {
48
+ name: "VercelAI";
49
+ };
50
+ readonly hapiIntegration: () => import("@sentry/core").Integration & {
51
+ name: "Hapi";
52
+ };
53
+ };
4
54
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Given the redis command name and arguments, return a combination of the
3
+ * command name + the allowed arguments according to `serializationSubsets`.
4
+ */
5
+ export declare const defaultDbStatementSerializer: (cmdName: string, cmdArgs: Array<string | Buffer | number | unknown[]>) => string;
6
+ //# sourceMappingURL=redis-statement-serializer.d.ts.map
@@ -2,8 +2,15 @@ import { Span } from '@sentry/core';
2
2
  import { TracingChannel } from 'node:diagnostics_channel';
3
3
  /** Drop the per-operation `callId` maps once the owning top-level operation settles (success or error). */
4
4
  export declare function clearOperationId(data: VercelAiChannelMessage): void;
5
+ /**
6
+ * Drop the per-operation `callId` maps for a single id. The v6 orchestrion adapter uses this to clear a
7
+ * `streamText` operation only after its lazily-run model call settles — the operation's own span ends
8
+ * synchronously (when `streamText` returns) but the model call runs later as the stream is consumed, and
9
+ * it still needs the operation's `operationId`/`isStream` entry to name itself `ai.streamText.doStream`.
10
+ */
11
+ export declare function clearOperationCallId(callId: string): void;
5
12
  /** The lifecycle event types the `ai:telemetry` channel can carry. */
6
- export type ChannelEventType = 'generateText' | 'streamText' | 'step' | 'languageModelCall' | 'executeTool' | 'embed' | 'rerank';
13
+ export type ChannelEventType = 'generateText' | 'streamText' | 'step' | 'languageModelCall' | 'executeTool' | 'embed' | 'embedMany' | 'rerank';
7
14
  /**
8
15
  * The context object the AI SDK passes through one tracing-channel call. It is the same object
9
16
  * identity across `start`/`end`/`asyncEnd`/`error`, and Node's `tracingChannel` attaches
@@ -25,9 +32,9 @@ export interface VercelAiChannelMessage {
25
32
  * nested AI SDK operations (model calls, tool calls) become children of the enclosing span without
26
33
  * any manual parent bookkeeping here.
27
34
  */
28
- type VercelAiTracingChannelFactory = <T extends object>(name: string) => TracingChannel<T, T>;
35
+ export type VercelAiTracingChannelFactory = <T extends object>(name: string) => TracingChannel<T, T>;
29
36
  /** Integration-level recording options, pinned at subscribe time so we never look the integration up per event. */
30
- interface VercelAiChannelOptions {
37
+ export interface VercelAiChannelOptions {
31
38
  recordInputs?: boolean;
32
39
  recordOutputs?: boolean;
33
40
  enableTruncation?: boolean;
@@ -58,5 +65,4 @@ export declare function createSpanFromMessage(data: VercelAiChannelMessage, chan
58
65
  * we simply don't set the attribute rather than emit a malformed span.
59
66
  */
60
67
  export declare function enrichSpanOnEnd(span: Span, data: VercelAiChannelMessage, channelOptions: VercelAiChannelOptions): void;
61
- export {};
62
68
  //# sourceMappingURL=vercel-ai-dc-subscriber.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { VercelAiChannelOptions, VercelAiTracingChannelFactory } from './vercel-ai-dc-subscriber';
2
+ /**
3
+ * Subscribe the v6 orchestrion channel adapter. Safe to always call: inert on
4
+ * `ai` >= 7 (those channels are never published) and when orchestrion injection
5
+ * isn't active. Idempotent.
6
+ *
7
+ * `tracingChannel` is the platform-provided factory (the same one passed to
8
+ * `subscribeVercelAiTracingChannel`); `options` pins the recording settings at
9
+ * subscribe time so we never look the integration up per event.
10
+ */
11
+ export declare function subscribeVercelAiOrchestrionChannels(tracingChannel: VercelAiTracingChannelFactory, options?: VercelAiChannelOptions): void;
12
+ //# sourceMappingURL=vercel-ai-orchestrion-v6-subscriber.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/server-utils",
3
- "version": "10.63.0",
3
+ "version": "10.64.0",
4
4
  "description": "Server Utilities for all Sentry JavaScript SDKs",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/server-utils",
@@ -28,9 +28,9 @@
28
28
  "require": "./build/cjs/orchestrion/index.js"
29
29
  },
30
30
  "./orchestrion/config": {
31
- "types": "./build/types/orchestrion/config.d.ts",
32
- "import": "./build/esm/orchestrion/config.js",
33
- "require": "./build/cjs/orchestrion/config.js"
31
+ "types": "./build/types/orchestrion/config/index.d.ts",
32
+ "import": "./build/esm/orchestrion/config/index.js",
33
+ "require": "./build/cjs/orchestrion/config/index.js"
34
34
  },
35
35
  "./orchestrion/register": {
36
36
  "types": "./build/types/orchestrion/runtime/register.d.ts",
@@ -54,7 +54,7 @@
54
54
  "build/types-ts3.8/orchestrion/index.d.ts"
55
55
  ],
56
56
  "orchestrion/config": [
57
- "build/types-ts3.8/orchestrion/config.d.ts"
57
+ "build/types-ts3.8/orchestrion/config/index.d.ts"
58
58
  ],
59
59
  "orchestrion/register": [
60
60
  "build/types-ts3.8/orchestrion/runtime/register.d.ts"
@@ -68,7 +68,7 @@
68
68
  "build/types/orchestrion/index.d.ts"
69
69
  ],
70
70
  "orchestrion/config": [
71
- "build/types/orchestrion/config.d.ts"
71
+ "build/types/orchestrion/config/index.d.ts"
72
72
  ],
73
73
  "orchestrion/register": [
74
74
  "build/types/orchestrion/runtime/register.d.ts"
@@ -84,9 +84,9 @@
84
84
  "dependencies": {
85
85
  "@apm-js-collab/code-transformer-bundler-plugins": "^0.5.0",
86
86
  "@apm-js-collab/code-transformer": "^0.15.0",
87
- "@apm-js-collab/tracing-hooks": "^0.10.0",
88
- "@sentry/conventions": "^0.12.0",
89
- "@sentry/core": "10.63.0",
87
+ "@apm-js-collab/tracing-hooks": "^0.10.1",
88
+ "@sentry/conventions": "^0.15.1",
89
+ "@sentry/core": "10.64.0",
90
90
  "magic-string": "~0.30.0"
91
91
  },
92
92
  "devDependencies": {
@@ -1,44 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const SENTRY_INSTRUMENTATIONS = [
4
- {
5
- channelName: "query",
6
- module: { name: "mysql", versionRange: ">=2.0.0 <3", filePath: "lib/Connection.js" },
7
- // `Connection` in mysql v2 is a constructor function (NOT a class):
8
- // `function Connection(options) { ... }`
9
- // `Connection.prototype.query = function query(sql, values, cb) { ... }`
10
- // orchestrion's `className`+`methodName` query only matches `class` declarations.
11
- // The named function expression on the right-hand side of the prototype
12
- // assignment is what we want — that's matched by `expressionName: 'query'`,
13
- // which produces the esquery selector
14
- // `AssignmentExpression[left.property.name="query"] > FunctionExpression[async]`.
15
- // `Auto` so both `connection.query(sql, cb)` and `connection.query(sql)`
16
- // (streamable, no callback) get channel events. The transform picks
17
- // `wrapCallback` when the last arg is a function and `wrapPromise`
18
- // otherwise — for mysql's no-callback path the latter publishes
19
- // `start`/`end` synchronously around the original call and stores the
20
- // returned `Query` emitter on `ctx.result`, which the integration uses to
21
- // attach `'end'`/`'error'` listeners that finish the span.
22
- functionQuery: { expressionName: "query", kind: "Auto" }
23
- },
24
- {
25
- channelName: "load",
26
- // `>=2.1.0` only: the named `function memoizedFunction()` the selector targets exists from 2.1.0
27
- module: { name: "lru-memoizer", versionRange: ">=2.1.0 <4", filePath: "lib/async.js" },
28
- functionQuery: { functionName: "memoizedFunction", kind: "Callback" }
29
- }
30
- ];
31
- const INSTRUMENTED_MODULE_NAMES = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map((i) => i.module.name)));
32
- function withoutInstrumentedExternals(external) {
33
- if (!external) {
34
- return void 0;
35
- }
36
- return external.filter(
37
- (entry) => !INSTRUMENTED_MODULE_NAMES.some((name) => entry === name || entry.startsWith(`${name}/`))
38
- );
39
- }
40
-
41
- exports.INSTRUMENTED_MODULE_NAMES = INSTRUMENTED_MODULE_NAMES;
42
- exports.SENTRY_INSTRUMENTATIONS = SENTRY_INSTRUMENTATIONS;
43
- exports.withoutInstrumentedExternals = withoutInstrumentedExternals;
44
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/orchestrion/config.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\n/**\n * The central list of channel injections orchestrion should perform.\n *\n * This module has NO side effects — it's the only thing both the runtime hook\n * (`runtime/import-hook.mjs`) and the bundler plugins (`bundler/vite.ts`, …)\n * import from. Adding a new instrumented method is one entry here plus one\n * subscriber in `integrations/<lib>/tracing-channel.ts`.\n *\n * `channelName` here is the unprefixed suffix; the actual diagnostics_channel\n * name is `orchestrion:${module.name}:${channelName}` (see `channels.ts`).\n */\nexport const SENTRY_INSTRUMENTATIONS: InstrumentationConfig[] = [\n {\n channelName: 'query',\n module: { name: 'mysql', versionRange: '>=2.0.0 <3', filePath: 'lib/Connection.js' },\n // `Connection` in mysql v2 is a constructor function (NOT a class):\n // `function Connection(options) { ... }`\n // `Connection.prototype.query = function query(sql, values, cb) { ... }`\n // orchestrion's `className`+`methodName` query only matches `class` declarations.\n // The named function expression on the right-hand side of the prototype\n // assignment is what we want — that's matched by `expressionName: 'query'`,\n // which produces the esquery selector\n // `AssignmentExpression[left.property.name=\"query\"] > FunctionExpression[async]`.\n // `Auto` so both `connection.query(sql, cb)` and `connection.query(sql)`\n // (streamable, no callback) get channel events. The transform picks\n // `wrapCallback` when the last arg is a function and `wrapPromise`\n // otherwise — for mysql's no-callback path the latter publishes\n // `start`/`end` synchronously around the original call and stores the\n // returned `Query` emitter on `ctx.result`, which the integration uses to\n // attach `'end'`/`'error'` listeners that finish the span.\n functionQuery: { expressionName: 'query', kind: 'Auto' },\n },\n {\n channelName: 'load',\n // `>=2.1.0` only: the named `function memoizedFunction()` the selector targets exists from 2.1.0\n module: { name: 'lru-memoizer', versionRange: '>=2.1.0 <4', filePath: 'lib/async.js' },\n functionQuery: { functionName: 'memoizedFunction', kind: 'Callback' },\n },\n];\n\n/**\n * The unique set of package names instrumented by `SENTRY_INSTRUMENTATIONS`\n * (e.g. `['mysql']`).\n *\n * Bundler plugins MUST ensure these are actually bundled rather than\n * externalized: an externalized dependency is resolved from `node_modules` at\n * runtime and never passes through the code transform's `onLoad`, so its\n * diagnostics_channel calls are silently never injected.\n */\nexport const INSTRUMENTED_MODULE_NAMES: string[] = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map(i => i.module.name)));\n\n/**\n * Returns `external` with any instrumented packages removed, so a bundler that\n * uses an \"external\" denylist (esbuild, Bun, Rollup) still bundles — and thus\n * transforms — them. Matches an exact package name (`'mysql'`) or a subpath\n * (`'mysql/lib/...'`); wildcard/other patterns are left untouched. `undefined`\n * is returned unchanged.\n *\n * (Vite uses an `ssr.noExternal` allowlist instead, so it consumes\n * `INSTRUMENTED_MODULE_NAMES` directly rather than this helper.)\n */\nexport function withoutInstrumentedExternals(external: readonly string[] | undefined): string[] | undefined {\n if (!external) {\n return undefined;\n }\n return external.filter(\n entry => !INSTRUMENTED_MODULE_NAMES.some(name => entry === name || entry.startsWith(`${name}/`)),\n );\n}\n"],"names":[],"mappings":";;AAaO,MAAM,uBAAA,GAAmD;AAAA,EAC9D;AAAA,IACE,WAAA,EAAa,OAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,SAAS,YAAA,EAAc,YAAA,EAAc,UAAU,mBAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBnF,aAAA,EAAe,EAAE,cAAA,EAAgB,OAAA,EAAS,MAAM,MAAA;AAAO,GACzD;AAAA,EACA;AAAA,IACE,WAAA,EAAa,MAAA;AAAA;AAAA,IAEb,QAAQ,EAAE,IAAA,EAAM,gBAAgB,YAAA,EAAc,YAAA,EAAc,UAAU,cAAA,EAAe;AAAA,IACrF,aAAA,EAAe,EAAE,YAAA,EAAc,kBAAA,EAAoB,MAAM,UAAA;AAAW;AAExE;AAWO,MAAM,yBAAA,GAAsC,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,uBAAA,CAAwB,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,CAAO,IAAI,CAAC,CAAC;AAY/G,SAAS,6BAA6B,QAAA,EAA+D;AAC1G,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACd,CAAA,KAAA,KAAS,CAAC,yBAAA,CAA0B,IAAA,CAAK,CAAA,IAAA,KAAQ,KAAA,KAAU,IAAA,IAAQ,KAAA,CAAM,UAAA,CAAW,CAAA,EAAG,IAAI,CAAA,CAAA,CAAG,CAAC;AAAA,GACjG;AACF;;;;;;"}
@@ -1,40 +0,0 @@
1
- const SENTRY_INSTRUMENTATIONS = [
2
- {
3
- channelName: "query",
4
- module: { name: "mysql", versionRange: ">=2.0.0 <3", filePath: "lib/Connection.js" },
5
- // `Connection` in mysql v2 is a constructor function (NOT a class):
6
- // `function Connection(options) { ... }`
7
- // `Connection.prototype.query = function query(sql, values, cb) { ... }`
8
- // orchestrion's `className`+`methodName` query only matches `class` declarations.
9
- // The named function expression on the right-hand side of the prototype
10
- // assignment is what we want — that's matched by `expressionName: 'query'`,
11
- // which produces the esquery selector
12
- // `AssignmentExpression[left.property.name="query"] > FunctionExpression[async]`.
13
- // `Auto` so both `connection.query(sql, cb)` and `connection.query(sql)`
14
- // (streamable, no callback) get channel events. The transform picks
15
- // `wrapCallback` when the last arg is a function and `wrapPromise`
16
- // otherwise — for mysql's no-callback path the latter publishes
17
- // `start`/`end` synchronously around the original call and stores the
18
- // returned `Query` emitter on `ctx.result`, which the integration uses to
19
- // attach `'end'`/`'error'` listeners that finish the span.
20
- functionQuery: { expressionName: "query", kind: "Auto" }
21
- },
22
- {
23
- channelName: "load",
24
- // `>=2.1.0` only: the named `function memoizedFunction()` the selector targets exists from 2.1.0
25
- module: { name: "lru-memoizer", versionRange: ">=2.1.0 <4", filePath: "lib/async.js" },
26
- functionQuery: { functionName: "memoizedFunction", kind: "Callback" }
27
- }
28
- ];
29
- const INSTRUMENTED_MODULE_NAMES = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map((i) => i.module.name)));
30
- function withoutInstrumentedExternals(external) {
31
- if (!external) {
32
- return void 0;
33
- }
34
- return external.filter(
35
- (entry) => !INSTRUMENTED_MODULE_NAMES.some((name) => entry === name || entry.startsWith(`${name}/`))
36
- );
37
- }
38
-
39
- export { INSTRUMENTED_MODULE_NAMES, SENTRY_INSTRUMENTATIONS, withoutInstrumentedExternals };
40
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sources":["../../../src/orchestrion/config.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\n/**\n * The central list of channel injections orchestrion should perform.\n *\n * This module has NO side effects — it's the only thing both the runtime hook\n * (`runtime/import-hook.mjs`) and the bundler plugins (`bundler/vite.ts`, …)\n * import from. Adding a new instrumented method is one entry here plus one\n * subscriber in `integrations/<lib>/tracing-channel.ts`.\n *\n * `channelName` here is the unprefixed suffix; the actual diagnostics_channel\n * name is `orchestrion:${module.name}:${channelName}` (see `channels.ts`).\n */\nexport const SENTRY_INSTRUMENTATIONS: InstrumentationConfig[] = [\n {\n channelName: 'query',\n module: { name: 'mysql', versionRange: '>=2.0.0 <3', filePath: 'lib/Connection.js' },\n // `Connection` in mysql v2 is a constructor function (NOT a class):\n // `function Connection(options) { ... }`\n // `Connection.prototype.query = function query(sql, values, cb) { ... }`\n // orchestrion's `className`+`methodName` query only matches `class` declarations.\n // The named function expression on the right-hand side of the prototype\n // assignment is what we want — that's matched by `expressionName: 'query'`,\n // which produces the esquery selector\n // `AssignmentExpression[left.property.name=\"query\"] > FunctionExpression[async]`.\n // `Auto` so both `connection.query(sql, cb)` and `connection.query(sql)`\n // (streamable, no callback) get channel events. The transform picks\n // `wrapCallback` when the last arg is a function and `wrapPromise`\n // otherwise — for mysql's no-callback path the latter publishes\n // `start`/`end` synchronously around the original call and stores the\n // returned `Query` emitter on `ctx.result`, which the integration uses to\n // attach `'end'`/`'error'` listeners that finish the span.\n functionQuery: { expressionName: 'query', kind: 'Auto' },\n },\n {\n channelName: 'load',\n // `>=2.1.0` only: the named `function memoizedFunction()` the selector targets exists from 2.1.0\n module: { name: 'lru-memoizer', versionRange: '>=2.1.0 <4', filePath: 'lib/async.js' },\n functionQuery: { functionName: 'memoizedFunction', kind: 'Callback' },\n },\n];\n\n/**\n * The unique set of package names instrumented by `SENTRY_INSTRUMENTATIONS`\n * (e.g. `['mysql']`).\n *\n * Bundler plugins MUST ensure these are actually bundled rather than\n * externalized: an externalized dependency is resolved from `node_modules` at\n * runtime and never passes through the code transform's `onLoad`, so its\n * diagnostics_channel calls are silently never injected.\n */\nexport const INSTRUMENTED_MODULE_NAMES: string[] = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map(i => i.module.name)));\n\n/**\n * Returns `external` with any instrumented packages removed, so a bundler that\n * uses an \"external\" denylist (esbuild, Bun, Rollup) still bundles — and thus\n * transforms — them. Matches an exact package name (`'mysql'`) or a subpath\n * (`'mysql/lib/...'`); wildcard/other patterns are left untouched. `undefined`\n * is returned unchanged.\n *\n * (Vite uses an `ssr.noExternal` allowlist instead, so it consumes\n * `INSTRUMENTED_MODULE_NAMES` directly rather than this helper.)\n */\nexport function withoutInstrumentedExternals(external: readonly string[] | undefined): string[] | undefined {\n if (!external) {\n return undefined;\n }\n return external.filter(\n entry => !INSTRUMENTED_MODULE_NAMES.some(name => entry === name || entry.startsWith(`${name}/`)),\n );\n}\n"],"names":[],"mappings":"AAaO,MAAM,uBAAA,GAAmD;AAAA,EAC9D;AAAA,IACE,WAAA,EAAa,OAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,SAAS,YAAA,EAAc,YAAA,EAAc,UAAU,mBAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBnF,aAAA,EAAe,EAAE,cAAA,EAAgB,OAAA,EAAS,MAAM,MAAA;AAAO,GACzD;AAAA,EACA;AAAA,IACE,WAAA,EAAa,MAAA;AAAA;AAAA,IAEb,QAAQ,EAAE,IAAA,EAAM,gBAAgB,YAAA,EAAc,YAAA,EAAc,UAAU,cAAA,EAAe;AAAA,IACrF,aAAA,EAAe,EAAE,YAAA,EAAc,kBAAA,EAAoB,MAAM,UAAA;AAAW;AAExE;AAWO,MAAM,yBAAA,GAAsC,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,uBAAA,CAAwB,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,CAAO,IAAI,CAAC,CAAC;AAY/G,SAAS,6BAA6B,QAAA,EAA+D;AAC1G,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACd,CAAA,KAAA,KAAS,CAAC,yBAAA,CAA0B,IAAA,CAAK,CAAA,IAAA,KAAQ,KAAA,KAAU,IAAA,IAAQ,KAAA,CAAM,UAAA,CAAW,CAAA,EAAG,IAAI,CAAA,CAAA,CAAG,CAAC;AAAA,GACjG;AACF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/orchestrion/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,qBAAqB,EA2B1D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,EAAyE,CAAC;AAExH;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAO1G"}