@sentry/core 10.37.0 → 10.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +79 -79
- package/build/cjs/integrations/captureconsole.js +2 -2
- package/build/cjs/integrations/captureconsole.js.map +1 -1
- package/build/cjs/integrations/mcp-server/errorCapture.js +2 -2
- package/build/cjs/integrations/mcp-server/errorCapture.js.map +1 -1
- package/build/cjs/integrations/supabase.js +4 -4
- package/build/cjs/integrations/supabase.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/index.js +3 -3
- package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/streaming.js +3 -3
- package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/utils.js +2 -2
- package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
- package/build/cjs/tracing/google-genai/index.js +3 -3
- package/build/cjs/tracing/google-genai/index.js.map +1 -1
- package/build/cjs/tracing/google-genai/streaming.js +2 -2
- package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
- package/build/cjs/tracing/langchain/index.js +4 -4
- package/build/cjs/tracing/langchain/index.js.map +1 -1
- package/build/cjs/tracing/langgraph/index.js +3 -3
- package/build/cjs/tracing/langgraph/index.js.map +1 -1
- package/build/cjs/tracing/openai/index.js +3 -3
- package/build/cjs/tracing/openai/index.js.map +1 -1
- package/build/cjs/tracing/openai/streaming.js +2 -2
- package/build/cjs/tracing/openai/streaming.js.map +1 -1
- package/build/cjs/trpc.js +3 -3
- package/build/cjs/trpc.js.map +1 -1
- package/build/cjs/utils/aggregate-errors.js +13 -5
- package/build/cjs/utils/aggregate-errors.js.map +1 -1
- package/build/cjs/utils/exports.js +7 -7
- package/build/cjs/utils/exports.js.map +1 -1
- package/build/cjs/utils/flushIfServerless.js +2 -2
- package/build/cjs/utils/flushIfServerless.js.map +1 -1
- package/build/cjs/utils/traceData.js +2 -2
- package/build/cjs/utils/traceData.js.map +1 -1
- package/build/cjs/utils/version.js +1 -1
- package/build/esm/exports.js +2 -2
- package/build/esm/feedback.js +1 -1
- package/build/esm/integrations/moduleMetadata.js +1 -1
- package/build/esm/integrations/third-party-errors-filter.js +1 -1
- package/build/esm/logs/internal.js +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/tracing/measurement.js +1 -1
- package/build/esm/tracing/trace.js +3 -3
- package/build/esm/utils/aggregate-errors.js +13 -5
- package/build/esm/utils/aggregate-errors.js.map +1 -1
- package/build/esm/utils/exports.js +7 -7
- package/build/esm/utils/exports.js.map +1 -1
- package/build/esm/utils/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const _exports = require('../exports.js');
|
|
4
4
|
const debugLogger = require('./debug-logger.js');
|
|
5
5
|
const vercelWaitUntil = require('./vercelWaitUntil.js');
|
|
6
6
|
const worldwide = require('./worldwide.js');
|
|
@@ -8,7 +8,7 @@ const worldwide = require('./worldwide.js');
|
|
|
8
8
|
async function flushWithTimeout(timeout) {
|
|
9
9
|
try {
|
|
10
10
|
debugLogger.debug.log('Flushing events...');
|
|
11
|
-
await
|
|
11
|
+
await _exports.flush(timeout);
|
|
12
12
|
debugLogger.debug.log('Done flushing events');
|
|
13
13
|
} catch (e) {
|
|
14
14
|
debugLogger.debug.log('Error while flushing events:\n', e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flushIfServerless.js","sources":["../../../src/utils/flushIfServerless.ts"],"sourcesContent":["import { flush } from '../exports';\nimport { debug } from './debug-logger';\nimport { vercelWaitUntil } from './vercelWaitUntil';\nimport { GLOBAL_OBJ } from './worldwide';\n\ntype MinimalCloudflareContext = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n waitUntil(promise: Promise<any>): void;\n};\n\nasync function flushWithTimeout(timeout: number): Promise<void> {\n try {\n debug.log('Flushing events...');\n await flush(timeout);\n debug.log('Done flushing events');\n } catch (e) {\n debug.log('Error while flushing events:\\n', e);\n }\n}\n\n/**\n * Flushes the event queue with a timeout in serverless environments to ensure that events are sent to Sentry before the\n * serverless function execution ends.\n *\n * The function is async, but in environments that support a `waitUntil` mechanism, it will run synchronously.\n *\n * This function is aware of the following serverless platforms:\n * - Cloudflare: If a Cloudflare context is provided, it will use `ctx.waitUntil()` to flush events (keeps the `this` context of `ctx`).\n * If a `cloudflareWaitUntil` function is provided, it will use that to flush events (looses the `this` context of `ctx`).\n * - Vercel: It detects the Vercel environment and uses Vercel's `waitUntil` function.\n * - Other Serverless (AWS Lambda, Google Cloud, etc.): It detects the environment via environment variables\n * and uses a regular `await flush()`.\n *\n * @internal This function is supposed for internal Sentry SDK usage only.\n * @hidden\n */\nexport async function flushIfServerless(\n params: // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | { timeout?: number; cloudflareWaitUntil?: (task: Promise<any>) => void }\n | { timeout?: number; cloudflareCtx?: MinimalCloudflareContext } = {},\n): Promise<void> {\n const { timeout = 2000 } = params;\n\n if ('cloudflareWaitUntil' in params && typeof params?.cloudflareWaitUntil === 'function') {\n params.cloudflareWaitUntil(flushWithTimeout(timeout));\n return;\n }\n\n if ('cloudflareCtx' in params && typeof params.cloudflareCtx?.waitUntil === 'function') {\n params.cloudflareCtx.waitUntil(flushWithTimeout(timeout));\n return;\n }\n\n // Note: vercelWaitUntil only does something in Vercel Edge runtime\n // In Node runtime, we use process.on('SIGTERM') instead\n // @ts-expect-error This is not typed\n if (GLOBAL_OBJ[Symbol.for('@vercel/request-context')]) {\n // Vercel has a waitUntil equivalent that works without execution context\n vercelWaitUntil(flushWithTimeout(timeout));\n return;\n }\n\n if (typeof process === 'undefined') {\n return;\n }\n\n const isServerless =\n !!process.env.FUNCTIONS_WORKER_RUNTIME || // Azure Functions\n !!process.env.LAMBDA_TASK_ROOT || // AWS Lambda\n !!process.env.K_SERVICE || // Google Cloud Run\n !!process.env.CF_PAGES || // Cloudflare Pages\n !!process.env.VERCEL ||\n !!process.env.NETLIFY;\n\n if (isServerless) {\n // Use regular flush for environments without a generic waitUntil mechanism\n await flushWithTimeout(timeout);\n }\n}\n"],"names":["debug","flush","GLOBAL_OBJ","vercelWaitUntil"],"mappings":";;;;;;;AAUA,eAAe,gBAAgB,CAAC,OAAO,EAAyB;AAChE,EAAE,IAAI;AACN,IAAIA,iBAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC;AACnC,IAAI,MAAMC,
|
|
1
|
+
{"version":3,"file":"flushIfServerless.js","sources":["../../../src/utils/flushIfServerless.ts"],"sourcesContent":["import { flush } from '../exports';\nimport { debug } from './debug-logger';\nimport { vercelWaitUntil } from './vercelWaitUntil';\nimport { GLOBAL_OBJ } from './worldwide';\n\ntype MinimalCloudflareContext = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n waitUntil(promise: Promise<any>): void;\n};\n\nasync function flushWithTimeout(timeout: number): Promise<void> {\n try {\n debug.log('Flushing events...');\n await flush(timeout);\n debug.log('Done flushing events');\n } catch (e) {\n debug.log('Error while flushing events:\\n', e);\n }\n}\n\n/**\n * Flushes the event queue with a timeout in serverless environments to ensure that events are sent to Sentry before the\n * serverless function execution ends.\n *\n * The function is async, but in environments that support a `waitUntil` mechanism, it will run synchronously.\n *\n * This function is aware of the following serverless platforms:\n * - Cloudflare: If a Cloudflare context is provided, it will use `ctx.waitUntil()` to flush events (keeps the `this` context of `ctx`).\n * If a `cloudflareWaitUntil` function is provided, it will use that to flush events (looses the `this` context of `ctx`).\n * - Vercel: It detects the Vercel environment and uses Vercel's `waitUntil` function.\n * - Other Serverless (AWS Lambda, Google Cloud, etc.): It detects the environment via environment variables\n * and uses a regular `await flush()`.\n *\n * @internal This function is supposed for internal Sentry SDK usage only.\n * @hidden\n */\nexport async function flushIfServerless(\n params: // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | { timeout?: number; cloudflareWaitUntil?: (task: Promise<any>) => void }\n | { timeout?: number; cloudflareCtx?: MinimalCloudflareContext } = {},\n): Promise<void> {\n const { timeout = 2000 } = params;\n\n if ('cloudflareWaitUntil' in params && typeof params?.cloudflareWaitUntil === 'function') {\n params.cloudflareWaitUntil(flushWithTimeout(timeout));\n return;\n }\n\n if ('cloudflareCtx' in params && typeof params.cloudflareCtx?.waitUntil === 'function') {\n params.cloudflareCtx.waitUntil(flushWithTimeout(timeout));\n return;\n }\n\n // Note: vercelWaitUntil only does something in Vercel Edge runtime\n // In Node runtime, we use process.on('SIGTERM') instead\n // @ts-expect-error This is not typed\n if (GLOBAL_OBJ[Symbol.for('@vercel/request-context')]) {\n // Vercel has a waitUntil equivalent that works without execution context\n vercelWaitUntil(flushWithTimeout(timeout));\n return;\n }\n\n if (typeof process === 'undefined') {\n return;\n }\n\n const isServerless =\n !!process.env.FUNCTIONS_WORKER_RUNTIME || // Azure Functions\n !!process.env.LAMBDA_TASK_ROOT || // AWS Lambda\n !!process.env.K_SERVICE || // Google Cloud Run\n !!process.env.CF_PAGES || // Cloudflare Pages\n !!process.env.VERCEL ||\n !!process.env.NETLIFY;\n\n if (isServerless) {\n // Use regular flush for environments without a generic waitUntil mechanism\n await flushWithTimeout(timeout);\n }\n}\n"],"names":["debug","flush","GLOBAL_OBJ","vercelWaitUntil"],"mappings":";;;;;;;AAUA,eAAe,gBAAgB,CAAC,OAAO,EAAyB;AAChE,EAAE,IAAI;AACN,IAAIA,iBAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC;AACnC,IAAI,MAAMC,cAAK,CAAC,OAAO,CAAC;AACxB,IAAID,iBAAK,CAAC,GAAG,CAAC,sBAAsB,CAAC;AACrC,EAAE,CAAA,CAAE,OAAO,CAAC,EAAE;AACd,IAAIA,iBAAK,CAAC,GAAG,CAAC,gCAAgC,EAAE,CAAC,CAAC;AAClD,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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ACnC,EAAE;AACF;;;;"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const index = require('../asyncContext/index.js');
|
|
4
4
|
const carrier = require('../carrier.js');
|
|
5
5
|
const currentScopes = require('../currentScopes.js');
|
|
6
|
-
const
|
|
6
|
+
const _exports = require('../exports.js');
|
|
7
7
|
const debugLogger = require('./debug-logger.js');
|
|
8
8
|
const spanUtils = require('./spanUtils.js');
|
|
9
9
|
const dynamicSamplingContext = require('../tracing/dynamicSamplingContext.js');
|
|
@@ -28,7 +28,7 @@ function getTraceData(
|
|
|
28
28
|
options = {},
|
|
29
29
|
) {
|
|
30
30
|
const client = options.client || currentScopes.getClient();
|
|
31
|
-
if (!
|
|
31
|
+
if (!_exports.isEnabled() || !client) {
|
|
32
32
|
return {};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceData.js","sources":["../../../src/utils/traceData.ts"],"sourcesContent":["import { getAsyncContextStrategy } from '../asyncContext';\nimport { getMainCarrier } from '../carrier';\nimport type { Client } from '../client';\nimport { getClient, getCurrentScope } from '../currentScopes';\nimport { isEnabled } from '../exports';\nimport type { Scope } from '../scope';\nimport { getDynamicSamplingContextFromScope, getDynamicSamplingContextFromSpan } from '../tracing';\nimport type { Span } from '../types-hoist/span';\nimport type { SerializedTraceData } from '../types-hoist/tracing';\nimport { dynamicSamplingContextToSentryBaggageHeader } from './baggage';\nimport { debug } from './debug-logger';\nimport { getActiveSpan, spanToTraceHeader, spanToTraceparentHeader } from './spanUtils';\nimport { generateSentryTraceHeader, generateTraceparentHeader, TRACEPARENT_REGEXP } from './tracing';\n\n/**\n * Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation\n * context) and serializes it to `sentry-trace` and `baggage` values. These values can be used to propagate\n * a trace via our tracing Http headers or Html `<meta>` tags.\n *\n * This function also applies some validation to the generated sentry-trace and baggage values to ensure that\n * only valid strings are returned.\n *\n * If (@param options.propagateTraceparent) is `true`, the function will also generate a `traceparent` value,\n * following the W3C traceparent header format.\n *\n * @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header\n * or meta tag name.\n */\nexport function getTraceData(\n options: { span?: Span; scope?: Scope; client?: Client; propagateTraceparent?: boolean } = {},\n): SerializedTraceData {\n const client = options.client || getClient();\n if (!isEnabled() || !client) {\n return {};\n }\n\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n if (acs.getTraceData) {\n return acs.getTraceData(options);\n }\n\n const scope = options.scope || getCurrentScope();\n const span = options.span || getActiveSpan();\n const sentryTrace = span ? spanToTraceHeader(span) : scopeToTraceHeader(scope);\n const dsc = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client, scope);\n const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc);\n\n const isValidSentryTraceHeader = TRACEPARENT_REGEXP.test(sentryTrace);\n if (!isValidSentryTraceHeader) {\n debug.warn('Invalid sentry-trace data. Cannot generate trace data');\n return {};\n }\n\n const traceData: SerializedTraceData = {\n 'sentry-trace': sentryTrace,\n baggage,\n };\n\n if (options.propagateTraceparent) {\n traceData.traceparent = span ? spanToTraceparentHeader(span) : scopeToTraceparentHeader(scope);\n }\n\n return traceData;\n}\n\n/**\n * Get a sentry-trace header value for the given scope.\n */\nfunction scopeToTraceHeader(scope: Scope): string {\n const { traceId, sampled, propagationSpanId } = scope.getPropagationContext();\n return generateSentryTraceHeader(traceId, propagationSpanId, sampled);\n}\n\nfunction scopeToTraceparentHeader(scope: Scope): string {\n const { traceId, sampled, propagationSpanId } = scope.getPropagationContext();\n return generateTraceparentHeader(traceId, propagationSpanId, sampled);\n}\n"],"names":["getClient","isEnabled","carrier","getMainCarrier","getAsyncContextStrategy","getCurrentScope","getActiveSpan","spanToTraceHeader","getDynamicSamplingContextFromSpan","getDynamicSamplingContextFromScope","baggage","dynamicSamplingContextToSentryBaggageHeader","TRACEPARENT_REGEXP","debug","spanToTraceparentHeader","generateSentryTraceHeader","generateTraceparentHeader"],"mappings":";;;;;;;;;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY;AAC5B,EAAE,OAAO,GAAoF,EAAE;AAC/F,EAAuB;AACvB,EAAE,MAAM,SAAS,OAAO,CAAC,MAAA,IAAUA,uBAAS,EAAE;AAC9C,EAAE,IAAI,CAACC,
|
|
1
|
+
{"version":3,"file":"traceData.js","sources":["../../../src/utils/traceData.ts"],"sourcesContent":["import { getAsyncContextStrategy } from '../asyncContext';\nimport { getMainCarrier } from '../carrier';\nimport type { Client } from '../client';\nimport { getClient, getCurrentScope } from '../currentScopes';\nimport { isEnabled } from '../exports';\nimport type { Scope } from '../scope';\nimport { getDynamicSamplingContextFromScope, getDynamicSamplingContextFromSpan } from '../tracing';\nimport type { Span } from '../types-hoist/span';\nimport type { SerializedTraceData } from '../types-hoist/tracing';\nimport { dynamicSamplingContextToSentryBaggageHeader } from './baggage';\nimport { debug } from './debug-logger';\nimport { getActiveSpan, spanToTraceHeader, spanToTraceparentHeader } from './spanUtils';\nimport { generateSentryTraceHeader, generateTraceparentHeader, TRACEPARENT_REGEXP } from './tracing';\n\n/**\n * Extracts trace propagation data from the current span or from the client's scope (via transaction or propagation\n * context) and serializes it to `sentry-trace` and `baggage` values. These values can be used to propagate\n * a trace via our tracing Http headers or Html `<meta>` tags.\n *\n * This function also applies some validation to the generated sentry-trace and baggage values to ensure that\n * only valid strings are returned.\n *\n * If (@param options.propagateTraceparent) is `true`, the function will also generate a `traceparent` value,\n * following the W3C traceparent header format.\n *\n * @returns an object with the tracing data values. The object keys are the name of the tracing key to be used as header\n * or meta tag name.\n */\nexport function getTraceData(\n options: { span?: Span; scope?: Scope; client?: Client; propagateTraceparent?: boolean } = {},\n): SerializedTraceData {\n const client = options.client || getClient();\n if (!isEnabled() || !client) {\n return {};\n }\n\n const carrier = getMainCarrier();\n const acs = getAsyncContextStrategy(carrier);\n if (acs.getTraceData) {\n return acs.getTraceData(options);\n }\n\n const scope = options.scope || getCurrentScope();\n const span = options.span || getActiveSpan();\n const sentryTrace = span ? spanToTraceHeader(span) : scopeToTraceHeader(scope);\n const dsc = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client, scope);\n const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc);\n\n const isValidSentryTraceHeader = TRACEPARENT_REGEXP.test(sentryTrace);\n if (!isValidSentryTraceHeader) {\n debug.warn('Invalid sentry-trace data. Cannot generate trace data');\n return {};\n }\n\n const traceData: SerializedTraceData = {\n 'sentry-trace': sentryTrace,\n baggage,\n };\n\n if (options.propagateTraceparent) {\n traceData.traceparent = span ? spanToTraceparentHeader(span) : scopeToTraceparentHeader(scope);\n }\n\n return traceData;\n}\n\n/**\n * Get a sentry-trace header value for the given scope.\n */\nfunction scopeToTraceHeader(scope: Scope): string {\n const { traceId, sampled, propagationSpanId } = scope.getPropagationContext();\n return generateSentryTraceHeader(traceId, propagationSpanId, sampled);\n}\n\nfunction scopeToTraceparentHeader(scope: Scope): string {\n const { traceId, sampled, propagationSpanId } = scope.getPropagationContext();\n return generateTraceparentHeader(traceId, propagationSpanId, sampled);\n}\n"],"names":["getClient","isEnabled","carrier","getMainCarrier","getAsyncContextStrategy","getCurrentScope","getActiveSpan","spanToTraceHeader","getDynamicSamplingContextFromSpan","getDynamicSamplingContextFromScope","baggage","dynamicSamplingContextToSentryBaggageHeader","TRACEPARENT_REGEXP","debug","spanToTraceparentHeader","generateSentryTraceHeader","generateTraceparentHeader"],"mappings":";;;;;;;;;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY;AAC5B,EAAE,OAAO,GAAoF,EAAE;AAC/F,EAAuB;AACvB,EAAE,MAAM,SAAS,OAAO,CAAC,MAAA,IAAUA,uBAAS,EAAE;AAC9C,EAAE,IAAI,CAAC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D,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAA,EAAkB,GAAI,KAAK,CAAC,qBAAqB,EAAE;AAC/E,EAAE,OAAOC,iCAAyB,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,CAAC;AACvE;;AAEA,SAAS,wBAAwB,CAAC,KAAK,EAAiB;AACxD,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAA,EAAkB,GAAI,KAAK,CAAC,qBAAqB,EAAE;AAC/E,EAAE,OAAOC,iCAAyB,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,CAAC;AACvE;;;;"}
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
// This is a magic string replaced by rollup
|
|
4
4
|
|
|
5
|
-
const SDK_VERSION = "10.
|
|
5
|
+
const SDK_VERSION = "10.38.0" ;
|
|
6
6
|
|
|
7
7
|
exports.SDK_VERSION = SDK_VERSION;
|
|
8
8
|
//# sourceMappingURL=version.js.map
|
package/build/esm/exports.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getCurrentScope, getClient, withIsolationScope
|
|
1
|
+
import { getIsolationScope, getCurrentScope, getClient, withIsolationScope } from './currentScopes.js';
|
|
2
2
|
import { DEBUG_BUILD } from './debug-build.js';
|
|
3
|
-
import { makeSession, updateSession
|
|
3
|
+
import { closeSession, makeSession, updateSession } from './session.js';
|
|
4
4
|
import { startNewTrace } from './tracing/trace.js';
|
|
5
5
|
import { debug } from './utils/debug-logger.js';
|
|
6
6
|
import { isThenable } from './utils/is.js';
|
package/build/esm/feedback.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineIntegration } from '../integration.js';
|
|
2
|
-
import {
|
|
2
|
+
import { stripMetadataFromStackFrames, addMetadataToStackFrames } from '../metadata.js';
|
|
3
3
|
import { forEachEnvelopeItem } from '../utils/envelope.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineIntegration } from '../integration.js';
|
|
2
|
-
import {
|
|
2
|
+
import { stripMetadataFromStackFrames, addMetadataToStackFrames } from '../metadata.js';
|
|
3
3
|
import { forEachEnvelopeItem } from '../utils/envelope.js';
|
|
4
4
|
import { getFramesFromEvent } from '../utils/stacktrace.js';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { serializeAttributes } from '../attributes.js';
|
|
2
2
|
import { getGlobalSingleton } from '../carrier.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getClient, getIsolationScope, getCurrentScope } from '../currentScopes.js';
|
|
4
4
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
5
5
|
import { debug, consoleSandbox } from '../utils/debug-logger.js';
|
|
6
6
|
import { isParameterizedString } from '../utils/is.js';
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.38.0","sideEffects":false}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
2
2
|
import { SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE } from '../semanticAttributes.js';
|
|
3
3
|
import { debug } from '../utils/debug-logger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getRootSpan, getActiveSpan } from '../utils/spanUtils.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Adds a measurement to the active transaction on the current global scope. You can optionally pass in a different span
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAsyncContextStrategy } from '../asyncContext/index.js';
|
|
2
2
|
import { getMainCarrier } from '../carrier.js';
|
|
3
|
-
import { withScope, getCurrentScope,
|
|
3
|
+
import { getClient, withScope, getCurrentScope, getIsolationScope } from '../currentScopes.js';
|
|
4
4
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
5
5
|
import { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes.js';
|
|
6
6
|
import { baggageHeaderToDynamicSamplingContext } from '../utils/baggage.js';
|
|
@@ -10,8 +10,8 @@ import { hasSpansEnabled } from '../utils/hasSpansEnabled.js';
|
|
|
10
10
|
import { parseSampleRate } from '../utils/parseSampleRate.js';
|
|
11
11
|
import { generateTraceId } from '../utils/propagationContext.js';
|
|
12
12
|
import { safeMathRandom } from '../utils/randomSafeContext.js';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { _getSpanForScope, _setSpanForScope } from '../utils/spanOnScope.js';
|
|
14
|
+
import { spanTimeInputToSeconds, getRootSpan, addChildSpanToSpan, spanIsSampled, spanToJSON } from '../utils/spanUtils.js';
|
|
15
15
|
import { shouldContinueTrace, propagationContextFromHeaders } from '../utils/tracing.js';
|
|
16
16
|
import { getDynamicSamplingContextFromSpan, freezeDscOnSpan } from './dynamicSamplingContext.js';
|
|
17
17
|
import { logSpanStart } from './logSpans.js';
|
|
@@ -52,7 +52,7 @@ function aggregateExceptionsFromError(
|
|
|
52
52
|
|
|
53
53
|
// Recursively call this function in order to walk down a chain of errors
|
|
54
54
|
if (isInstanceOf(error[key], Error)) {
|
|
55
|
-
applyExceptionGroupFieldsForParentException(exception, exceptionId);
|
|
55
|
+
applyExceptionGroupFieldsForParentException(exception, exceptionId, error);
|
|
56
56
|
const newException = exceptionFromErrorImplementation(parser, error[key] );
|
|
57
57
|
const newExceptionId = newExceptions.length;
|
|
58
58
|
applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);
|
|
@@ -70,10 +70,10 @@ function aggregateExceptionsFromError(
|
|
|
70
70
|
|
|
71
71
|
// This will create exception grouping for AggregateErrors
|
|
72
72
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError
|
|
73
|
-
if (
|
|
73
|
+
if (isExceptionGroup(error)) {
|
|
74
74
|
error.errors.forEach((childError, i) => {
|
|
75
75
|
if (isInstanceOf(childError, Error)) {
|
|
76
|
-
applyExceptionGroupFieldsForParentException(exception, exceptionId);
|
|
76
|
+
applyExceptionGroupFieldsForParentException(exception, exceptionId, error);
|
|
77
77
|
const newException = exceptionFromErrorImplementation(parser, childError );
|
|
78
78
|
const newExceptionId = newExceptions.length;
|
|
79
79
|
applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);
|
|
@@ -94,12 +94,20 @@ function aggregateExceptionsFromError(
|
|
|
94
94
|
return newExceptions;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
function
|
|
97
|
+
function isExceptionGroup(error) {
|
|
98
|
+
return Array.isArray(error.errors);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function applyExceptionGroupFieldsForParentException(
|
|
102
|
+
exception,
|
|
103
|
+
exceptionId,
|
|
104
|
+
error,
|
|
105
|
+
) {
|
|
98
106
|
exception.mechanism = {
|
|
99
107
|
handled: true,
|
|
100
108
|
type: 'auto.core.linked_errors',
|
|
109
|
+
...(isExceptionGroup(error) && { is_exception_group: true }),
|
|
101
110
|
...exception.mechanism,
|
|
102
|
-
...(exception.type === 'AggregateError' && { is_exception_group: true }),
|
|
103
111
|
exception_id: exceptionId,
|
|
104
112
|
};
|
|
105
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-errors.js","sources":["../../../src/utils/aggregate-errors.ts"],"sourcesContent":["import type { ExtendedError } from '../types-hoist/error';\nimport type { Event, EventHint } from '../types-hoist/event';\nimport type { Exception } from '../types-hoist/exception';\nimport type { StackParser } from '../types-hoist/stacktrace';\nimport { isInstanceOf } from './is';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nexport function applyAggregateErrorsToEvent(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n key: string,\n limit: number,\n event: Event,\n hint?: EventHint,\n): void {\n if (!event.exception?.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n const originalException: Exception | undefined =\n event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n // We only create exception grouping if there is an exception in the event.\n if (originalException) {\n event.exception.values = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n event.exception.values,\n originalException,\n 0,\n );\n }\n}\n\nfunction aggregateExceptionsFromError(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n prevExceptions: Exception[],\n exception: Exception,\n exceptionId: number,\n): Exception[] {\n if (prevExceptions.length >= limit + 1) {\n return prevExceptions;\n }\n\n let newExceptions = [...prevExceptions];\n\n // Recursively call this function in order to walk down a chain of errors\n if (isInstanceOf(error[key], Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, error[key] as Error);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error[key] as ExtendedError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n\n // This will create exception grouping for AggregateErrors\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n if (
|
|
1
|
+
{"version":3,"file":"aggregate-errors.js","sources":["../../../src/utils/aggregate-errors.ts"],"sourcesContent":["import type { ExtendedError } from '../types-hoist/error';\nimport type { Event, EventHint } from '../types-hoist/event';\nimport type { Exception } from '../types-hoist/exception';\nimport type { StackParser } from '../types-hoist/stacktrace';\nimport { isInstanceOf } from './is';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nexport function applyAggregateErrorsToEvent(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n key: string,\n limit: number,\n event: Event,\n hint?: EventHint,\n): void {\n if (!event.exception?.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n const originalException: Exception | undefined =\n event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n // We only create exception grouping if there is an exception in the event.\n if (originalException) {\n event.exception.values = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n hint.originalException as ExtendedError,\n key,\n event.exception.values,\n originalException,\n 0,\n );\n }\n}\n\nfunction aggregateExceptionsFromError(\n exceptionFromErrorImplementation: (stackParser: StackParser, ex: Error) => Exception,\n parser: StackParser,\n limit: number,\n error: ExtendedError,\n key: string,\n prevExceptions: Exception[],\n exception: Exception,\n exceptionId: number,\n): Exception[] {\n if (prevExceptions.length >= limit + 1) {\n return prevExceptions;\n }\n\n let newExceptions = [...prevExceptions];\n\n // Recursively call this function in order to walk down a chain of errors\n if (isInstanceOf(error[key], Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId, error);\n const newException = exceptionFromErrorImplementation(parser, error[key] as Error);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error[key] as ExtendedError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n\n // This will create exception grouping for AggregateErrors\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n if (isExceptionGroup(error)) {\n error.errors.forEach((childError, i) => {\n if (isInstanceOf(childError, Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId, error);\n const newException = exceptionFromErrorImplementation(parser, childError as Error);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n childError as ExtendedError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n });\n }\n\n return newExceptions;\n}\n\nfunction isExceptionGroup(error: ExtendedError): error is ExtendedError & { errors: unknown[] } {\n return Array.isArray(error.errors);\n}\n\nfunction applyExceptionGroupFieldsForParentException(\n exception: Exception,\n exceptionId: number,\n error: ExtendedError,\n): void {\n exception.mechanism = {\n handled: true,\n type: 'auto.core.linked_errors',\n ...(isExceptionGroup(error) && { is_exception_group: true }),\n ...exception.mechanism,\n exception_id: exceptionId,\n };\n}\n\nfunction applyExceptionGroupFieldsForChildException(\n exception: Exception,\n source: string,\n exceptionId: number,\n parentId: number | undefined,\n): void {\n exception.mechanism = {\n handled: true,\n ...exception.mechanism,\n type: 'chained',\n source,\n exception_id: exceptionId,\n parent_id: parentId,\n };\n}\n"],"names":[],"mappings":";;AAMA;AACA;AACA;AACO,SAAS,2BAA2B;AAC3C,EAAE,gCAAgC;AAClC,EAAE,MAAM;AACR,EAAE,GAAG;AACL,EAAE,KAAK;AACP,EAAE,KAAK;AACP,EAAE,IAAI;AACN,EAAQ;AACR,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAAE;AACzF,IAAI;AACJ,EAAE;;AAEF;AACA,EAAE,MAAM,iBAAiB;AACzB,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAA,GAAS,CAAA,GAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAA,GAAS,CAAC,CAAA,GAAI,SAAS;;AAE7G;AACA,EAA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AAW;AAC7B,GAAG;AACH;;AAEA,SAAS,0CAA0C;AACnD,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,WAAW;AACb,EAAE,QAAQ;AACV,EAAQ;AACR,EAAE,SAAS,CAAC,SAAA,GAAY;AACxB,IAAI,OAAO,EAAE,IAAI;AACjB,IAAI,GAAG,SAAS,CAAC,SAAS;AAC1B,IAAI,IAAI,EAAE,SAAS;AACnB,IAAI,MAAM;AACV,IAAI,YAAY,EAAE,WAAW;AAC7B,IAAI,SAAS,EAAE,QAAQ;AACvB,GAAG;AACH;;;;"}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* @returns void
|
|
9
9
|
*/
|
|
10
10
|
function replaceExports(
|
|
11
|
-
exports,
|
|
11
|
+
exports$1,
|
|
12
12
|
exportName,
|
|
13
13
|
wrappedConstructor,
|
|
14
14
|
) {
|
|
15
|
-
const original = exports[exportName];
|
|
15
|
+
const original = exports$1[exportName];
|
|
16
16
|
|
|
17
17
|
if (typeof original !== 'function') {
|
|
18
18
|
return;
|
|
@@ -20,10 +20,10 @@ function replaceExports(
|
|
|
20
20
|
|
|
21
21
|
// Replace the named export - handle read-only properties
|
|
22
22
|
try {
|
|
23
|
-
exports[exportName] = wrappedConstructor;
|
|
23
|
+
exports$1[exportName] = wrappedConstructor;
|
|
24
24
|
} catch (error) {
|
|
25
25
|
// If direct assignment fails, override the property descriptor
|
|
26
|
-
Object.defineProperty(exports, exportName, {
|
|
26
|
+
Object.defineProperty(exports$1, exportName, {
|
|
27
27
|
value: wrappedConstructor,
|
|
28
28
|
writable: true,
|
|
29
29
|
configurable: true,
|
|
@@ -32,11 +32,11 @@ function replaceExports(
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// Replace the default export if it points to the original constructor
|
|
35
|
-
if (exports.default === original) {
|
|
35
|
+
if (exports$1.default === original) {
|
|
36
36
|
try {
|
|
37
|
-
exports.default = wrappedConstructor;
|
|
37
|
+
exports$1.default = wrappedConstructor;
|
|
38
38
|
} catch (error) {
|
|
39
|
-
Object.defineProperty(exports, 'default', {
|
|
39
|
+
Object.defineProperty(exports$1, 'default', {
|
|
40
40
|
value: wrappedConstructor,
|
|
41
41
|
writable: true,
|
|
42
42
|
configurable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sources":["../../../src/utils/exports.ts"],"sourcesContent":["/**\n * Replaces constructor functions in module exports, handling read-only properties,\n * and both default and named exports by wrapping them with the constructor.\n *\n * @param exports The module exports object to modify\n * @param exportName The name of the export to replace (e.g., 'GoogleGenAI', 'Anthropic', 'OpenAI')\n * @param wrappedConstructor The wrapped constructor function to replace the original with\n * @returns void\n */\nexport function replaceExports(\n exports: { [key: string]: unknown },\n exportName: string,\n wrappedConstructor: unknown,\n): void {\n const original = exports[exportName];\n\n if (typeof original !== 'function') {\n return;\n }\n\n // Replace the named export - handle read-only properties\n try {\n exports[exportName] = wrappedConstructor;\n } catch (error) {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, exportName, {\n value: wrappedConstructor,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n\n // Replace the default export if it points to the original constructor\n if (exports.default === original) {\n try {\n exports.default = wrappedConstructor;\n } catch (error) {\n Object.defineProperty(exports, 'default', {\n value: wrappedConstructor,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n }\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc;AAC9B,
|
|
1
|
+
{"version":3,"file":"exports.js","sources":["../../../src/utils/exports.ts"],"sourcesContent":["/**\n * Replaces constructor functions in module exports, handling read-only properties,\n * and both default and named exports by wrapping them with the constructor.\n *\n * @param exports The module exports object to modify\n * @param exportName The name of the export to replace (e.g., 'GoogleGenAI', 'Anthropic', 'OpenAI')\n * @param wrappedConstructor The wrapped constructor function to replace the original with\n * @returns void\n */\nexport function replaceExports(\n exports: { [key: string]: unknown },\n exportName: string,\n wrappedConstructor: unknown,\n): void {\n const original = exports[exportName];\n\n if (typeof original !== 'function') {\n return;\n }\n\n // Replace the named export - handle read-only properties\n try {\n exports[exportName] = wrappedConstructor;\n } catch (error) {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, exportName, {\n value: wrappedConstructor,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n\n // Replace the default export if it points to the original constructor\n if (exports.default === original) {\n try {\n exports.default = wrappedConstructor;\n } catch (error) {\n Object.defineProperty(exports, 'default', {\n value: wrappedConstructor,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n }\n}\n"],"names":["exports"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc;AAC9B,EAAEA,SAAO;AACT,EAAE,UAAU;AACZ,EAAE,kBAAkB;AACpB,EAAQ;AACR,EAAE,MAAM,QAAA,GAAWA,SAAO,CAAC,UAAU,CAAC;;AAEtC,EAAE,IAAI,OAAO,QAAA,KAAa,UAAU,EAAE;AACtC,IAAI;AACJ,EAAE;;AAEF;AACA,EAAE,IAAI;AACN,IAAIA,SAAO,CAAC,UAAU,CAAA,GAAI,kBAAkB;AAC5C,EAAE,CAAA,CAAE,OAAO,KAAK,EAAE;AAClB;AACA,IAAI,MAAM,CAAC,cAAc,CAACA,SAAO,EAAE,UAAU,EAAE;AAC/C,MAAM,KAAK,EAAE,kBAAkB;AAC/B,MAAM,QAAQ,EAAE,IAAI;AACpB,MAAM,YAAY,EAAE,IAAI;AACxB,MAAM,UAAU,EAAE,IAAI;AACtB,KAAK,CAAC;AACN,EAAE;;AAEF;AACA,EAAE,IAAIA,SAAO,CAAC,OAAA,KAAY,QAAQ,EAAE;AACpC,IAAI,IAAI;AACR,MAAMA,SAAO,CAAC,OAAA,GAAU,kBAAkB;AAC1C,IAAI,CAAA,CAAE,OAAO,KAAK,EAAE;AACpB,MAAM,MAAM,CAAC,cAAc,CAACA,SAAO,EAAE,SAAS,EAAE;AAChD,QAAQ,KAAK,EAAE,kBAAkB;AACjC,QAAQ,QAAQ,EAAE,IAAI;AACtB,QAAQ,YAAY,EAAE,IAAI;AAC1B,QAAQ,UAAU,EAAE,IAAI;AACxB,OAAO,CAAC;AACR,IAAI;AACJ,EAAE;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/core",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.38.0",
|
|
4
4
|
"description": "Base implementation for all Sentry JavaScript SDKs",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
|