@sentry/server-utils 10.62.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.
- package/build/cjs/index.js +10 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/anthropic.js +101 -0
- package/build/cjs/integrations/tracing-channel/anthropic.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/errors.js +42 -0
- package/build/cjs/integrations/tracing-channel/fastify/errors.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/index.js +34 -0
- package/build/cjs/integrations/tracing-channel/fastify/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js +279 -0
- package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/utils.js +11 -0
- package/build/cjs/integrations/tracing-channel/fastify/utils.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi-types.js +30 -0
- package/build/cjs/integrations/tracing-channel/hapi-types.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi-utils.js +177 -0
- package/build/cjs/integrations/tracing-channel/hapi-utils.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi.js +52 -0
- package/build/cjs/integrations/tracing-channel/hapi.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/ioredis.js +96 -0
- package/build/cjs/integrations/tracing-channel/ioredis.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/lru-memoizer.js +31 -0
- package/build/cjs/integrations/tracing-channel/lru-memoizer.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/mysql.js +46 -83
- package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/openai.js +83 -0
- package/build/cjs/integrations/tracing-channel/openai.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/postgres.js +170 -0
- package/build/cjs/integrations/tracing-channel/postgres.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/vercel-ai.js +25 -0
- package/build/cjs/integrations/tracing-channel/vercel-ai.js.map +1 -0
- package/build/cjs/mongoose/index.js +23 -0
- package/build/cjs/mongoose/index.js.map +1 -0
- package/build/cjs/mongoose/mongoose-dc-subscriber.js +97 -0
- package/build/cjs/mongoose/mongoose-dc-subscriber.js.map +1 -0
- package/build/cjs/orchestrion/bundler/vite.js +3 -3
- package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
- package/build/cjs/orchestrion/channels.js +17 -1
- package/build/cjs/orchestrion/channels.js.map +1 -1
- package/build/cjs/orchestrion/config/anthropic-ai.js +43 -0
- package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -0
- package/build/cjs/orchestrion/config/hapi.js +26 -0
- package/build/cjs/orchestrion/config/hapi.js.map +1 -0
- package/build/cjs/orchestrion/config/index.js +35 -0
- package/build/cjs/orchestrion/config/index.js.map +1 -0
- package/build/cjs/orchestrion/config/ioredis.js +35 -0
- package/build/cjs/orchestrion/config/ioredis.js.map +1 -0
- package/build/cjs/orchestrion/config/lru-memoizer.js +17 -0
- package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -0
- package/build/cjs/orchestrion/config/mysql.js +16 -0
- package/build/cjs/orchestrion/config/mysql.js.map +1 -0
- package/build/cjs/orchestrion/config/openai.js +40 -0
- package/build/cjs/orchestrion/config/openai.js.map +1 -0
- package/build/cjs/orchestrion/config/pg.js +51 -0
- package/build/cjs/orchestrion/config/pg.js.map +1 -0
- package/build/cjs/orchestrion/config/vercel-ai.js +44 -0
- package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -0
- package/build/cjs/orchestrion/detect.js +6 -1
- package/build/cjs/orchestrion/detect.js.map +1 -1
- package/build/cjs/orchestrion/index.js +27 -3
- package/build/cjs/orchestrion/index.js.map +1 -1
- package/build/cjs/orchestrion/runtime/register.js +10 -7
- package/build/cjs/orchestrion/runtime/register.js.map +1 -1
- package/build/cjs/redis/redis-statement-serializer.js +34 -0
- package/build/cjs/redis/redis-statement-serializer.js.map +1 -0
- package/build/cjs/tracing-channel.js +50 -11
- package/build/cjs/tracing-channel.js.map +1 -1
- package/build/cjs/vercel-ai/index.js +5 -3
- package/build/cjs/vercel-ai/index.js.map +1 -1
- package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +11 -4
- package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
- package/build/cjs/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js +256 -0
- package/build/cjs/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +1 -0
- package/build/esm/index.js +3 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/tracing-channel/anthropic.js +99 -0
- package/build/esm/integrations/tracing-channel/anthropic.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/errors.js +39 -0
- package/build/esm/integrations/tracing-channel/fastify/errors.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/index.js +30 -0
- package/build/esm/integrations/tracing-channel/fastify/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/instrumentation.js +277 -0
- package/build/esm/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/utils.js +8 -0
- package/build/esm/integrations/tracing-channel/fastify/utils.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi-types.js +25 -0
- package/build/esm/integrations/tracing-channel/hapi-types.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi-utils.js +172 -0
- package/build/esm/integrations/tracing-channel/hapi-utils.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi.js +50 -0
- package/build/esm/integrations/tracing-channel/hapi.js.map +1 -0
- package/build/esm/integrations/tracing-channel/ioredis.js +94 -0
- package/build/esm/integrations/tracing-channel/ioredis.js.map +1 -0
- package/build/esm/integrations/tracing-channel/lru-memoizer.js +29 -0
- package/build/esm/integrations/tracing-channel/lru-memoizer.js.map +1 -0
- package/build/esm/integrations/tracing-channel/mysql.js +47 -84
- package/build/esm/integrations/tracing-channel/mysql.js.map +1 -1
- package/build/esm/integrations/tracing-channel/openai.js +81 -0
- package/build/esm/integrations/tracing-channel/openai.js.map +1 -0
- package/build/esm/integrations/tracing-channel/postgres.js +168 -0
- package/build/esm/integrations/tracing-channel/postgres.js.map +1 -0
- package/build/esm/integrations/tracing-channel/vercel-ai.js +23 -0
- package/build/esm/integrations/tracing-channel/vercel-ai.js.map +1 -0
- package/build/esm/mongoose/index.js +21 -0
- package/build/esm/mongoose/index.js.map +1 -0
- package/build/esm/mongoose/mongoose-dc-subscriber.js +89 -0
- package/build/esm/mongoose/mongoose-dc-subscriber.js.map +1 -0
- package/build/esm/orchestrion/bundler/vite.js +1 -1
- package/build/esm/orchestrion/channels.js +17 -1
- package/build/esm/orchestrion/channels.js.map +1 -1
- package/build/esm/orchestrion/config/anthropic-ai.js +40 -0
- package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -0
- package/build/esm/orchestrion/config/hapi.js +23 -0
- package/build/esm/orchestrion/config/hapi.js.map +1 -0
- package/build/esm/orchestrion/config/index.js +31 -0
- package/build/esm/orchestrion/config/index.js.map +1 -0
- package/build/esm/orchestrion/config/ioredis.js +32 -0
- package/build/esm/orchestrion/config/ioredis.js.map +1 -0
- package/build/esm/orchestrion/config/lru-memoizer.js +14 -0
- package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -0
- package/build/esm/orchestrion/config/mysql.js +13 -0
- package/build/esm/orchestrion/config/mysql.js.map +1 -0
- package/build/esm/orchestrion/config/openai.js +37 -0
- package/build/esm/orchestrion/config/openai.js.map +1 -0
- package/build/esm/orchestrion/config/pg.js +48 -0
- package/build/esm/orchestrion/config/pg.js.map +1 -0
- package/build/esm/orchestrion/config/vercel-ai.js +41 -0
- package/build/esm/orchestrion/config/vercel-ai.js.map +1 -0
- package/build/esm/orchestrion/detect.js +6 -2
- package/build/esm/orchestrion/detect.js.map +1 -1
- package/build/esm/orchestrion/index.js +21 -2
- package/build/esm/orchestrion/index.js.map +1 -1
- package/build/esm/orchestrion/runtime/register.js +8 -4
- package/build/esm/orchestrion/runtime/register.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/redis/redis-statement-serializer.js +32 -0
- package/build/esm/redis/redis-statement-serializer.js.map +1 -0
- package/build/esm/tracing-channel.js +51 -12
- package/build/esm/tracing-channel.js.map +1 -1
- package/build/esm/vercel-ai/index.js +6 -4
- package/build/esm/vercel-ai/index.js.map +1 -1
- package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +14 -8
- package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
- package/build/esm/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js +254 -0
- package/build/esm/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +1 -0
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/anthropic.d.ts +10 -0
- package/build/types/integrations/tracing-channel/anthropic.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/errors.d.ts +12 -0
- package/build/types/integrations/tracing-channel/fastify/errors.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/index.d.ts +66 -0
- package/build/types/integrations/tracing-channel/fastify/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
- package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/types.d.ts +32 -0
- package/build/types/integrations/tracing-channel/fastify/types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/utils.d.ts +9 -0
- package/build/types/integrations/tracing-channel/fastify/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi-types.d.ts +53 -0
- package/build/types/integrations/tracing-channel/hapi-types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi-utils.d.ts +25 -0
- package/build/types/integrations/tracing-channel/hapi-utils.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi.d.ts +9 -0
- package/build/types/integrations/tracing-channel/hapi.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/ioredis.d.ts +17 -0
- package/build/types/integrations/tracing-channel/ioredis.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
- package/build/types/integrations/tracing-channel/lru-memoizer.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/mysql.d.ts +3 -1
- package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/openai.d.ts +10 -0
- package/build/types/integrations/tracing-channel/openai.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/postgres.d.ts +15 -0
- package/build/types/integrations/tracing-channel/postgres.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/vercel-ai.d.ts +13 -0
- package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -0
- package/build/types/mongoose/index.d.ts +11 -0
- package/build/types/mongoose/index.d.ts.map +1 -0
- package/build/types/mongoose/mongoose-dc-subscriber.d.ts +63 -0
- package/build/types/mongoose/mongoose-dc-subscriber.d.ts.map +1 -0
- package/build/types/orchestrion/channels.d.ts +21 -0
- package/build/types/orchestrion/channels.d.ts.map +1 -1
- package/build/types/orchestrion/config/anthropic-ai.d.ts +31 -0
- package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -0
- package/build/types/orchestrion/config/hapi.d.ts +17 -0
- package/build/types/orchestrion/config/hapi.d.ts.map +1 -0
- package/build/types/orchestrion/{config.d.ts → config/index.d.ts} +1 -12
- package/build/types/orchestrion/config/index.d.ts.map +1 -0
- package/build/types/orchestrion/config/ioredis.d.ts +7 -0
- package/build/types/orchestrion/config/ioredis.d.ts.map +1 -0
- package/build/types/orchestrion/config/lru-memoizer.d.ts +16 -0
- package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -0
- package/build/types/orchestrion/config/mysql.d.ts +16 -0
- package/build/types/orchestrion/config/mysql.d.ts.map +1 -0
- package/build/types/orchestrion/config/openai.d.ts +20 -0
- package/build/types/orchestrion/config/openai.d.ts.map +1 -0
- package/build/types/orchestrion/config/pg.d.ts +33 -0
- package/build/types/orchestrion/config/pg.d.ts.map +1 -0
- package/build/types/orchestrion/config/vercel-ai.d.ts +11 -0
- package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -0
- package/build/types/orchestrion/detect.d.ts +10 -0
- package/build/types/orchestrion/detect.d.ts.map +1 -1
- package/build/types/orchestrion/index.d.ts +53 -2
- package/build/types/orchestrion/index.d.ts.map +1 -1
- package/build/types/orchestrion/runtime/register.d.ts.map +1 -1
- package/build/types/redis/redis-statement-serializer.d.ts +6 -0
- package/build/types/redis/redis-statement-serializer.d.ts.map +1 -0
- package/build/types/tracing-channel.d.ts +22 -0
- package/build/types/tracing-channel.d.ts.map +1 -1
- package/build/types/vercel-ai/index.d.ts +3 -1
- package/build/types/vercel-ai/index.d.ts.map +1 -1
- package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts +10 -4
- package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
- package/build/types/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts +12 -0
- package/build/types/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts.map +1 -0
- package/build/types-ts3.8/index.d.ts +4 -0
- package/build/types-ts3.8/integrations/tracing-channel/anthropic.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/errors.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/index.d.ts +66 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/types.d.ts +32 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/utils.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi-types.d.ts +65 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi-utils.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/ioredis.d.ts +17 -0
- package/build/types-ts3.8/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/mysql.d.ts +3 -1
- package/build/types-ts3.8/integrations/tracing-channel/openai.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/postgres.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +13 -0
- package/build/types-ts3.8/mongoose/index.d.ts +11 -0
- package/build/types-ts3.8/mongoose/mongoose-dc-subscriber.d.ts +63 -0
- package/build/types-ts3.8/node-diagnostics-channel.d.ts +19 -0
- package/build/types-ts3.8/orchestrion/channels.d.ts +21 -0
- package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +31 -0
- package/build/types-ts3.8/orchestrion/config/hapi.d.ts +17 -0
- package/build/types-ts3.8/orchestrion/{config.d.ts → config/index.d.ts} +1 -12
- package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +7 -0
- package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +16 -0
- package/build/types-ts3.8/orchestrion/config/mysql.d.ts +16 -0
- package/build/types-ts3.8/orchestrion/config/openai.d.ts +20 -0
- package/build/types-ts3.8/orchestrion/config/pg.d.ts +33 -0
- package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +11 -0
- package/build/types-ts3.8/orchestrion/detect.d.ts +10 -0
- package/build/types-ts3.8/orchestrion/index.d.ts +53 -2
- package/build/types-ts3.8/redis/redis-statement-serializer.d.ts +6 -0
- package/build/types-ts3.8/tracing-channel.d.ts +22 -0
- package/build/types-ts3.8/vercel-ai/index.d.ts +3 -1
- package/build/types-ts3.8/vercel-ai/vercel-ai-dc-subscriber.d.ts +10 -4
- package/build/types-ts3.8/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts +12 -0
- package/package.json +10 -10
- package/build/cjs/orchestrion/config.js +0 -38
- package/build/cjs/orchestrion/config.js.map +0 -1
- package/build/esm/orchestrion/config.js +0 -34
- package/build/esm/orchestrion/config.js.map +0 -1
- 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
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ambient shim for `node:diagnostics_channel`, injected into the TS 3.8 type output only
|
|
3
|
+
* (see `scripts/inject-ts38-shims.mjs`).
|
|
4
|
+
*
|
|
5
|
+
* `@types/node@14` — used by the SDK's TS 3.8 compatibility check — predates this module, so the
|
|
6
|
+
* published declarations that re-export `TracingChannel`/`TracingChannelSubscribers` fail to resolve
|
|
7
|
+
* it (`TS2307`). The real shapes are irrelevant here: TS 3.8 consumers only need these to type-check,
|
|
8
|
+
* never to call. This file is deliberately kept out of `src/` so it never participates in the modern
|
|
9
|
+
* build, where `@types/node` already declares the module.
|
|
10
|
+
*/
|
|
11
|
+
declare module 'node:diagnostics_channel' {
|
|
12
|
+
export interface TracingChannelSubscribers<ContextType = unknown> {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface TracingChannel<StoreType = unknown, ContextType = unknown> {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -12,6 +12,27 @@
|
|
|
12
12
|
* they don't drift apart and silently stop firing.
|
|
13
13
|
*/
|
|
14
14
|
export declare const CHANNELS: {
|
|
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";
|
|
35
|
+
readonly LRU_MEMOIZER_LOAD: "orchestrion:lru-memoizer:load";
|
|
15
36
|
readonly MYSQL_QUERY: "orchestrion:mysql:query";
|
|
16
37
|
};
|
|
17
38
|
export type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];
|
|
@@ -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=
|
|
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,3 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
};
|
|
3
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
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { TracingChannel, TracingChannelSubscribers } from 'node:diagnostics_channel';
|
|
2
2
|
import { ExclusiveEventHintOrCaptureContext, Span } from '@sentry/core';
|
|
3
3
|
export type TracingChannelPayloadWithSpan<TData extends object> = TData & {
|
|
4
|
+
/**
|
|
5
|
+
* The current active span for the traced call.
|
|
6
|
+
*/
|
|
4
7
|
_sentrySpan?: Span;
|
|
8
|
+
/**
|
|
9
|
+
* The context's active store value, used to restore the context for asyncStart continuations for callback-based tracing.
|
|
10
|
+
*/
|
|
11
|
+
_sentryCallerStore?: unknown;
|
|
5
12
|
};
|
|
6
13
|
export interface SentryTracingChannel<TData extends object = object> extends Pick<TracingChannel<TData, TracingChannelPayloadWithSpan<TData>>, Exclude<keyof TracingChannel<TData, TracingChannelPayloadWithSpan<TData>>, 'subscribe' | 'unsubscribe'>> {
|
|
7
14
|
subscribe(subscribers: Partial<TracingChannelSubscribers<TracingChannelPayloadWithSpan<TData>>>): void;
|
|
@@ -20,6 +27,21 @@ export interface TracingChannelLifeCycleOptions<TData extends object = object> {
|
|
|
20
27
|
* For database drivers, it is not recommended to set this at all.
|
|
21
28
|
*/
|
|
22
29
|
captureError?: boolean | ((e: unknown) => ExclusiveEventHintOrCaptureContext);
|
|
30
|
+
/**
|
|
31
|
+
* Take ownership of *when* the span ends: return `true` and the helper won't end it on
|
|
32
|
+
* `end`/`asyncEnd`. For results that settle out-of-band — e.g. a streamed `EventEmitter` that
|
|
33
|
+
* completes via its own `'end'`/`'error'` events.
|
|
34
|
+
*
|
|
35
|
+
* Call `end` when it settles — `end()` on success, `end(error)` on failure. `end` owns *how* the span
|
|
36
|
+
* ends (error status/attributes, `captureError`, `beforeSpanEnd`) and is idempotent. Default `false`
|
|
37
|
+
* lets the helper end the span as usual.
|
|
38
|
+
*/
|
|
39
|
+
deferSpanEnd?: (args: {
|
|
40
|
+
span: Span;
|
|
41
|
+
data: TracingChannelPayloadWithSpan<TData>;
|
|
42
|
+
/** Ends the span: `end()` on success, `end(error)` on failure. Idempotent. */
|
|
43
|
+
end: (error?: unknown) => void;
|
|
44
|
+
}) => boolean;
|
|
23
45
|
}
|
|
24
46
|
/** Returned by {@link bindTracingChannelToSpan}: the bound channel plus a teardown handle. */
|
|
25
47
|
export interface TracingChannelBindingHandle<TData extends object = object> {
|
|
@@ -20,6 +20,8 @@ type VercelAiOptions = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Auto-instrument the `ai` SDK's native telemetry tracing channel (ai >= 7).
|
|
22
22
|
*/
|
|
23
|
-
export declare const vercelAiIntegration: (options?: VercelAiOptions | undefined) => import("@sentry/core").Integration
|
|
23
|
+
export declare const vercelAiIntegration: (options?: VercelAiOptions | undefined) => import("@sentry/core").Integration & {
|
|
24
|
+
name: "VercelAI";
|
|
25
|
+
};
|
|
24
26
|
export {};
|
|
25
27
|
//# sourceMappingURL=index.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.
|
|
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.
|
|
88
|
-
"@sentry/conventions": "^0.
|
|
89
|
-
"@sentry/core": "10.
|
|
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": {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"build:transpile": "rollup -c rollup.npm.config.mjs",
|
|
100
100
|
"build:types": "run-s build:types:core build:types:downlevel",
|
|
101
101
|
"build:types:core": "tsc -p tsconfig.types.json",
|
|
102
|
-
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
|
|
102
|
+
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8 && node scripts/inject-ts38-shims.mjs",
|
|
103
103
|
"build:watch": "run-p build:transpile:watch",
|
|
104
104
|
"build:dev:watch": "run-p build:transpile:watch",
|
|
105
105
|
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
|
|
@@ -1,38 +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
|
-
const INSTRUMENTED_MODULE_NAMES = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map((i) => i.module.name)));
|
|
26
|
-
function withoutInstrumentedExternals(external) {
|
|
27
|
-
if (!external) {
|
|
28
|
-
return void 0;
|
|
29
|
-
}
|
|
30
|
-
return external.filter(
|
|
31
|
-
(entry) => !INSTRUMENTED_MODULE_NAMES.some((name) => entry === name || entry.startsWith(`${name}/`))
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
exports.INSTRUMENTED_MODULE_NAMES = INSTRUMENTED_MODULE_NAMES;
|
|
36
|
-
exports.SENTRY_INSTRUMENTATIONS = SENTRY_INSTRUMENTATIONS;
|
|
37
|
-
exports.withoutInstrumentedExternals = withoutInstrumentedExternals;
|
|
38
|
-
//# 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\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;AAE3D;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,34 +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
|
-
const INSTRUMENTED_MODULE_NAMES = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map((i) => i.module.name)));
|
|
24
|
-
function withoutInstrumentedExternals(external) {
|
|
25
|
-
if (!external) {
|
|
26
|
-
return void 0;
|
|
27
|
-
}
|
|
28
|
-
return external.filter(
|
|
29
|
-
(entry) => !INSTRUMENTED_MODULE_NAMES.some((name) => entry === name || entry.startsWith(`${name}/`))
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { INSTRUMENTED_MODULE_NAMES, SENTRY_INSTRUMENTATIONS, withoutInstrumentedExternals };
|
|
34
|
-
//# 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\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;AAE3D;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,EAqB1D,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"}
|