@sentry/server-utils 11.22.0 → 11.23.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 +10 -10
- package/build/cjs/chunks/config.js +2 -2
- package/build/cjs/chunks/config.js.map +1 -1
- package/build/cjs/chunks/core.js +0 -1
- package/build/cjs/chunks/exports.js +72 -27
- package/build/cjs/chunks/exports.js.map +1 -1
- package/build/cjs/chunks/module-details-from-path.js +427 -428
- package/build/cjs/chunks/module-details-from-path.js.map +1 -1
- package/build/cjs/chunks/moduleInjectedTransform.js +419 -421
- package/build/cjs/chunks/moduleInjectedTransform.js.map +1 -1
- package/build/cjs/chunks/rolldown-runtime.js +8 -6
- package/build/cjs/index.js +42 -25
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.request-handler.js +2 -2
- package/build/cjs/orchestrion/bundler/bun.js +1 -1
- package/build/cjs/orchestrion/bundler/esbuild.js +1 -1
- package/build/cjs/orchestrion/bundler/rollup.js +1 -1
- package/build/cjs/orchestrion/bundler/vite.js +2 -2
- package/build/cjs/orchestrion/bundler/webpack-loader.js +2 -2
- package/build/cjs/orchestrion/bundler/webpack.js +4 -4
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/defineProperty.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/assertClassBrand.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/checkPrivateRedeclaration.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/classPrivateFieldGet2.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/classPrivateFieldInitSpec.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/classPrivateFieldSet2.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/classPrivateMethodInitSpec.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/defineProperty.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/toPrimitive.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/toPropertyKey.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/esm/typeof.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/toPrimitive.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/toPropertyKey.js +1 -1
- package/build/esm/_virtual/{_@oxc-project_runtime@0.158.0 → _@oxc-project_runtime@0.160.0}/helpers/typeof.js +1 -1
- package/build/esm/_virtual/_rolldown/runtime.js +8 -6
- package/build/esm/ai/anthropic-ai/index.js +2 -2
- package/build/esm/ai/anthropic-ai/streaming.js +11 -2
- package/build/esm/ai/anthropic-ai/streaming.js.map +1 -1
- package/build/esm/ai/anthropic-ai/tool-runner.js +3 -3
- package/build/esm/ai/anthropic-ai/utils.js +2 -2
- package/build/esm/ai/core/span-hooks.js +1 -1
- package/build/esm/ai/core/time-to-first-chunk.js +1 -1
- package/build/esm/ai/core/utils.js +2 -2
- package/build/esm/ai/flue/index.js +2 -2
- package/build/esm/ai/flue/utils.js +2 -2
- package/build/esm/ai/google-genai/decisions.js +1 -1
- package/build/esm/ai/google-genai/index.js +2 -2
- package/build/esm/ai/google-genai/streaming.js +9 -2
- package/build/esm/ai/google-genai/streaming.js.map +1 -1
- package/build/esm/ai/google-genai/utils.js +1 -1
- package/build/esm/ai/langchain/embeddings.js +3 -3
- package/build/esm/ai/langchain/index.js +15 -9
- package/build/esm/ai/langchain/index.js.map +1 -1
- package/build/esm/ai/langchain/typesafe-classifier.js +2 -2
- package/build/esm/ai/langchain/utils.js +3 -4
- package/build/esm/ai/langchain/utils.js.map +1 -1
- package/build/esm/ai/langgraph/agent-span.js +3 -3
- package/build/esm/ai/langgraph/index.js +1 -1
- package/build/esm/ai/langgraph/stream.js +2 -2
- package/build/esm/ai/langgraph/utils.js +3 -3
- package/build/esm/ai/mastra/index.js +2 -2
- package/build/esm/ai/mastra/span-registry.js +1 -1
- package/build/esm/ai/mastra/utils.js +2 -2
- package/build/esm/ai/mistral/index.js +2 -2
- package/build/esm/ai/mistral/streaming.js +18 -9
- package/build/esm/ai/mistral/streaming.js.map +1 -1
- package/build/esm/ai/openai/index.js +2 -2
- package/build/esm/ai/openai/mapping.js +1 -1
- package/build/esm/ai/openai/streaming.js +15 -2
- package/build/esm/ai/openai/streaming.js.map +1 -1
- package/build/esm/ai/openai/utils.js +2 -2
- package/build/esm/ai/pi-ai/chat.js +12 -4
- package/build/esm/ai/pi-ai/chat.js.map +1 -1
- package/build/esm/ai/pi-ai/providers.js +1 -1
- package/build/esm/ai/pi-ai/recording.js +1 -1
- package/build/esm/ai/pi-durable/index.js +2 -2
- package/build/esm/ai/pi-durable/runs.js +3 -3
- package/build/esm/ai/pi-durable/tools.js +3 -3
- package/build/esm/ai/tanstack-ai/index.js +2 -2
- package/build/esm/ai/tanstack-ai/utils.js +2 -2
- package/build/esm/ai/typesafe/index.js +3 -3
- package/build/esm/ai/workers-ai/index.js +2 -2
- package/build/esm/ai/workers-ai/streaming.js +7 -5
- package/build/esm/ai/workers-ai/streaming.js.map +1 -1
- package/build/esm/ai/workers-ai/utils.js +3 -3
- package/build/esm/async-context.js +1 -1
- package/build/esm/cron/common.js +1 -1
- package/build/esm/cron/cron.js +1 -1
- package/build/esm/cron/node-cron.js +1 -1
- package/build/esm/cron/node-schedule.js +1 -1
- package/build/esm/eve.js +1 -1
- package/build/esm/integrations/amqplib.js +3 -3
- package/build/esm/integrations/anthropic.js +3 -4
- package/build/esm/integrations/anthropic.js.map +1 -1
- package/build/esm/integrations/aws-sdk/index.js +3 -3
- package/build/esm/integrations/aws-sdk/services/MessageAttributes.js +1 -1
- package/build/esm/integrations/aws-sdk/services/bedrock-runtime-content.js +2 -2
- package/build/esm/integrations/aws-sdk/services/bedrock-runtime.js +3 -3
- package/build/esm/integrations/aws-sdk/services/dynamodb.js +1 -1
- package/build/esm/integrations/aws-sdk/services/lambda.js +2 -2
- package/build/esm/integrations/aws-sdk/services/sns.js +3 -3
- package/build/esm/integrations/aws-sdk/services/sqs.js +2 -2
- package/build/esm/integrations/bullmq/meter.js +2 -2
- package/build/esm/integrations/bullmq/tracer.js +2 -2
- package/build/esm/integrations/clickhouse.js +3 -3
- package/build/esm/integrations/cron.js +1 -1
- package/build/esm/integrations/dataloader.js +3 -3
- package/build/esm/integrations/express/error-handler.js +1 -1
- package/build/esm/integrations/express/index.js +1 -1
- package/build/esm/integrations/express/instrumentation.js +3 -3
- package/build/esm/integrations/fastify/errors.js +1 -1
- package/build/esm/integrations/fastify/index.js +1 -1
- package/build/esm/integrations/fastify/instrumentation.js +3 -3
- package/build/esm/integrations/firebase/firestore.js +2 -2
- package/build/esm/integrations/firebase/functions.js +1 -1
- package/build/esm/integrations/firebase/index.js +1 -1
- package/build/esm/integrations/flue.js +1 -1
- package/build/esm/integrations/generic-pool.js +3 -3
- package/build/esm/integrations/google-genai.js +2 -2
- package/build/esm/integrations/graphql/graphql-dc-subscriber.js +3 -3
- package/build/esm/integrations/graphql/index.js +1 -1
- package/build/esm/integrations/graphql/resolvers.js +2 -2
- package/build/esm/integrations/graphql/spans.js +3 -3
- package/build/esm/integrations/groq.js +1 -1
- package/build/esm/integrations/hapi/hapi-error-handler.js +1 -1
- package/build/esm/integrations/hapi/hapi-utils.js +4 -5
- package/build/esm/integrations/hapi/hapi-utils.js.map +1 -1
- package/build/esm/integrations/hapi/index.js +1 -1
- package/build/esm/integrations/hono/applyPatches.js +1 -1
- package/build/esm/integrations/hono/createHonoMiddleware.js +1 -1
- package/build/esm/integrations/hono/honoIntegration.js +3 -3
- package/build/esm/integrations/hono/matchResult.js +1 -1
- package/build/esm/integrations/hono/middlewareHandlers.js +2 -2
- package/build/esm/integrations/hono/patchAppRequest.js +3 -3
- package/build/esm/integrations/hono/patchAppUse.js +1 -1
- package/build/esm/integrations/hono/patchRoute.js +1 -1
- package/build/esm/integrations/hono/wrapMiddlewareSpan.js +3 -3
- package/build/esm/integrations/kafkajs/consumer.js +2 -2
- package/build/esm/integrations/kafkajs/index.js +1 -1
- package/build/esm/integrations/kafkajs/spans.js +2 -2
- package/build/esm/integrations/knex.js +3 -3
- package/build/esm/integrations/koa/index.js +3 -3
- package/build/esm/integrations/langchain.js +1 -1
- package/build/esm/integrations/langgraph.js +1 -1
- package/build/esm/integrations/lru-memoizer.js +1 -1
- package/build/esm/integrations/mastra-classifier.js +2 -2
- package/build/esm/integrations/mastra.js +4 -4
- package/build/esm/integrations/mcp-server.js +2 -2
- package/build/esm/integrations/mistral.js +2 -2
- package/build/esm/integrations/mongodb/index.js +1 -1
- package/build/esm/integrations/mongodb/mongodb-span.js +1 -1
- package/build/esm/integrations/mongoose/index.js +1 -1
- package/build/esm/integrations/mongoose/mongoose-dc-subscriber.js +3 -3
- package/build/esm/integrations/mongoose/mongoose-legacy-span.js +1 -1
- package/build/esm/integrations/mysql.js +3 -3
- package/build/esm/integrations/mysql2/index.js +1 -1
- package/build/esm/integrations/mysql2/mysql2-dc-subscriber.js +3 -3
- package/build/esm/integrations/neon.js +3 -3
- package/build/esm/integrations/nitro/captureStorageEvents.js +3 -3
- package/build/esm/integrations/nitro/captureTracingEvents.js +3 -3
- package/build/esm/integrations/nitro/index.js +1 -1
- package/build/esm/integrations/nitro/setServerTimingHeaders.js +1 -1
- package/build/esm/integrations/node-cron.js +1 -1
- package/build/esm/integrations/node-schedule.js +1 -1
- package/build/esm/integrations/openai-compatible.js +2 -2
- package/build/esm/integrations/openai.js +2 -2
- package/build/esm/integrations/pg.js +3 -3
- package/build/esm/integrations/pi-ai.js +1 -1
- package/build/esm/integrations/pi-durable.js +1 -1
- package/build/esm/integrations/pino.js +1 -1
- package/build/esm/integrations/postgresjs/index.js +3 -3
- package/build/esm/integrations/postgresjs/postgresjs-dc-subscriber.js +3 -3
- package/build/esm/integrations/postgresjs-wrapper.js +1 -1
- package/build/esm/integrations/prisma/index.js +1 -1
- package/build/esm/integrations/prisma/orchestrion.js +8 -12
- package/build/esm/integrations/prisma/orchestrion.js.map +1 -1
- package/build/esm/integrations/prisma/tracing-helper.js +2 -2
- package/build/esm/integrations/redis/index.js +3 -3
- package/build/esm/integrations/redis/ioredis-channel-subscriber.js +3 -3
- package/build/esm/integrations/redis/redis-cache.js +1 -1
- package/build/esm/integrations/redis/redis-dc-subscriber.js +3 -3
- package/build/esm/integrations/serveTunnel.js +2 -2
- package/build/esm/integrations/tanstack-ai.js +1 -1
- package/build/esm/integrations/tedious.js +4 -4
- package/build/esm/integrations/together-ai.js +1 -1
- package/build/esm/integrations/typesafe.js +1 -1
- package/build/esm/integrations/vercel-ai/extract.js +1 -1
- package/build/esm/integrations/vercel-ai/index.js +1 -1
- package/build/esm/integrations/vercel-ai/util.js +21 -2
- package/build/esm/integrations/vercel-ai/util.js.map +1 -1
- package/build/esm/integrations/vercel-ai/vercel-ai-dc-subscriber.js +3 -3
- package/build/esm/integrations/vercel-ai/vercel-ai-orchestrion-subscriber.js +1 -1
- package/build/esm/integrations/vercel-ai/vercel-ai-tool-telemetry.js +3 -3
- package/build/esm/integrations/winston.js +1 -1
- package/build/esm/opentelemetry.js +1 -1
- package/build/esm/orchestrion/bundler/esbuild.js +1 -1
- package/build/esm/orchestrion/bundler/externalRequire.js +1 -1
- package/build/esm/orchestrion/bundler/rollup.js +1 -1
- package/build/esm/orchestrion/bundler/webpack-loader.js +1 -1
- package/build/esm/orchestrion/bundler/webpack.js +1 -1
- package/build/esm/orchestrion/config/index.js +1 -1
- package/build/esm/orchestrion/config/mistral.js +1 -1
- package/build/esm/orchestrion/config/mistral.js.map +1 -1
- package/build/esm/orchestrion/detect.js +1 -1
- package/build/esm/orchestrion/instrumentation.js +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/tracing-channel.js +1 -2
- package/build/esm/tracing-channel.js.map +1 -1
- package/build/esm/utils/cronMonitoring.js +1 -1
- package/build/esm/utils/diagnosticsChannel.js +1 -1
- package/build/esm/utils/module.js +2 -2
- package/build/esm/utils/module.js.map +1 -1
- package/build/esm/utils/monitorStream.js +1 -1
- package/build/esm/utils/serverTimingTraceHeader.js +1 -1
- package/build/esm/utils/tunnelServer.js +1 -1
- package/build/esm/utils/wrapServerRequestHandler.js +4 -4
- package/build/esm/vendored/@apm-js-collab/code-transformer/lib/matcher.js +3 -3
- package/build/esm/vendored/@apm-js-collab/code-transformer/lib/transformer.js +5 -5
- package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/core-BiWIBBjf.js +1 -1
- package/build/esm/vendored/@apm-js-collab/code-transformer-bundler-plugins/dist/esm/webpack-loader-factory.js +1 -1
- package/build/esm/vendored/esquery/dist/esquery.min.js +1 -0
- package/build/esm/vendored/esquery/dist/esquery.min.js.map +1 -1
- package/build/esm/vendored/meriyah/dist/meriyah.js +416 -418
- package/build/esm/vendored/meriyah/dist/meriyah.js.map +1 -1
- package/build/esm/vendored/meriyah/dist/meriyah2.js +416 -418
- package/build/esm/vendored/meriyah/dist/meriyah2.js.map +1 -1
- package/build/esm/vendored/source-map/lib/base64-vlq.js +1 -1
- package/build/esm/vendored/source-map/lib/base64-vlq.js.map +1 -1
- package/build/types/ai/anthropic-ai/streaming.d.ts.map +1 -1
- package/build/types/ai/anthropic-ai/types.d.ts +1 -0
- package/build/types/ai/anthropic-ai/types.d.ts.map +1 -1
- package/build/types/ai/google-genai/streaming.d.ts.map +1 -1
- package/build/types/ai/langchain/index.d.ts.map +1 -1
- package/build/types/ai/mistral/streaming.d.ts.map +1 -1
- package/build/types/ai/openai/streaming.d.ts.map +1 -1
- package/build/types/ai/pi-ai/chat.d.ts.map +1 -1
- package/build/types/ai/workers-ai/streaming.d.ts.map +1 -1
- package/build/types/integrations/vercel-ai/util.d.ts.map +1 -1
- package/build/types/orchestrion/config/mistral.d.ts +3 -3
- package/build/types/tracing-channel.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -15,12 +15,14 @@ var __esmMin = (fn, res, err) => () => {
|
|
|
15
15
|
};
|
|
16
16
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
17
17
|
var __copyProps = (to, from, except, desc) => {
|
|
18
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
19
|
-
key
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
20
|
+
desc = __getOwnPropDesc(from, key);
|
|
21
|
+
__defProp(to, key, {
|
|
22
|
+
get: desc && desc.get && !desc.configurable ? desc.get : () => from[key],
|
|
23
|
+
enumerable: !desc || desc.enumerable
|
|
24
|
+
});
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
27
|
return to;
|
|
26
28
|
};
|
package/build/cjs/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./chunks/rolldown-runtime.js");
|
|
3
3
|
const require_exports = require("./chunks/exports.js");
|
|
4
|
+
let _sentry_core = require("@sentry/core");
|
|
4
5
|
const require_debug_build = require("./chunks/debug-build.js");
|
|
5
|
-
const require_config = require("./chunks/config.js");
|
|
6
|
-
const require_pi_ai = require("./chunks/pi-ai.js");
|
|
7
6
|
let _sentry_conventions_attributes = require("@sentry/conventions/attributes");
|
|
8
|
-
let _sentry_core = require("@sentry/core");
|
|
9
7
|
let _sentry_conventions_op = require("@sentry/conventions/op");
|
|
10
|
-
let _sentry_core_server = require("@sentry/core/server");
|
|
11
8
|
let node_diagnostics_channel = require("node:diagnostics_channel");
|
|
12
|
-
|
|
9
|
+
const require_config = require("./chunks/config.js");
|
|
10
|
+
const require_pi_ai = require("./chunks/pi-ai.js");
|
|
13
11
|
let _sentry_conventions_metrics = require("@sentry/conventions/metrics");
|
|
14
12
|
let node_module = require("node:module");
|
|
15
13
|
let node_path = require("node:path");
|
|
16
14
|
let node_url = require("node:url");
|
|
15
|
+
let _sentry_core_server = require("@sentry/core/server");
|
|
17
16
|
let node_events = require("node:events");
|
|
18
17
|
let node_net = require("node:net");
|
|
18
|
+
node_diagnostics_channel = require_rolldown_runtime.__toESM(node_diagnostics_channel);
|
|
19
19
|
node_net = require_rolldown_runtime.__toESM(node_net);
|
|
20
20
|
// src/integrations/koa/koa-error-handler.ts
|
|
21
21
|
const ERROR_HANDLER_ATTACHED = "__SENTRY_KOA_ERROR_HANDLER_ATTACHED__";
|
|
@@ -260,8 +260,7 @@ function wrapExtArguments(args, pluginName) {
|
|
|
260
260
|
return;
|
|
261
261
|
} else if (isDirectExtInput(args)) {
|
|
262
262
|
const extInput = args;
|
|
263
|
-
|
|
264
|
-
args[1] = wrapExtMethods(method, extInput[0], pluginName);
|
|
263
|
+
args[1] = wrapExtMethods(extInput[1], extInput[0], pluginName);
|
|
265
264
|
return;
|
|
266
265
|
} else if (isLifecycleExtEventObj(args[0])) {
|
|
267
266
|
const lifecycleEventObj = args[0];
|
|
@@ -460,7 +459,6 @@ function getErrorInfo(error) {
|
|
|
460
459
|
};
|
|
461
460
|
}
|
|
462
461
|
function getStoreWithActiveSpan(asyncLocalStorage, span) {
|
|
463
|
-
if ((0, _sentry_core.spanIsIgnored)(span) && (0, _sentry_core.getRootSpan)(span) !== span) return asyncLocalStorage.getStore();
|
|
464
462
|
return (0, _sentry_core.withActiveSpan)(span, () => {
|
|
465
463
|
return asyncLocalStorage.getStore();
|
|
466
464
|
});
|
|
@@ -1300,7 +1298,7 @@ function patchConsumption(result, span, end) {
|
|
|
1300
1298
|
const toArray = result.toArray;
|
|
1301
1299
|
const asyncIterator = result[Symbol.asyncIterator];
|
|
1302
1300
|
const patchedToArray = function() {
|
|
1303
|
-
return
|
|
1301
|
+
return (0, _sentry_core.withActiveSpan)(span, () => toArray.call(this)).then((value) => {
|
|
1304
1302
|
end();
|
|
1305
1303
|
return value;
|
|
1306
1304
|
}, (error) => {
|
|
@@ -1309,16 +1307,12 @@ function patchConsumption(result, span, end) {
|
|
|
1309
1307
|
});
|
|
1310
1308
|
};
|
|
1311
1309
|
const patchedAsyncIterator = function() {
|
|
1312
|
-
return wrapIterator(
|
|
1310
|
+
return wrapIterator((0, _sentry_core.withActiveSpan)(span, () => asyncIterator.call(this)), span, end);
|
|
1313
1311
|
};
|
|
1314
1312
|
result.toArray = patchedToArray;
|
|
1315
1313
|
result[Symbol.asyncIterator] = patchedAsyncIterator;
|
|
1316
1314
|
return true;
|
|
1317
1315
|
}
|
|
1318
|
-
function runUnderSpan(span, callback) {
|
|
1319
|
-
if ((0, _sentry_core.spanIsIgnored)(span) && (0, _sentry_core.getRootSpan)(span) !== span) return callback();
|
|
1320
|
-
return (0, _sentry_core.withActiveSpan)(span, callback);
|
|
1321
|
-
}
|
|
1322
1316
|
function wrapIterator(iterator, span, end) {
|
|
1323
1317
|
const settle = (step) => step.then((result) => {
|
|
1324
1318
|
if (result.done) end();
|
|
@@ -1328,7 +1322,7 @@ function wrapIterator(iterator, span, end) {
|
|
|
1328
1322
|
throw error;
|
|
1329
1323
|
});
|
|
1330
1324
|
return {
|
|
1331
|
-
next: (...args) => settle(
|
|
1325
|
+
next: (...args) => settle((0, _sentry_core.withActiveSpan)(span, () => iterator.next(...args))),
|
|
1332
1326
|
return: (value) => {
|
|
1333
1327
|
const iteratorReturn = iterator.return?.bind(iterator);
|
|
1334
1328
|
if (!iteratorReturn) {
|
|
@@ -1338,7 +1332,7 @@ function wrapIterator(iterator, span, end) {
|
|
|
1338
1332
|
value
|
|
1339
1333
|
});
|
|
1340
1334
|
}
|
|
1341
|
-
return settle(
|
|
1335
|
+
return settle((0, _sentry_core.withActiveSpan)(span, () => iteratorReturn(value)));
|
|
1342
1336
|
},
|
|
1343
1337
|
throw: (error) => {
|
|
1344
1338
|
const iteratorThrow = iterator.throw?.bind(iterator);
|
|
@@ -1346,7 +1340,7 @@ function wrapIterator(iterator, span, end) {
|
|
|
1346
1340
|
end(error);
|
|
1347
1341
|
return Promise.reject(error);
|
|
1348
1342
|
}
|
|
1349
|
-
return settle(
|
|
1343
|
+
return settle((0, _sentry_core.withActiveSpan)(span, () => iteratorThrow(error)));
|
|
1350
1344
|
},
|
|
1351
1345
|
[Symbol.asyncIterator]() {
|
|
1352
1346
|
return this;
|
|
@@ -1953,8 +1947,7 @@ function instrumentAnthropic(options) {
|
|
|
1953
1947
|
function createGenAiSpan$4(data, operation, options, stream) {
|
|
1954
1948
|
const args = data.arguments ?? [];
|
|
1955
1949
|
if (require_exports.shouldSkipAiProviderSpan(INTEGRATION_NAME$32)) return;
|
|
1956
|
-
|
|
1957
|
-
if (isStreamHelperRequest(requestOptions?.headers) && isInsideStreamHelperSpan()) return;
|
|
1950
|
+
if (isStreamHelperRequest(args[1]?.headers) && isInsideStreamHelperSpan()) return;
|
|
1958
1951
|
const params = typeof args[0] === "object" && args[0] !== null ? args[0] : void 0;
|
|
1959
1952
|
const call = {
|
|
1960
1953
|
operation,
|
|
@@ -3619,10 +3612,7 @@ function beforeSchedule(change, options) {
|
|
|
3619
3612
|
* keeps runs from an earlier spec, the job doesn't check in.
|
|
3620
3613
|
*/
|
|
3621
3614
|
function onSchedule(change) {
|
|
3622
|
-
if (change.result === true)
|
|
3623
|
-
const job = change.self;
|
|
3624
|
-
updateMonitorConfig(job?.job, addsToPendingRuns.has(change) ? void 0 : getMonitorConfig(change.arguments[0]));
|
|
3625
|
-
}
|
|
3615
|
+
if (change.result === true) updateMonitorConfig(change.self?.job, addsToPendingRuns.has(change) ? void 0 : getMonitorConfig(change.arguments[0]));
|
|
3626
3616
|
}
|
|
3627
3617
|
/** Whether node-schedule runs a job with this spec once: a `Date`, a timestamp, or a date string. */
|
|
3628
3618
|
function isOneOffSpec(spec) {
|
|
@@ -6365,6 +6355,14 @@ function getRequestContentAttributes(context) {
|
|
|
6365
6355
|
};
|
|
6366
6356
|
}
|
|
6367
6357
|
/**
|
|
6358
|
+
* Whether an event carries new model output. `start`, empty `*_start`, `*_end` and `done` events do not.
|
|
6359
|
+
*/
|
|
6360
|
+
function hasOutput$1(event) {
|
|
6361
|
+
const { type, delta } = event ?? {};
|
|
6362
|
+
if (type === "text_delta" || type === "thinking_delta" || type === "toolcall_delta") return !!delta;
|
|
6363
|
+
return type === "toolcall_start";
|
|
6364
|
+
}
|
|
6365
|
+
/**
|
|
6368
6366
|
* Records `gen_ai.response.time_to_first_chunk` for a streamed request. The stream has one consumer,
|
|
6369
6367
|
* so instead of reading it, this wraps `push`, which the provider calls for each event as it decodes
|
|
6370
6368
|
* it. The wrapper is removed after the first chunk.
|
|
@@ -6373,7 +6371,7 @@ function observePiAiFirstChunk(span, events) {
|
|
|
6373
6371
|
const push = events?.push;
|
|
6374
6372
|
if (!events || typeof push !== "function") return;
|
|
6375
6373
|
events.push = function(event) {
|
|
6376
|
-
if (event
|
|
6374
|
+
if (hasOutput$1(event)) {
|
|
6377
6375
|
require_exports.recordTimeToFirstChunk(span);
|
|
6378
6376
|
events.push = push;
|
|
6379
6377
|
}
|
|
@@ -9660,7 +9658,7 @@ function tapModelCallStream(span, stream, onFinal, onError) {
|
|
|
9660
9658
|
controller.close();
|
|
9661
9659
|
return;
|
|
9662
9660
|
}
|
|
9663
|
-
if (value
|
|
9661
|
+
if (hasOutput(value)) require_exports.recordTimeToFirstChunk(span);
|
|
9664
9662
|
text += accumulateChunk(state, value) ?? "";
|
|
9665
9663
|
controller.enqueue(value);
|
|
9666
9664
|
} catch (error) {
|
|
@@ -9675,6 +9673,25 @@ function tapModelCallStream(span, stream, onFinal, onError) {
|
|
|
9675
9673
|
});
|
|
9676
9674
|
}
|
|
9677
9675
|
/**
|
|
9676
|
+
* Whether a chunk carries new model output, which is what `gen_ai.response.time_to_first_chunk` measures.
|
|
9677
|
+
* `stream-start`, `response-metadata`, empty `*-start` and `finish` chunks do not.
|
|
9678
|
+
*/
|
|
9679
|
+
function hasOutput(chunk) {
|
|
9680
|
+
if (!(0, _sentry_core.isObjectLike)(chunk)) return false;
|
|
9681
|
+
const { type, delta, textDelta, argsTextDelta } = chunk;
|
|
9682
|
+
switch (type) {
|
|
9683
|
+
case "text-delta":
|
|
9684
|
+
case "reasoning-delta":
|
|
9685
|
+
case "tool-input-delta": return !!(delta ?? textDelta);
|
|
9686
|
+
case "reasoning": return !!textDelta;
|
|
9687
|
+
case "tool-call-delta": return !!argsTextDelta;
|
|
9688
|
+
case "tool-input-start":
|
|
9689
|
+
case "tool-call":
|
|
9690
|
+
case "file": return true;
|
|
9691
|
+
default: return false;
|
|
9692
|
+
}
|
|
9693
|
+
}
|
|
9694
|
+
/**
|
|
9678
9695
|
* Fold a single streamed chunk into the running aggregate. Returns any text delta so the caller can
|
|
9679
9696
|
* accumulate it (kept out of `state` until the end to avoid re-joining on every chunk).
|
|
9680
9697
|
*/
|