@sentry/server-utils 11.0.0-rc.0 → 11.0.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/THIRD-PARTY-LICENSES.txt +32 -32
- package/build/cjs/ai/flue/constants.js +4 -0
- package/build/cjs/ai/flue/constants.js.map +1 -1
- package/build/cjs/eve.js +10 -0
- package/build/cjs/eve.js.map +1 -1
- package/build/cjs/index.js +7 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/flue.js +40 -0
- package/build/cjs/integrations/flue.js.map +1 -0
- package/build/cjs/integrations/groq.js +21 -0
- package/build/cjs/integrations/groq.js.map +1 -0
- package/build/cjs/integrations/index.js +4 -0
- package/build/cjs/integrations/index.js.map +1 -1
- package/build/cjs/integrations/langchain.js +4 -1
- package/build/cjs/integrations/langchain.js.map +1 -1
- package/build/cjs/integrations/openai-compatible.js +94 -0
- package/build/cjs/integrations/openai-compatible.js.map +1 -0
- package/build/cjs/integrations/together-ai.js +19 -0
- package/build/cjs/integrations/together-ai.js.map +1 -0
- package/build/cjs/integrations/vercel-ai/gen-ai-recording-mode.js +13 -0
- package/build/cjs/integrations/vercel-ai/gen-ai-recording-mode.js.map +1 -0
- package/build/cjs/integrations/vercel-ai/vercel-ai-dc-subscriber.js +10 -4
- package/build/cjs/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
- package/build/cjs/orchestrion/bundler/vite.js +23 -5
- package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
- package/build/cjs/orchestrion/channels.js +4 -0
- package/build/cjs/orchestrion/channels.js.map +1 -1
- package/build/cjs/orchestrion/config/channel-integration-definitions.js +3 -0
- package/build/cjs/orchestrion/config/channel-integration-definitions.js.map +1 -1
- package/build/cjs/orchestrion/config/flue.js +10 -0
- package/build/cjs/orchestrion/config/flue.js.map +1 -0
- package/build/cjs/orchestrion/config/groq.js +19 -0
- package/build/cjs/orchestrion/config/groq.js.map +1 -0
- package/build/cjs/orchestrion/config/index.js +6 -0
- package/build/cjs/orchestrion/config/index.js.map +1 -1
- package/build/cjs/orchestrion/config/openai-compatible.js +19 -0
- package/build/cjs/orchestrion/config/openai-compatible.js.map +1 -0
- package/build/cjs/orchestrion/config/together-ai.js +19 -0
- package/build/cjs/orchestrion/config/together-ai.js.map +1 -0
- package/build/cjs/tracing-channel.js +1 -0
- package/build/cjs/tracing-channel.js.map +1 -1
- package/build/esm/ai/flue/constants.js +3 -1
- package/build/esm/ai/flue/constants.js.map +1 -1
- package/build/esm/eve.js +11 -2
- package/build/esm/eve.js.map +1 -1
- package/build/esm/index.js +4 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/flue.js +38 -0
- package/build/esm/integrations/flue.js.map +1 -0
- package/build/esm/integrations/groq.js +18 -0
- package/build/esm/integrations/groq.js.map +1 -0
- package/build/esm/integrations/index.js +4 -0
- package/build/esm/integrations/index.js.map +1 -1
- package/build/esm/integrations/langchain.js +4 -1
- package/build/esm/integrations/langchain.js.map +1 -1
- package/build/esm/integrations/openai-compatible.js +79 -0
- package/build/esm/integrations/openai-compatible.js.map +1 -0
- package/build/esm/integrations/openai.js +1 -1
- package/build/esm/integrations/together-ai.js +17 -0
- package/build/esm/integrations/together-ai.js.map +1 -0
- package/build/esm/integrations/vercel-ai/gen-ai-recording-mode.js +10 -0
- package/build/esm/integrations/vercel-ai/gen-ai-recording-mode.js.map +1 -0
- package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js +10 -4
- package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
- package/build/esm/orchestrion/bundler/vite.js +23 -5
- package/build/esm/orchestrion/bundler/vite.js.map +1 -1
- package/build/esm/orchestrion/channels.js +4 -0
- package/build/esm/orchestrion/channels.js.map +1 -1
- package/build/esm/orchestrion/config/channel-integration-definitions.js +3 -0
- package/build/esm/orchestrion/config/channel-integration-definitions.js.map +1 -1
- package/build/esm/orchestrion/config/flue.js +8 -0
- package/build/esm/orchestrion/config/flue.js.map +1 -0
- package/build/esm/orchestrion/config/groq.js +15 -0
- package/build/esm/orchestrion/config/groq.js.map +1 -0
- package/build/esm/orchestrion/config/index.js +6 -0
- package/build/esm/orchestrion/config/index.js.map +1 -1
- package/build/esm/orchestrion/config/openai-compatible.js +17 -0
- package/build/esm/orchestrion/config/openai-compatible.js.map +1 -0
- package/build/esm/orchestrion/config/together-ai.js +15 -0
- package/build/esm/orchestrion/config/together-ai.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/tracing-channel.js +1 -0
- package/build/esm/tracing-channel.js.map +1 -1
- package/build/types/ai/flue/constants.d.ts +2 -0
- package/build/types/ai/flue/constants.d.ts.map +1 -1
- package/build/types/eve.d.ts +6 -0
- package/build/types/eve.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/flue.d.ts +4 -0
- package/build/types/integrations/flue.d.ts.map +1 -0
- package/build/types/integrations/groq.d.ts +10 -0
- package/build/types/integrations/groq.d.ts.map +1 -0
- package/build/types/integrations/index.d.ts.map +1 -1
- package/build/types/integrations/langchain.d.ts.map +1 -1
- package/build/types/integrations/openai-compatible.d.ts +32 -0
- package/build/types/integrations/openai-compatible.d.ts.map +1 -0
- package/build/types/integrations/together-ai.d.ts +9 -0
- package/build/types/integrations/together-ai.d.ts.map +1 -0
- package/build/types/integrations/vercel-ai/gen-ai-recording-mode.d.ts +15 -0
- package/build/types/integrations/vercel-ai/gen-ai-recording-mode.d.ts.map +1 -0
- package/build/types/integrations/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
- package/build/types/orchestrion/bundler/vite.d.ts.map +1 -1
- package/build/types/orchestrion/channels.d.ts +4 -0
- package/build/types/orchestrion/channels.d.ts.map +1 -1
- package/build/types/orchestrion/config/channel-integration-definitions.d.ts +9 -0
- package/build/types/orchestrion/config/channel-integration-definitions.d.ts.map +1 -1
- package/build/types/orchestrion/config/flue.d.ts +9 -0
- package/build/types/orchestrion/config/flue.d.ts.map +1 -0
- package/build/types/orchestrion/config/groq.d.ts +8 -0
- package/build/types/orchestrion/config/groq.d.ts.map +1 -0
- package/build/types/orchestrion/config/index.d.ts.map +1 -1
- package/build/types/orchestrion/config/mongodb.d.ts +2 -2
- package/build/types/orchestrion/config/openai-compatible.d.ts +17 -0
- package/build/types/orchestrion/config/openai-compatible.d.ts.map +1 -0
- package/build/types/orchestrion/config/pg.d.ts +1 -1
- package/build/types/orchestrion/config/together-ai.d.ts +8 -0
- package/build/types/orchestrion/config/together-ai.d.ts.map +1 -0
- package/build/types/tracing-channel.d.ts +3 -1
- package/build/types/tracing-channel.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -286,38 +286,6 @@ SOFTWARE.
|
|
|
286
286
|
|
|
287
287
|
---
|
|
288
288
|
|
|
289
|
-
Name: astring
|
|
290
|
-
Version: 1.9.0
|
|
291
|
-
License: MIT
|
|
292
|
-
Private: false
|
|
293
|
-
Description: JavaScript code generator from an ESTree-compliant AST.
|
|
294
|
-
Repository: https://github.com/davidbonnet/astring.git
|
|
295
|
-
Author: David Bonnet <david@bonnet.cc>
|
|
296
|
-
License Text:
|
|
297
|
-
===
|
|
298
|
-
|
|
299
|
-
Copyright (c) 2015, David Bonnet <david@bonnet.cc>
|
|
300
|
-
|
|
301
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
302
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
303
|
-
in the Software without restriction, including without limitation the rights
|
|
304
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
305
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
306
|
-
furnished to do so, subject to the following conditions:
|
|
307
|
-
|
|
308
|
-
The above copyright notice and this permission notice shall be included in
|
|
309
|
-
all copies or substantial portions of the Software.
|
|
310
|
-
|
|
311
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
312
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
313
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
314
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
315
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
316
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
317
|
-
THE SOFTWARE.
|
|
318
|
-
|
|
319
|
-
---
|
|
320
|
-
|
|
321
289
|
Name: semifies
|
|
322
290
|
Version: 1.0.0
|
|
323
291
|
License: Apache-2.0
|
|
@@ -533,6 +501,38 @@ License Text:
|
|
|
533
501
|
|
|
534
502
|
---
|
|
535
503
|
|
|
504
|
+
Name: astring
|
|
505
|
+
Version: 1.9.0
|
|
506
|
+
License: MIT
|
|
507
|
+
Private: false
|
|
508
|
+
Description: JavaScript code generator from an ESTree-compliant AST.
|
|
509
|
+
Repository: https://github.com/davidbonnet/astring.git
|
|
510
|
+
Author: David Bonnet <david@bonnet.cc>
|
|
511
|
+
License Text:
|
|
512
|
+
===
|
|
513
|
+
|
|
514
|
+
Copyright (c) 2015, David Bonnet <david@bonnet.cc>
|
|
515
|
+
|
|
516
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
517
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
518
|
+
in the Software without restriction, including without limitation the rights
|
|
519
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
520
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
521
|
+
furnished to do so, subject to the following conditions:
|
|
522
|
+
|
|
523
|
+
The above copyright notice and this permission notice shall be included in
|
|
524
|
+
all copies or substantial portions of the Software.
|
|
525
|
+
|
|
526
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
527
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
528
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
529
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
530
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
531
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
532
|
+
THE SOFTWARE.
|
|
533
|
+
|
|
534
|
+
---
|
|
535
|
+
|
|
536
536
|
Name: source-map
|
|
537
537
|
Version: 0.6.1
|
|
538
538
|
License: BSD-3-Clause
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
+
const FLUE_INTEGRATION_NAME = "Flue";
|
|
4
|
+
const FLUE_MODULE_NAME = "@flue/runtime";
|
|
3
5
|
const FLUE_ORIGIN = "auto.ai.flue";
|
|
4
6
|
const FLUE_INSTRUMENTATION_KEY = /* @__PURE__ */ Symbol.for("sentry.flue.instrumentation");
|
|
5
7
|
const FLUE_OPERATION = {
|
|
@@ -10,6 +12,8 @@ const FLUE_OPERATION = {
|
|
|
10
12
|
const MAX_TRACKED_FLUE_SPANS = 1e3;
|
|
11
13
|
|
|
12
14
|
exports.FLUE_INSTRUMENTATION_KEY = FLUE_INSTRUMENTATION_KEY;
|
|
15
|
+
exports.FLUE_INTEGRATION_NAME = FLUE_INTEGRATION_NAME;
|
|
16
|
+
exports.FLUE_MODULE_NAME = FLUE_MODULE_NAME;
|
|
13
17
|
exports.FLUE_OPERATION = FLUE_OPERATION;
|
|
14
18
|
exports.FLUE_ORIGIN = FLUE_ORIGIN;
|
|
15
19
|
exports.MAX_TRACKED_FLUE_SPANS = MAX_TRACKED_FLUE_SPANS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/ai/flue/constants.ts"],"sourcesContent":["export const FLUE_ORIGIN = 'auto.ai.flue';\n\n/**\n * Identifies our registration in Flue's keyed instrumentation registry.\n *\n * `key` is optional, but without one there is no protection against registering twice: Flue\n * deduplicates on object identity, and `createFlueInstrumentation()` returns a new object each\n * call, so a second `instrument()` would silently add a second observer and interceptor and\n * duplicate every span.\n *\n * With a key, Flue handles the repeat itself — it throws `InstrumentationAlreadyInstalledError` in\n * production, and in dev disposes the previous registration and swaps in the new one, which is what\n * stops `vite dev` from stacking observers across reloads.\n */\nexport const FLUE_INSTRUMENTATION_KEY = Symbol.for('sentry.flue.instrumentation');\n\n/**\n * The Flue execution operations we act on.\n *\n * Only `AGENT` is spanned from the interceptor, and only at the outermost depth: Flue drives one\n * LLM call through many `MODEL` operations (one per stream read), and its `AGENT` operation nests\n * inside itself once per submission. The turn span is driven from the observation stream instead,\n * where `turn_start`/`turn` are exactly one-to-one with a model call. `MODEL` and `TOOL` are\n * intercepted only to make the already-open span active for the duration of the operation.\n */\nexport const FLUE_OPERATION = {\n AGENT: 'agent',\n MODEL: 'model',\n TOOL: 'tool',\n} as const;\n\n/**\n * Cap on tracked turn and tool spans, matching `MAX_TRACKED_MASTRA_SPANS`. Both maps are keyed off\n * an id that is only removed when the matching end observation arrives; a stream that is abandoned\n * mid-turn never emits one, so without a cap the map grows for the lifetime of the process.\n */\nexport const MAX_TRACKED_FLUE_SPANS = 1000;\n"],"names":[],"mappings":";;AAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,WAAA,CAAA,CAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAcpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,wBAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B,CAAA;AAWzE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,cAAA,CAAA,CAAA,CAAiB;AAAA,CAAA,CAC5B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACP,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACP,IAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA;AACR,CAAA;AAOO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,sBAAA,CAAA,CAAA,CAAyB,CAAA,CAAA,CAAA
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/ai/flue/constants.ts"],"sourcesContent":["export const FLUE_INTEGRATION_NAME = 'Flue' as const;\n\nexport const FLUE_MODULE_NAME = '@flue/runtime';\n\nexport const FLUE_ORIGIN = 'auto.ai.flue';\n\n/**\n * Identifies our registration in Flue's keyed instrumentation registry.\n *\n * `key` is optional, but without one there is no protection against registering twice: Flue\n * deduplicates on object identity, and `createFlueInstrumentation()` returns a new object each\n * call, so a second `instrument()` would silently add a second observer and interceptor and\n * duplicate every span.\n *\n * With a key, Flue handles the repeat itself — it throws `InstrumentationAlreadyInstalledError` in\n * production, and in dev disposes the previous registration and swaps in the new one, which is what\n * stops `vite dev` from stacking observers across reloads.\n */\nexport const FLUE_INSTRUMENTATION_KEY = Symbol.for('sentry.flue.instrumentation');\n\n/**\n * The Flue execution operations we act on.\n *\n * Only `AGENT` is spanned from the interceptor, and only at the outermost depth: Flue drives one\n * LLM call through many `MODEL` operations (one per stream read), and its `AGENT` operation nests\n * inside itself once per submission. The turn span is driven from the observation stream instead,\n * where `turn_start`/`turn` are exactly one-to-one with a model call. `MODEL` and `TOOL` are\n * intercepted only to make the already-open span active for the duration of the operation.\n */\nexport const FLUE_OPERATION = {\n AGENT: 'agent',\n MODEL: 'model',\n TOOL: 'tool',\n} as const;\n\n/**\n * Cap on tracked turn and tool spans, matching `MAX_TRACKED_MASTRA_SPANS`. Both maps are keyed off\n * an id that is only removed when the matching end observation arrives; a stream that is abandoned\n * mid-turn never emits one, so without a cap the map grows for the lifetime of the process.\n */\nexport const MAX_TRACKED_FLUE_SPANS = 1000;\n"],"names":[],"mappings":";;AAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,qBAAA,CAAA,CAAA,CAAwB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAE9B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,gBAAA,CAAA,CAAA,CAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,WAAA,CAAA,CAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAcpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,wBAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B,CAAA;AAWzE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,cAAA,CAAA,CAAA,CAAiB;AAAA,CAAA,CAC5B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACP,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CAAA,CACP,IAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA;AACR,CAAA;AAOO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,sBAAA,CAAA,CAAA,CAAyB,CAAA,CAAA,CAAA;;;;;;;"}
|
package/build/cjs/eve.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
3
|
const core = require('@sentry/core');
|
|
4
|
+
const genAiRecordingMode = require('./integrations/vercel-ai/gen-ai-recording-mode.js');
|
|
4
5
|
|
|
5
6
|
function eveConversationHook(options = {}) {
|
|
6
7
|
const { getConversationId } = options;
|
|
@@ -15,6 +16,15 @@ function eveConversationHook(options = {}) {
|
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
18
|
}
|
|
19
|
+
const eveIntegration = core.defineIntegration(() => {
|
|
20
|
+
return {
|
|
21
|
+
name: "Eve",
|
|
22
|
+
setup(client) {
|
|
23
|
+
genAiRecordingMode.markEveGenAiRecordingDefault(client);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
});
|
|
18
27
|
|
|
19
28
|
exports.eveConversationHook = eveConversationHook;
|
|
29
|
+
exports.eveIntegration = eveIntegration;
|
|
20
30
|
//# sourceMappingURL=eve.js.map
|
package/build/cjs/eve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eve.js","sources":["../../src/eve.ts"],"sourcesContent":["import { setConversationId } from '@sentry/core';\n\n/**\n * The subset of eve's hook context (`HookContext` from `eve/hooks`) this helper reads. Typed\n * structurally rather than importing from `eve`, so the SDK carries no dependency on the framework —\n * the shape is checked at the `defineHook(...)` call site in the user's app instead.\n */\ninterface EveHookContext {\n session: { id: string };\n}\n\ntype EveHookHandler = (event: unknown, context: EveHookContext) => void;\n\ninterface EveConversationHookOptions {\n /**\n * Derive the Sentry conversation id from the eve hook context. Defaults to the durable session id\n * (`ctx.session.id`), which is stable across every turn of a session and so groups them into one\n * conversation.\n */\n getConversationId?: (context: EveHookContext) => string | null | undefined;\n}\n\n/**\n * Builds the hook definition for an eve `agent/hooks/*.ts` file that tags a session's AI spans with\n * a Sentry conversation id, linking every turn of the session in the Agents \"Conversations\" view.\n *\n * ```ts\n * // agent/hooks/sentry.ts\n * import * as Sentry from '@sentry/node';\n * import { defineHook } from 'eve/hooks';\n *\n * export default defineHook(Sentry.eveConversationHook());\n * ```\n *\n * The id is set on the isolation scope; the default (always-on) `conversationIdIntegration` then\n * stamps `gen_ai.conversation.id` onto the gen_ai spans the Vercel AI instrumentation records for\n * that turn. That indirection is why the id has to be set here and not on the AI call: eve's session\n * id never reaches the AI SDK's telemetry channel, so it can only be attached via the scope.\n *\n * Subscribes to both `turn.started` and `step.started`. Each eve turn is a fresh durable-workflow\n * request with its own isolation scope, and a turn that parks and resumes (approvals, compaction)\n * resumes in yet another request; `turn.started` alone would miss the model calls after a resume.\n * `step.started` fires before every model call, so together they cover each request that produces\n * spans. Re-setting the same id is idempotent, so the overlap is harmless.\n */\nexport function eveConversationHook(options: EveConversationHookOptions = {}): {\n events: Record<'turn.started' | 'step.started', EveHookHandler>;\n} {\n const { getConversationId } = options;\n\n const setConversationIdFromContext: EveHookHandler = (_event, context) => {\n const conversationId = getConversationId ? getConversationId(context) : context.session.id;\n setConversationId(conversationId);\n };\n\n return {\n events: {\n 'turn.started': setConversationIdFromContext,\n 'step.started': setConversationIdFromContext,\n },\n };\n}\n"],"names":["setConversationId"],"mappings":"
|
|
1
|
+
{"version":3,"file":"eve.js","sources":["../../src/eve.ts"],"sourcesContent":["import { defineIntegration, setConversationId } from '@sentry/core';\nimport { markEveGenAiRecordingDefault } from './integrations/vercel-ai/gen-ai-recording-mode';\n\n/**\n * The subset of eve's hook context (`HookContext` from `eve/hooks`) this helper reads. Typed\n * structurally rather than importing from `eve`, so the SDK carries no dependency on the framework —\n * the shape is checked at the `defineHook(...)` call site in the user's app instead.\n */\ninterface EveHookContext {\n session: { id: string };\n}\n\ntype EveHookHandler = (event: unknown, context: EveHookContext) => void;\n\ninterface EveConversationHookOptions {\n /**\n * Derive the Sentry conversation id from the eve hook context. Defaults to the durable session id\n * (`ctx.session.id`), which is stable across every turn of a session and so groups them into one\n * conversation.\n */\n getConversationId?: (context: EveHookContext) => string | null | undefined;\n}\n\n/**\n * Builds the hook definition for an eve `agent/hooks/*.ts` file that tags a session's AI spans with\n * a Sentry conversation id, linking every turn of the session in the Agents \"Conversations\" view.\n *\n * ```ts\n * // agent/hooks/sentry.ts\n * import * as Sentry from '@sentry/node';\n * import { defineHook } from 'eve/hooks';\n *\n * export default defineHook(Sentry.eveConversationHook());\n * ```\n *\n * The id is set on the isolation scope; the default (always-on) `conversationIdIntegration` then\n * stamps `gen_ai.conversation.id` onto the gen_ai spans the Vercel AI instrumentation records for\n * that turn. That indirection is why the id has to be set here and not on the AI call: eve's session\n * id never reaches the AI SDK's telemetry channel, so it can only be attached via the scope.\n *\n * Subscribes to both `turn.started` and `step.started`. Each eve turn is a fresh durable-workflow\n * request with its own isolation scope, and a turn that parks and resumes (approvals, compaction)\n * resumes in yet another request; `turn.started` alone would miss the model calls after a resume.\n * `step.started` fires before every model call, so together they cover each request that produces\n * spans. Re-setting the same id is idempotent, so the overlap is harmless.\n */\nexport function eveConversationHook(options: EveConversationHookOptions = {}): {\n events: Record<'turn.started' | 'step.started', EveHookHandler>;\n} {\n const { getConversationId } = options;\n\n const setConversationIdFromContext: EveHookHandler = (_event, context) => {\n const conversationId = getConversationId ? getConversationId(context) : context.session.id;\n setConversationId(conversationId);\n };\n\n return {\n events: {\n 'turn.started': setConversationIdFromContext,\n 'step.started': setConversationIdFromContext,\n },\n };\n}\n\n/**\n * Integration that handles tracing instrumentation of [eve](https://eve.dev) apps.\n */\nexport const eveIntegration = defineIntegration(() => {\n return {\n name: 'Eve' as const,\n setup(client) {\n markEveGenAiRecordingDefault(client);\n },\n };\n});\n"],"names":["setConversationId","defineIntegration","markEveGenAiRecordingDefault"],"mappings":";;;;;AA8CO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsC,EAAC,CAAA,CAEzE;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAkB,GAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAE9B,CAAA,CAAA,MAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,OAAA,CAAA,CAAA,CAAA,CAAA,CAAY;AACxE,CAAA,CAAA,CAAA,CA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AAA,CAAAA,CAAAA,CAAAA,CAAA,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA;AAAA,CAAA,CAAA,CAAA,CACrC;AAAA,CAAA,CAAA,CACF;AACF,CAAC,CAAA;;;"}
|
package/build/cjs/index.js
CHANGED
|
@@ -37,11 +37,14 @@ const index$h = require('./integrations/kafkajs/index.js');
|
|
|
37
37
|
const knex = require('./integrations/knex.js');
|
|
38
38
|
const langchain = require('./integrations/langchain.js');
|
|
39
39
|
const langgraph = require('./integrations/langgraph.js');
|
|
40
|
+
const flue = require('./integrations/flue.js');
|
|
40
41
|
const mastra = require('./integrations/mastra.js');
|
|
41
42
|
const lruMemoizer = require('./integrations/lru-memoizer.js');
|
|
42
43
|
const index$j = require('./integrations/mongodb/index.js');
|
|
43
44
|
const index$k = require('./integrations/mongoose/index.js');
|
|
44
45
|
const mistral = require('./integrations/mistral.js');
|
|
46
|
+
const groq = require('./integrations/groq.js');
|
|
47
|
+
const togetherAi = require('./integrations/together-ai.js');
|
|
45
48
|
const mysql = require('./integrations/mysql.js');
|
|
46
49
|
const index$l = require('./integrations/mysql2/index.js');
|
|
47
50
|
const openai = require('./integrations/openai.js');
|
|
@@ -81,6 +84,7 @@ exports.attachKoaErrorHandler = koaErrorHandler.attachKoaErrorHandler;
|
|
|
81
84
|
exports.bindTracingChannelToSpan = tracingChannel.bindTracingChannelToSpan;
|
|
82
85
|
exports.orchestrionModuleInjected = moduleInjected.orchestrionModuleInjected;
|
|
83
86
|
exports.eveConversationHook = eve.eveConversationHook;
|
|
87
|
+
exports.eveIntegration = eve.eveIntegration;
|
|
84
88
|
exports.getInstrumentedModuleNames = index$8.getInstrumentedModuleNames;
|
|
85
89
|
exports.fastifyIntegration = index$5.fastifyIntegration;
|
|
86
90
|
exports.setupFastifyErrorHandler = index$5.setupFastifyErrorHandler;
|
|
@@ -99,11 +103,14 @@ exports.kafkaIntegration = index$h.kafkaIntegration;
|
|
|
99
103
|
exports.knexIntegration = knex.knexIntegration;
|
|
100
104
|
exports.langChainIntegration = langchain.langChainIntegration;
|
|
101
105
|
exports.langGraphIntegration = langgraph.langGraphIntegration;
|
|
106
|
+
exports.flueIntegration = flue.flueIntegration;
|
|
102
107
|
exports.mastraIntegration = mastra.mastraIntegration;
|
|
103
108
|
exports.lruMemoizerIntegration = lruMemoizer.lruMemoizerIntegration;
|
|
104
109
|
exports.mongoIntegration = index$j.mongoIntegration;
|
|
105
110
|
exports.mongooseIntegration = index$k.mongooseIntegration;
|
|
106
111
|
exports.mistralAIIntegration = mistral.mistralAIIntegration;
|
|
112
|
+
exports.groqIntegration = groq.groqIntegration;
|
|
113
|
+
exports.togetherAIIntegration = togetherAi.togetherAIIntegration;
|
|
107
114
|
exports.mysqlIntegration = mysql.mysqlIntegration;
|
|
108
115
|
exports.mysql2Integration = index$l.mysql2Integration;
|
|
109
116
|
exports.openAIIntegration = openai.openAIIntegration;
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["export * from './exports';\n\n// Exports using diagnostics channels\nexport { detectOrchestrionSetup } from './orchestrion/detect';\n// oxlint-disable-next-line typescript/no-deprecated -- re-exported so the deprecated `setupKoaErrorHandler` can delegate\nexport { attachKoaErrorHandler } from './integrations/koa/koa-error-handler';\nimport { attachHapiErrorHandler as _attachHapiErrorHandler } from './integrations/hapi/hapi-error-handler';\nexport { bindTracingChannelToSpan } from './tracing-channel';\nexport type { TracingChannelPayloadWithSpan } from './tracing-channel';\nexport type { InstrumentationConfig } from './orchestrion/apmTypes';\n// Runtime target of the bundler-injected module snippet. The snippet imports it\n// from this entry alongside the module's subscriber factory (see\n// `orchestrion/bundler/moduleInjectedTransform.ts`); it is a plain runtime\n// helper with no orchestrion build-time dependency.\nexport { orchestrionModuleInjected } from './utils/moduleInjected';\nexport { eveConversationHook } from './eve';\nexport { getInstrumentedModuleNames } from './orchestrion/config';\nexport {\n fastifyIntegration,\n // oxlint-disable-next-line typescript/no-deprecated\n setupFastifyErrorHandler,\n} from './integrations/fastify';\n\n/**\n * @deprecated This is a temporary export to avoid breaking changes. It will be removed in the next major version.\n */\nexport const attachHapiErrorHandler = _attachHapiErrorHandler;\n\n// Integrations\nexport { prismaIntegration } from './integrations/prisma';\nexport { amqplibIntegration } from './integrations/amqplib';\nexport { anthropicAIIntegration } from './integrations/anthropic';\nexport { awsIntegration } from './integrations/aws-sdk';\nexport { dataloaderIntegration } from './integrations/dataloader';\nexport { genericPoolIntegration } from './integrations/generic-pool';\nexport { googleGenAIIntegration } from './integrations/google-genai';\nexport { graphqlIntegration } from './integrations/graphql';\nexport { hapiIntegration } from './integrations/hapi';\nexport { koaIntegration } from './integrations/koa';\nexport { redisIntegration } from './integrations/redis';\nexport { kafkaIntegration } from './integrations/kafkajs';\nexport { knexIntegration } from './integrations/knex';\nexport { langChainIntegration } from './integrations/langchain';\nexport { langGraphIntegration } from './integrations/langgraph';\nexport { createFlueInstrumentation } from './ai/flue';\nexport type { FlueOptions } from './ai/flue';\nexport { mastraIntegration } from './integrations/mastra';\nexport { SentryMastraExporter } from './ai/mastra';\nexport { lruMemoizerIntegration } from './integrations/lru-memoizer';\nexport { mongoIntegration } from './integrations/mongodb';\nexport { mongooseIntegration } from './integrations/mongoose';\nexport { mistralAIIntegration } from './integrations/mistral';\nexport { mysqlIntegration } from './integrations/mysql';\nexport { mysql2Integration } from './integrations/mysql2';\nexport { openAIIntegration } from './integrations/openai';\nexport { postgresIntegration } from './integrations/postgres';\nexport { postgresJsIntegration } from './integrations/postgres-js';\nexport { tediousIntegration } from './integrations/tedious';\nexport { vercelAIIntegration } from './integrations/vercel-ai';\nexport { expressIntegration } from './integrations/express';\nexport type { ExpressIntegrationOptions } from './integrations/express/types';\n/* oxlint-disable typescript/no-deprecated -- deprecated Express error-handler exports, kept until the next major */\nexport { expressErrorHandler, setupExpressErrorHandler } from './integrations/express/error-handler';\n/* oxlint-enable typescript/no-deprecated */\nexport { firebaseIntegration } from './integrations/firebase';\n\nexport { getTracingIntegrations, getErrorIntegrations } from './integrations';\n"],"names":["_attachHapiErrorHandler"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["export * from './exports';\n\n// Exports using diagnostics channels\nexport { detectOrchestrionSetup } from './orchestrion/detect';\n// oxlint-disable-next-line typescript/no-deprecated -- re-exported so the deprecated `setupKoaErrorHandler` can delegate\nexport { attachKoaErrorHandler } from './integrations/koa/koa-error-handler';\nimport { attachHapiErrorHandler as _attachHapiErrorHandler } from './integrations/hapi/hapi-error-handler';\nexport { bindTracingChannelToSpan } from './tracing-channel';\nexport type { TracingChannelPayloadWithSpan } from './tracing-channel';\nexport type { InstrumentationConfig } from './orchestrion/apmTypes';\n// Runtime target of the bundler-injected module snippet. The snippet imports it\n// from this entry alongside the module's subscriber factory (see\n// `orchestrion/bundler/moduleInjectedTransform.ts`); it is a plain runtime\n// helper with no orchestrion build-time dependency.\nexport { orchestrionModuleInjected } from './utils/moduleInjected';\nexport { eveConversationHook, eveIntegration } from './eve';\nexport { getInstrumentedModuleNames } from './orchestrion/config';\nexport {\n fastifyIntegration,\n // oxlint-disable-next-line typescript/no-deprecated\n setupFastifyErrorHandler,\n} from './integrations/fastify';\n\n/**\n * @deprecated This is a temporary export to avoid breaking changes. It will be removed in the next major version.\n */\nexport const attachHapiErrorHandler = _attachHapiErrorHandler;\n\n// Integrations\nexport { prismaIntegration } from './integrations/prisma';\nexport { amqplibIntegration } from './integrations/amqplib';\nexport { anthropicAIIntegration } from './integrations/anthropic';\nexport { awsIntegration } from './integrations/aws-sdk';\nexport { dataloaderIntegration } from './integrations/dataloader';\nexport { genericPoolIntegration } from './integrations/generic-pool';\nexport { googleGenAIIntegration } from './integrations/google-genai';\nexport { graphqlIntegration } from './integrations/graphql';\nexport { hapiIntegration } from './integrations/hapi';\nexport { koaIntegration } from './integrations/koa';\nexport { redisIntegration } from './integrations/redis';\nexport { kafkaIntegration } from './integrations/kafkajs';\nexport { knexIntegration } from './integrations/knex';\nexport { langChainIntegration } from './integrations/langchain';\nexport { langGraphIntegration } from './integrations/langgraph';\nexport { createFlueInstrumentation } from './ai/flue';\nexport { flueIntegration } from './integrations/flue';\nexport type { FlueOptions } from './ai/flue';\nexport { mastraIntegration } from './integrations/mastra';\nexport { SentryMastraExporter } from './ai/mastra';\nexport { lruMemoizerIntegration } from './integrations/lru-memoizer';\nexport { mongoIntegration } from './integrations/mongodb';\nexport { mongooseIntegration } from './integrations/mongoose';\nexport { mistralAIIntegration } from './integrations/mistral';\nexport { groqIntegration } from './integrations/groq';\nexport { togetherAIIntegration } from './integrations/together-ai';\nexport { mysqlIntegration } from './integrations/mysql';\nexport { mysql2Integration } from './integrations/mysql2';\nexport { openAIIntegration } from './integrations/openai';\nexport { postgresIntegration } from './integrations/postgres';\nexport { postgresJsIntegration } from './integrations/postgres-js';\nexport { tediousIntegration } from './integrations/tedious';\nexport { vercelAIIntegration } from './integrations/vercel-ai';\nexport { expressIntegration } from './integrations/express';\nexport type { ExpressIntegrationOptions } from './integrations/express/types';\n/* oxlint-disable typescript/no-deprecated -- deprecated Express error-handler exports, kept until the next major */\nexport { expressErrorHandler, setupExpressErrorHandler } from './integrations/express/error-handler';\n/* oxlint-enable typescript/no-deprecated */\nexport { firebaseIntegration } from './integrations/firebase';\n\nexport { getTracingIntegrations, getErrorIntegrations } from './integrations';\n"],"names":["_attachHapiErrorHandler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,sBAAA,CAAA,CAAA,CAAyBA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const index = require('../ai/flue/index.js');
|
|
5
|
+
const constants = require('../ai/flue/constants.js');
|
|
6
|
+
const debugBuild = require('../debug-build.js');
|
|
7
|
+
|
|
8
|
+
let registeredBinding;
|
|
9
|
+
const _flueIntegration = ((options = {}) => {
|
|
10
|
+
return {
|
|
11
|
+
name: constants.FLUE_INTEGRATION_NAME,
|
|
12
|
+
setup() {
|
|
13
|
+
const provided = core.GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.providedModules?.[constants.FLUE_MODULE_NAME];
|
|
14
|
+
const instrument = provided?.instrument;
|
|
15
|
+
if (typeof instrument !== "function") {
|
|
16
|
+
debugBuild.DEBUG_BUILD && core.debug.log("[Flue] no provided `@flue/runtime` binding; skipping auto-registration");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (instrument === registeredBinding) {
|
|
20
|
+
debugBuild.DEBUG_BUILD && core.debug.log("[Flue] already registered in this isolate; skipping auto-registration");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
instrument(index.createFlueInstrumentation(options));
|
|
25
|
+
registeredBinding = instrument;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
if (error?.name === "InstrumentationAlreadyInstalledError") {
|
|
28
|
+
registeredBinding = instrument;
|
|
29
|
+
debugBuild.DEBUG_BUILD && core.debug.log("[Flue] already instrumented by the app; skipping auto-registration");
|
|
30
|
+
} else {
|
|
31
|
+
core.debug.warn("[Flue] auto-registration failed; Flue spans will not be recorded:", error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
const flueIntegration = core.defineIntegration(_flueIntegration);
|
|
38
|
+
|
|
39
|
+
exports.flueIntegration = flueIntegration;
|
|
40
|
+
//# sourceMappingURL=flue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flue.js","sources":["../../../src/integrations/flue.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { debug, defineIntegration, GLOBAL_OBJ } from '@sentry/core';\nimport type { FlueOptions } from '../ai/flue';\nimport { createFlueInstrumentation } from '../ai/flue';\nimport { FLUE_INTEGRATION_NAME, FLUE_MODULE_NAME } from '../ai/flue/constants';\nimport { DEBUG_BUILD } from '../debug-build';\n\ntype FlueInstrumentFn = (instrumentation: ReturnType<typeof createFlueInstrumentation>) => unknown;\n\n/**\n * The `instrument` we last registered against, so a second `setup()` in the same isolate is a\n * no-op. Cloudflare runs `init()` per request, and with `cacheClient: false` that reaches here\n * every time: in production Flue throws on the repeat, and under `vite dev` it disposes our\n * previous registration instead — ending the turn and tool spans of every in-flight request.\n *\n * Keyed on the binding rather than a bare boolean so a fresh `@flue/runtime` instance (a new\n * isolate reusing this module, a test swapping the marker) still registers.\n */\nlet registeredBinding: FlueInstrumentFn | undefined;\n\n/**\n * Register the instrumentation with Flue on the user's behalf, when the runtime binding is available.\n *\n * Flue is registered rather than patched — `instrument()` writes into module-scope state — so this\n * needs a reference to that module's own binding. In a bundled worker there is no `node_modules` to\n * resolve one from, so `@sentry/cloudflare/vite` splices a static `@flue/runtime` import into this\n * module at build time and stashes the namespace on the global marker. Outside that setup the marker\n * is empty and this no-ops, leaving the user's own `instrument(Sentry.createFlueInstrumentation())`\n * as the way in.\n */\nconst _flueIntegration = ((options: FlueOptions = {}) => {\n return {\n name: FLUE_INTEGRATION_NAME,\n setup() {\n const provided = GLOBAL_OBJ.__SENTRY_ORCHESTRION__?.providedModules?.[FLUE_MODULE_NAME];\n const instrument = provided?.instrument as FlueInstrumentFn | undefined;\n\n if (typeof instrument !== 'function') {\n DEBUG_BUILD && debug.log('[Flue] no provided `@flue/runtime` binding; skipping auto-registration');\n return;\n }\n\n if (instrument === registeredBinding) {\n DEBUG_BUILD && debug.log('[Flue] already registered in this isolate; skipping auto-registration');\n return;\n }\n\n try {\n instrument(createFlueInstrumentation(options));\n registeredBinding = instrument;\n } catch (error) {\n // Never rethrow: `setup()` runs inside `Sentry.init()`, which core calls unguarded and\n // Cloudflare calls per request, so throwing here would take down the request handler.\n if ((error as Error | undefined)?.name === 'InstrumentationAlreadyInstalledError') {\n // The app owns the key and we will never win it, so stop rebuilding the instrumentation\n // (two 1000-entry `LRUMap`s) on every later `init()`.\n registeredBinding = instrument;\n DEBUG_BUILD && debug.log('[Flue] already instrumented by the app; skipping auto-registration');\n } else {\n debug.warn('[Flue] auto-registration failed; Flue spans will not be recorded:', error);\n }\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const flueIntegration = defineIntegration(_flueIntegration);\n"],"names":["FLUE_INTEGRATION_NAME","GLOBAL_OBJ","FLUE_MODULE_NAME","DEBUG_BUILD","debug","createFlueInstrumentation","defineIntegration"],"mappings":";;;;;;;AAkBA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAYJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,gBAAA,CAAA,CAAA,CAAA,CAAoB,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,EAAC,CAAA,CAAA,CAAA,CAAA,CAAM;AACvD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO;AAAA,CAAA,CAAA,CAAA,CACL,CAAA,CAAA,CAAA,CAAA,EAAMA,CAAAA,CAAA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AA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAqE,KAAK,CAAA;AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACvF;AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACF;AAAA,CAAA,CAAA,CAAA,CACF;AAAA,CAAA,CAAA,CACF;AACF,CAAA,CAAA;AAEO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkBE,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,CAAA;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const channels = require('../orchestrion/channels.js');
|
|
5
|
+
const groq = require('../orchestrion/config/groq.js');
|
|
6
|
+
const openaiCompatible = require('./openai-compatible.js');
|
|
7
|
+
|
|
8
|
+
const GROQ_INTEGRATION_NAME = "Groq";
|
|
9
|
+
const groqIntegration = core.defineIntegration(
|
|
10
|
+
openaiCompatible.createOpenAiCompatibleIntegration({
|
|
11
|
+
integrationName: GROQ_INTEGRATION_NAME,
|
|
12
|
+
providerName: "groq",
|
|
13
|
+
origin: "auto.ai.groq",
|
|
14
|
+
moduleNames: groq.groqModuleNames,
|
|
15
|
+
channels: { chat: channels.CHANNELS.GROQ_CHAT, embeddings: channels.CHANNELS.GROQ_EMBEDDINGS }
|
|
16
|
+
})
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
exports.GROQ_INTEGRATION_NAME = GROQ_INTEGRATION_NAME;
|
|
20
|
+
exports.groqIntegration = groqIntegration;
|
|
21
|
+
//# sourceMappingURL=groq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groq.js","sources":["../../../src/integrations/groq.ts"],"sourcesContent":["import { defineIntegration } from '@sentry/core';\nimport { CHANNELS } from '../orchestrion/channels';\nimport { groqModuleNames } from '../orchestrion/config/groq';\nimport { createOpenAiCompatibleIntegration } from './openai-compatible';\n\n// Exported so LangChain can add it to its provider-skip list: `@langchain/groq` drives `groq-sdk`, so\n// a `ChatGroq` call would otherwise open both a LangChain span and this integration's Groq span.\nexport const GROQ_INTEGRATION_NAME = 'Groq' as const;\n\n/**\n * Instruments the `groq-sdk` client (chat completions and embeddings). Groq speaks the OpenAI wire format,\n * so this reuses the openai span/streaming logic; see `createOpenAiCompatibleIntegration`. Requires the\n * Sentry runtime hook or bundler plugin so the diagnostics channels get injected into `groq-sdk`.\n */\nexport const groqIntegration = defineIntegration(\n createOpenAiCompatibleIntegration({\n integrationName: GROQ_INTEGRATION_NAME,\n providerName: 'groq',\n origin: 'auto.ai.groq',\n moduleNames: groqModuleNames,\n channels: { chat: CHANNELS.GROQ_CHAT, embeddings: CHANNELS.GROQ_EMBEDDINGS },\n }),\n);\n"],"names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CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAU,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAYA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAgB,CAAA,CAAA,CAC5E;AACH,CAAA;;;"}
|
|
@@ -23,6 +23,8 @@ const openai = require('./openai.js');
|
|
|
23
23
|
const anthropic = require('./anthropic.js');
|
|
24
24
|
const googleGenai = require('./google-genai.js');
|
|
25
25
|
const mistral = require('./mistral.js');
|
|
26
|
+
const groq = require('./groq.js');
|
|
27
|
+
const togetherAi = require('./together-ai.js');
|
|
26
28
|
const postgresJs = require('./postgres-js.js');
|
|
27
29
|
const index$d = require('./firebase/index.js');
|
|
28
30
|
const index = require('./express/index.js');
|
|
@@ -59,6 +61,8 @@ function getTracingIntegrations() {
|
|
|
59
61
|
anthropic.anthropicAIIntegration(),
|
|
60
62
|
googleGenai.googleGenAIIntegration(),
|
|
61
63
|
mistral.mistralAIIntegration(),
|
|
64
|
+
groq.groqIntegration(),
|
|
65
|
+
togetherAi.togetherAIIntegration(),
|
|
62
66
|
postgresJs.postgresJsIntegration(),
|
|
63
67
|
index$d.firebaseIntegration()
|
|
64
68
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/integrations/index.ts"],"sourcesContent":["import { amqplibIntegration } from './amqplib';\nimport { dataloaderIntegration } from './dataloader';\nimport { knexIntegration } from './knex';\nimport { mongoIntegration } from './mongodb';\nimport { graphqlIntegration } from './graphql';\nimport { redisIntegration } from './redis';\nimport { mysqlIntegration } from './mysql';\nimport { mysql2Integration } from './mysql2';\nimport { postgresIntegration } from './postgres';\nimport { prismaIntegration } from './prisma';\nimport { tediousIntegration } from './tedious';\nimport { genericPoolIntegration } from './generic-pool';\nimport { kafkaIntegration } from './kafkajs';\nimport { mongooseIntegration } from './mongoose';\nimport { lruMemoizerIntegration } from './lru-memoizer';\nimport { langChainIntegration } from './langchain';\nimport { langGraphIntegration } from './langgraph';\nimport { mastraIntegration } from './mastra';\nimport { vercelAIIntegration } from './vercel-ai';\nimport { openAIIntegration } from './openai';\nimport { anthropicAIIntegration } from './anthropic';\nimport { googleGenAIIntegration } from './google-genai';\nimport { mistralAIIntegration } from './mistral';\nimport { postgresJsIntegration } from './postgres-js';\nimport { firebaseIntegration } from './firebase';\nimport { expressIntegration } from './express';\nimport { fastifyIntegration } from './fastify';\nimport { hapiIntegration } from './hapi';\nimport { koaIntegration } from './koa';\nimport type { Integration } from '@sentry/core';\nimport { awsIntegration } from './aws-sdk';\n\n/** These are integrations that are tracing-only integrations. */\nexport function getTracingIntegrations(): Integration[] {\n return [\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n tediousIntegration(),\n knexIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n dataloaderIntegration(),\n awsIntegration(),\n // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n mastraIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n mistralAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\n ];\n}\n\n/** These are integrations that cover error capture, in addition to tracing. */\nexport function getErrorIntegrations(): Integration[] {\n return [expressIntegration(), fastifyIntegration(), hapiIntegration(), koaIntegration()];\n}\n"],"names":["graphqlIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","tediousIntegration","knexIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","dataloaderIntegration","awsIntegration","langChainIntegration","langGraphIntegration","mastraIntegration","vercelAIIntegration","openAIIntegration","anthropicAIIntegration","googleGenAIIntegration","mistralAIIntegration","postgresJsIntegration","firebaseIntegration","expressIntegration","fastifyIntegration","hapiIntegration","koaIntegration"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/integrations/index.ts"],"sourcesContent":["import { amqplibIntegration } from './amqplib';\nimport { dataloaderIntegration } from './dataloader';\nimport { knexIntegration } from './knex';\nimport { mongoIntegration } from './mongodb';\nimport { graphqlIntegration } from './graphql';\nimport { redisIntegration } from './redis';\nimport { mysqlIntegration } from './mysql';\nimport { mysql2Integration } from './mysql2';\nimport { postgresIntegration } from './postgres';\nimport { prismaIntegration } from './prisma';\nimport { tediousIntegration } from './tedious';\nimport { genericPoolIntegration } from './generic-pool';\nimport { kafkaIntegration } from './kafkajs';\nimport { mongooseIntegration } from './mongoose';\nimport { lruMemoizerIntegration } from './lru-memoizer';\nimport { langChainIntegration } from './langchain';\nimport { langGraphIntegration } from './langgraph';\nimport { mastraIntegration } from './mastra';\nimport { vercelAIIntegration } from './vercel-ai';\nimport { openAIIntegration } from './openai';\nimport { anthropicAIIntegration } from './anthropic';\nimport { googleGenAIIntegration } from './google-genai';\nimport { mistralAIIntegration } from './mistral';\nimport { groqIntegration } from './groq';\nimport { togetherAIIntegration } from './together-ai';\nimport { postgresJsIntegration } from './postgres-js';\nimport { firebaseIntegration } from './firebase';\nimport { expressIntegration } from './express';\nimport { fastifyIntegration } from './fastify';\nimport { hapiIntegration } from './hapi';\nimport { koaIntegration } from './koa';\nimport type { Integration } from '@sentry/core';\nimport { awsIntegration } from './aws-sdk';\n\n/** These are integrations that are tracing-only integrations. */\nexport function getTracingIntegrations(): Integration[] {\n return [\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n tediousIntegration(),\n knexIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n dataloaderIntegration(),\n awsIntegration(),\n // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n mastraIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n mistralAIIntegration(),\n groqIntegration(),\n togetherAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\n ];\n}\n\n/** These are integrations that cover error capture, in addition to tracing. */\nexport function getErrorIntegrations(): Integration[] {\n return [expressIntegration(), fastifyIntegration(), hapiIntegration(), koaIntegration()];\n}\n"],"names":["graphqlIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","tediousIntegration","knexIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","dataloaderIntegration","awsIntegration","langChainIntegration","langGraphIntegration","mastraIntegration","vercelAIIntegration","openAIIntegration","anthropicAIIntegration","googleGenAIIntegration","mistralAIIntegration","groqIntegration","togetherAIIntegration","postgresJsIntegration","firebaseIntegration","expressIntegration","fastifyIntegration","hapiIntegration","koaIntegration"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AACF;AAGO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,oBAAA,CAAA,CAAA,CAAsC;AACpD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAACC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GAAmB,CAAA,CAAGC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAA,GAAsBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAA,CAAgB,CAAA,CAAGC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,GAAgB,CAAA;AACzF;;;"}
|
|
@@ -10,6 +10,7 @@ const embeddings = require('../ai/langchain/embeddings.js');
|
|
|
10
10
|
const utils = require('../ai/langchain/utils.js');
|
|
11
11
|
const constants$4 = require('../ai/mistral/constants.js');
|
|
12
12
|
const constants$1 = require('../ai/openai/constants.js');
|
|
13
|
+
const groq = require('./groq.js');
|
|
13
14
|
const channels = require('../orchestrion/channels.js');
|
|
14
15
|
const langchain = require('../orchestrion/config/langchain.js');
|
|
15
16
|
const tracingChannel = require('../tracing-channel.js');
|
|
@@ -33,7 +34,9 @@ const SKIPPED_PROVIDERS = [
|
|
|
33
34
|
constants$1.OPENAI_INTEGRATION_NAME,
|
|
34
35
|
constants$2.ANTHROPIC_AI_INTEGRATION_NAME,
|
|
35
36
|
constants$3.GOOGLE_GENAI_INTEGRATION_NAME,
|
|
36
|
-
constants$4.MISTRAL_INTEGRATION_NAME
|
|
37
|
+
constants$4.MISTRAL_INTEGRATION_NAME,
|
|
38
|
+
// `@langchain/groq` drives `groq-sdk`, so ChatGroq calls must not also open the Groq integration's span.
|
|
39
|
+
groq.GROQ_INTEGRATION_NAME
|
|
37
40
|
];
|
|
38
41
|
function markProvidersSkipped() {
|
|
39
42
|
core._INTERNAL_skipAiProviderWrapping(SKIPPED_PROVIDERS);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"langchain.js","sources":["../../../src/integrations/langchain.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport { _INTERNAL_skipAiProviderWrapping, defineIntegration, startInactiveSpan } from '@sentry/core';\nimport { ANTHROPIC_AI_INTEGRATION_NAME } from '../ai/anthropic-ai/constants';\nimport { GOOGLE_GENAI_INTEGRATION_NAME } from '../ai/google-genai/constants';\nimport { createLangChainCallbackHandler } from '../ai/langchain';\nimport { LANGCHAIN_INTEGRATION_NAME } from '../ai/langchain/constants';\nimport { _INTERNAL_getLangChainEmbeddingsSpanOptions } from '../ai/langchain/embeddings';\nimport type { LangChainOptions } from '../ai/langchain/types';\nimport { _INTERNAL_mergeLangChainCallbackHandler } from '../ai/langchain/utils';\nimport { MISTRAL_INTEGRATION_NAME } from '../ai/mistral/constants';\nimport { OPENAI_INTEGRATION_NAME } from '../ai/openai/constants';\nimport { CHANNELS } from '../orchestrion/channels';\nimport { langchainEmbeddingsChannels } from '../orchestrion/config/langchain';\nimport { bindTracingChannelToSpan } from '../tracing-channel';\nimport { langchainModuleNames } from '../orchestrion/config/langchain';\nimport { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';\n\n// Same name as the OTel integration by design, so the OTel 'LangChain' integration is\n// deduplicated out of the default set.\nconst INTEGRATION_NAME = LANGCHAIN_INTEGRATION_NAME;\n\n// LangChain drives the underlying AI provider SDKs itself, so while it's active those providers must\n// not also instrument, or every call would produce two spans (mirrors the OTel path's skip list).\nconst SKIPPED_PROVIDERS = [\n OPENAI_INTEGRATION_NAME,\n ANTHROPIC_AI_INTEGRATION_NAME,\n GOOGLE_GENAI_INTEGRATION_NAME,\n MISTRAL_INTEGRATION_NAME,\n];\n\n// The chat-model channels carry the live args array of `invoke(input, options)` / `_streamIterator(input, options)`.\ninterface RunnableChannelContext {\n arguments: unknown[];\n}\n\n// The embeddings channels carry the instance (`self`) and the `embedQuery(text)` / `embedDocuments(texts)` args.\ninterface EmbeddingsChannelContext {\n self?: unknown;\n arguments: unknown[];\n}\n\n// Registered lazily on the first LangChain call (not at `setupOnce`) so a direct provider call made\n// before any LangChain call still gets its own span — matches the OTel patch-on-import timing. It\n// also stops the underlying SDK from double-instrumenting embeddings, whose `embedQuery`/\n// `embedDocuments` call the provider SDK (e.g. `openai`) internally.\nfunction markProvidersSkipped(): void {\n _INTERNAL_skipAiProviderWrapping(SKIPPED_PROVIDERS);\n}\n\nconst _langChainIntegration = ((options: LangChainOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n // Chat models only mutate the call args, so they subscribe without the\n // async-context binding. Kept separate so a missing binding never defers\n // them: on the bundler path the wait would push subscription past\n // `Sentry.init()` and early calls would run with no subscriber.\n invokeOrchestrionInstrumentation(client, langchainModuleNames, instrumentChatModels, [options], {\n requiresTracingChannelBinding: false,\n });\n // Embeddings open their own spans via `bindTracingChannelToSpan`, which\n // needs the binding.\n invokeOrchestrionInstrumentation(client, langchainModuleNames, instrumentEmbeddings, [options]);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction instrumentChatModels(options: LangChainOptions): void {\n // One stateful handler tracks spans across the whole run tree, just like the OTel path.\n const sentryHandler = createLangChainCallbackHandler(options);\n\n // Chat models: inject the Sentry callback handler into the call options (arg 1). LangChain's own\n // callback dispatch then creates the spans, exactly as in the OTel path, so no span is opened\n // here — a `start` subscriber (which also makes orchestrion wrap the function) is enough.\n const injectHandler = (message: unknown): void => {\n markProvidersSkipped();\n\n const args = (message as RunnableChannelContext).arguments;\n if (!Array.isArray(args)) {\n return;\n }\n\n let callOptions = args[1] as Record<string, unknown> | undefined;\n if (!callOptions || typeof callOptions !== 'object' || Array.isArray(callOptions)) {\n callOptions = {};\n args[1] = callOptions;\n }\n\n callOptions.callbacks = _INTERNAL_mergeLangChainCallbackHandler(callOptions.callbacks, sentryHandler);\n };\n\n for (const channelName of [CHANNELS.LANGCHAIN_CHAT_MODEL_INVOKE, CHANNELS.LANGCHAIN_CHAT_MODEL_STREAM]) {\n diagnosticsChannel.tracingChannel<RunnableChannelContext>(channelName).start.subscribe(injectHandler);\n }\n}\n\n// Embeddings don't use the callback system. Wrap the method in its own span.\n// Embedding errors reject to the caller, so we only open the span (which bindTracingChannelToSpan\n// still marks failed on error) and do not capture them.\nfunction instrumentEmbeddings(options: LangChainOptions): void {\n for (const channelName of langchainEmbeddingsChannels) {\n bindTracingChannelToSpan(diagnosticsChannel.tracingChannel<EmbeddingsChannelContext>(channelName), data =>\n createEmbeddingsSpan(data, options),\n );\n }\n}\n\nfunction createEmbeddingsSpan(data: EmbeddingsChannelContext, options: LangChainOptions): Span {\n // `embedQuery`/`embedDocuments` call the provider SDK internally, so skip that SDK's own\n // instrumentation before its channel fires (the producer runs at the embeddings channel's `start`).\n markProvidersSkipped();\n\n const input = (data.arguments ?? [])[0];\n\n return startInactiveSpan(_INTERNAL_getLangChainEmbeddingsSpanOptions(data.self, input, options));\n}\n\n/**\n * Diagnostics-channel-based LangChain integration. Subscribes to the diagnostics_channels\n * injected into `@langchain/core`'s `BaseChatModel` (to inject the Sentry callback handler) and into\n * `@langchain/openai`'s embedding methods, so it requires the Sentry runtime hook or bundler plugin.\n */\nexport const langChainIntegration = defineIntegration(_langChainIntegration);\n"],"names":["LANGCHAIN_INTEGRATION_NAME","OPENAI_INTEGRATION_NAME","ANTHROPIC_AI_INTEGRATION_NAME","GOOGLE_GENAI_INTEGRATION_NAME","MISTRAL_INTEGRATION_NAME","_INTERNAL_skipAiProviderWrapping","invokeOrchestrionInstrumentation","langchainModuleNames","createLangChainCallbackHandler","_INTERNAL_mergeLangChainCallbackHandler","CHANNELS","diagnosticsChannel","langchainEmbeddingsChannels","bindTracingChannelToSpan","startInactiveSpan","_INTERNAL_getLangChainEmbeddingsSpanOptions","defineIntegration"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAmBA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA;AAIzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAA,CAAA,CAAA,CAAoB;AAAA,CAAA,CACxBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA;AAAA,CAAA,CACAC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,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AAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"langchain.js","sources":["../../../src/integrations/langchain.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport { _INTERNAL_skipAiProviderWrapping, defineIntegration, startInactiveSpan } from '@sentry/core';\nimport { ANTHROPIC_AI_INTEGRATION_NAME } from '../ai/anthropic-ai/constants';\nimport { GOOGLE_GENAI_INTEGRATION_NAME } from '../ai/google-genai/constants';\nimport { createLangChainCallbackHandler } from '../ai/langchain';\nimport { LANGCHAIN_INTEGRATION_NAME } from '../ai/langchain/constants';\nimport { _INTERNAL_getLangChainEmbeddingsSpanOptions } from '../ai/langchain/embeddings';\nimport type { LangChainOptions } from '../ai/langchain/types';\nimport { _INTERNAL_mergeLangChainCallbackHandler } from '../ai/langchain/utils';\nimport { MISTRAL_INTEGRATION_NAME } from '../ai/mistral/constants';\nimport { OPENAI_INTEGRATION_NAME } from '../ai/openai/constants';\nimport { GROQ_INTEGRATION_NAME } from './groq';\nimport { CHANNELS } from '../orchestrion/channels';\nimport { langchainEmbeddingsChannels } from '../orchestrion/config/langchain';\nimport { bindTracingChannelToSpan } from '../tracing-channel';\nimport { langchainModuleNames } from '../orchestrion/config/langchain';\nimport { invokeOrchestrionInstrumentation } from '../orchestrion/instrumentation';\n\n// Same name as the OTel integration by design, so the OTel 'LangChain' integration is\n// deduplicated out of the default set.\nconst INTEGRATION_NAME = LANGCHAIN_INTEGRATION_NAME;\n\n// LangChain drives the underlying AI provider SDKs itself, so while it's active those providers must\n// not also instrument, or every call would produce two spans (mirrors the OTel path's skip list).\nconst SKIPPED_PROVIDERS = [\n OPENAI_INTEGRATION_NAME,\n ANTHROPIC_AI_INTEGRATION_NAME,\n GOOGLE_GENAI_INTEGRATION_NAME,\n MISTRAL_INTEGRATION_NAME,\n // `@langchain/groq` drives `groq-sdk`, so ChatGroq calls must not also open the Groq integration's span.\n GROQ_INTEGRATION_NAME,\n];\n\n// The chat-model channels carry the live args array of `invoke(input, options)` / `_streamIterator(input, options)`.\ninterface RunnableChannelContext {\n arguments: unknown[];\n}\n\n// The embeddings channels carry the instance (`self`) and the `embedQuery(text)` / `embedDocuments(texts)` args.\ninterface EmbeddingsChannelContext {\n self?: unknown;\n arguments: unknown[];\n}\n\n// Registered lazily on the first LangChain call (not at `setupOnce`) so a direct provider call made\n// before any LangChain call still gets its own span — matches the OTel patch-on-import timing. It\n// also stops the underlying SDK from double-instrumenting embeddings, whose `embedQuery`/\n// `embedDocuments` call the provider SDK (e.g. `openai`) internally.\nfunction markProvidersSkipped(): void {\n _INTERNAL_skipAiProviderWrapping(SKIPPED_PROVIDERS);\n}\n\nconst _langChainIntegration = ((options: LangChainOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n // Chat models only mutate the call args, so they subscribe without the\n // async-context binding. Kept separate so a missing binding never defers\n // them: on the bundler path the wait would push subscription past\n // `Sentry.init()` and early calls would run with no subscriber.\n invokeOrchestrionInstrumentation(client, langchainModuleNames, instrumentChatModels, [options], {\n requiresTracingChannelBinding: false,\n });\n // Embeddings open their own spans via `bindTracingChannelToSpan`, which\n // needs the binding.\n invokeOrchestrionInstrumentation(client, langchainModuleNames, instrumentEmbeddings, [options]);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction instrumentChatModels(options: LangChainOptions): void {\n // One stateful handler tracks spans across the whole run tree, just like the OTel path.\n const sentryHandler = createLangChainCallbackHandler(options);\n\n // Chat models: inject the Sentry callback handler into the call options (arg 1). LangChain's own\n // callback dispatch then creates the spans, exactly as in the OTel path, so no span is opened\n // here — a `start` subscriber (which also makes orchestrion wrap the function) is enough.\n const injectHandler = (message: unknown): void => {\n markProvidersSkipped();\n\n const args = (message as RunnableChannelContext).arguments;\n if (!Array.isArray(args)) {\n return;\n }\n\n let callOptions = args[1] as Record<string, unknown> | undefined;\n if (!callOptions || typeof callOptions !== 'object' || Array.isArray(callOptions)) {\n callOptions = {};\n args[1] = callOptions;\n }\n\n callOptions.callbacks = _INTERNAL_mergeLangChainCallbackHandler(callOptions.callbacks, sentryHandler);\n };\n\n for (const channelName of [CHANNELS.LANGCHAIN_CHAT_MODEL_INVOKE, CHANNELS.LANGCHAIN_CHAT_MODEL_STREAM]) {\n diagnosticsChannel.tracingChannel<RunnableChannelContext>(channelName).start.subscribe(injectHandler);\n }\n}\n\n// Embeddings don't use the callback system. Wrap the method in its own span.\n// Embedding errors reject to the caller, so we only open the span (which bindTracingChannelToSpan\n// still marks failed on error) and do not capture them.\nfunction instrumentEmbeddings(options: LangChainOptions): void {\n for (const channelName of langchainEmbeddingsChannels) {\n bindTracingChannelToSpan(diagnosticsChannel.tracingChannel<EmbeddingsChannelContext>(channelName), data =>\n createEmbeddingsSpan(data, options),\n );\n }\n}\n\nfunction createEmbeddingsSpan(data: EmbeddingsChannelContext, options: LangChainOptions): Span {\n // `embedQuery`/`embedDocuments` call the provider SDK internally, so skip that SDK's own\n // instrumentation before its channel fires (the producer runs at the embeddings channel's `start`).\n markProvidersSkipped();\n\n const input = (data.arguments ?? [])[0];\n\n return startInactiveSpan(_INTERNAL_getLangChainEmbeddingsSpanOptions(data.self, input, options));\n}\n\n/**\n * Diagnostics-channel-based LangChain integration. Subscribes to the diagnostics_channels\n * injected into `@langchain/core`'s `BaseChatModel` (to inject the Sentry callback handler) and into\n * `@langchain/openai`'s embedding methods, so it requires the Sentry runtime hook or bundler plugin.\n */\nexport const langChainIntegration = defineIntegration(_langChainIntegration);\n"],"names":["LANGCHAIN_INTEGRATION_NAME","OPENAI_INTEGRATION_NAME","ANTHROPIC_AI_INTEGRATION_NAME","GOOGLE_GENAI_INTEGRATION_NAME","MISTRAL_INTEGRATION_NAME","GROQ_INTEGRATION_NAME","_INTERNAL_skipAiProviderWrapping","invokeOrchestrionInstrumentation","langchainModuleNames","createLangChainCallbackHandler","_INTERNAL_mergeLangChainCallbackHandler","CHANNELS","diagnosticsChannel","langchainEmbeddingsChannels","bindTracingChannelToSpan","startInactiveSpan","_INTERNAL_getLangChainEmbeddingsSpanOptions","defineIntegration"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAmBA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA;AAIzB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,iBAAA,CAAA,CAAA,CAAoB;AAAA,CAAA,CACxBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA;AAAA,CAAA,CACAC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CA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AAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAA;AACjG;AAOO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,CAAA;;"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const diagnosticsChannel = require('node:diagnostics_channel');
|
|
4
|
+
const core = require('@sentry/core');
|
|
5
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
6
|
+
const utils$1 = require('../ai/core/utils.js');
|
|
7
|
+
const index = require('../ai/openai/index.js');
|
|
8
|
+
const streaming = require('../ai/openai/streaming.js');
|
|
9
|
+
const utils = require('../ai/openai/utils.js');
|
|
10
|
+
const instrumentation = require('../orchestrion/instrumentation.js');
|
|
11
|
+
const tracingChannel = require('../tracing-channel.js');
|
|
12
|
+
|
|
13
|
+
function _interopNamespaceDefault(e) {
|
|
14
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
15
|
+
if (e) {
|
|
16
|
+
for (const k in e) {
|
|
17
|
+
n[k] = e[k];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return n;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const diagnosticsChannel__namespace = /*#__PURE__*/_interopNamespaceDefault(diagnosticsChannel);
|
|
25
|
+
|
|
26
|
+
function createOpenAiCompatibleIntegration(provider) {
|
|
27
|
+
const instrumentedChannels = [
|
|
28
|
+
{ channel: provider.channels.chat, operation: "chat" },
|
|
29
|
+
{ channel: provider.channels.embeddings, operation: "embeddings" }
|
|
30
|
+
];
|
|
31
|
+
function instrument(options) {
|
|
32
|
+
for (const { channel, operation } of instrumentedChannels) {
|
|
33
|
+
tracingChannel.bindTracingChannelToSpan(
|
|
34
|
+
diagnosticsChannel__namespace.tracingChannel(channel),
|
|
35
|
+
(data) => createGenAiSpan(data, operation, provider, options),
|
|
36
|
+
{
|
|
37
|
+
beforeSpanEnd: (span, data) => {
|
|
38
|
+
utils.addResponseAttributes(span, data.result, utils$1.resolveAIRecordingOptions(options).recordOutputs);
|
|
39
|
+
},
|
|
40
|
+
// Streaming: the result is a `Stream` consumed later, so instrument it and let it end the span.
|
|
41
|
+
deferSpanEnd: ({ span, data }) => wrapStreamResult(span, data, options)
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return ((options = {}) => {
|
|
47
|
+
return {
|
|
48
|
+
name: provider.integrationName,
|
|
49
|
+
setup(client) {
|
|
50
|
+
instrumentation.invokeOrchestrionInstrumentation(client, provider.moduleNames, instrument, [options]);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function createGenAiSpan(data, operation, provider, options) {
|
|
56
|
+
if (core._INTERNAL_shouldSkipAiProviderWrapping(provider.integrationName)) {
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
59
|
+
const args = data.arguments ?? [];
|
|
60
|
+
const params = args[0];
|
|
61
|
+
const { recordInputs } = utils$1.resolveAIRecordingOptions(options);
|
|
62
|
+
const attributes$1 = index.extractRequestAttributes(args, operation, recordInputs);
|
|
63
|
+
attributes$1[attributes.GEN_AI_PROVIDER_NAME] = provider.providerName;
|
|
64
|
+
attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = provider.origin;
|
|
65
|
+
const model = params?.model || "unknown";
|
|
66
|
+
const client = core.getClient();
|
|
67
|
+
const span = core.startInactiveSpan({
|
|
68
|
+
// With span streaming, omit the `'unknown'` model sentinel so the name stays low-cardinality.
|
|
69
|
+
name: model !== "unknown" || !(client && core.hasSpanStreamingEnabled(client)) ? `${operation} ${model}` : operation,
|
|
70
|
+
op: utils$1.getGenAiSpanOp(operation),
|
|
71
|
+
attributes: attributes$1
|
|
72
|
+
});
|
|
73
|
+
if (recordInputs && params) {
|
|
74
|
+
index.addRequestAttributes(span, params, operation);
|
|
75
|
+
}
|
|
76
|
+
return span;
|
|
77
|
+
}
|
|
78
|
+
function isAsyncIterable(value) {
|
|
79
|
+
return !!value && typeof value[Symbol.asyncIterator] === "function";
|
|
80
|
+
}
|
|
81
|
+
function wrapStreamResult(span, data, options) {
|
|
82
|
+
const result = data.result;
|
|
83
|
+
if (!isAsyncIterable(result)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const { recordOutputs } = utils$1.resolveAIRecordingOptions(options);
|
|
87
|
+
const iterate = result[Symbol.asyncIterator].bind(result);
|
|
88
|
+
const instrumented = streaming.instrumentStream({ [Symbol.asyncIterator]: iterate }, span, recordOutputs ?? false);
|
|
89
|
+
result[Symbol.asyncIterator] = () => instrumented;
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
exports.createOpenAiCompatibleIntegration = createOpenAiCompatibleIntegration;
|
|
94
|
+
//# sourceMappingURL=openai-compatible.js.map
|