@sentry/core 10.53.1 → 10.54.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/api.js +10 -34
- package/build/cjs/api.js.map +1 -1
- package/build/cjs/asyncContext/index.js +0 -14
- package/build/cjs/asyncContext/index.js.map +1 -1
- package/build/cjs/asyncContext/stackStrategy.js +16 -47
- package/build/cjs/asyncContext/stackStrategy.js.map +1 -1
- package/build/cjs/attributes.js +17 -95
- package/build/cjs/attributes.js.map +1 -1
- package/build/cjs/breadcrumbs.js +2 -22
- package/build/cjs/breadcrumbs.js.map +1 -1
- package/build/cjs/browser.js +12 -3
- package/build/cjs/browser.js.map +1 -1
- package/build/cjs/carrier.js +5 -42
- package/build/cjs/carrier.js.map +1 -1
- package/build/cjs/checkin.js +5 -19
- package/build/cjs/checkin.js.map +1 -1
- package/build/cjs/client.js +216 -585
- package/build/cjs/client.js.map +1 -1
- package/build/cjs/constants.js +2 -2
- package/build/cjs/currentScopes.js +5 -86
- package/build/cjs/currentScopes.js.map +1 -1
- package/build/cjs/debug-build.js +0 -5
- package/build/cjs/debug-build.js.map +1 -1
- package/build/cjs/defaultScopes.js +2 -5
- package/build/cjs/defaultScopes.js.map +1 -1
- package/build/cjs/envelope.js +32 -103
- package/build/cjs/envelope.js.map +1 -1
- package/build/cjs/eventProcessors.js +4 -23
- package/build/cjs/eventProcessors.js.map +1 -1
- package/build/cjs/exports.js +21 -197
- package/build/cjs/exports.js.map +1 -1
- package/build/cjs/feedback.js +7 -19
- package/build/cjs/feedback.js.map +1 -1
- package/build/cjs/fetch.js +66 -201
- package/build/cjs/fetch.js.map +1 -1
- package/build/cjs/index.js +17 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/instrument/console.js +9 -41
- package/build/cjs/instrument/console.js.map +1 -1
- package/build/cjs/instrument/fetch.js +47 -156
- package/build/cjs/instrument/fetch.js.map +1 -1
- package/build/cjs/instrument/globalError.js +4 -25
- package/build/cjs/instrument/globalError.js.map +1 -1
- package/build/cjs/instrument/globalUnhandledRejection.js +4 -21
- package/build/cjs/instrument/globalUnhandledRejection.js.map +1 -1
- package/build/cjs/instrument/handlers.js +9 -21
- package/build/cjs/instrument/handlers.js.map +1 -1
- package/build/cjs/integration.js +13 -77
- package/build/cjs/integration.js.map +1 -1
- package/build/cjs/integrations/captureconsole.js +16 -40
- package/build/cjs/integrations/captureconsole.js.map +1 -1
- package/build/cjs/integrations/consola.js +57 -163
- package/build/cjs/integrations/consola.js.map +1 -1
- package/build/cjs/integrations/console.js +11 -43
- package/build/cjs/integrations/console.js.map +1 -1
- package/build/cjs/integrations/conversationId.js +5 -22
- package/build/cjs/integrations/conversationId.js.map +1 -1
- package/build/cjs/integrations/dedupe.js +16 -74
- package/build/cjs/integrations/dedupe.js.map +1 -1
- package/build/cjs/integrations/eventFilters.js +63 -114
- package/build/cjs/integrations/eventFilters.js.map +1 -1
- package/build/cjs/integrations/express/index.js +30 -145
- package/build/cjs/integrations/express/index.js.map +1 -1
- package/build/cjs/integrations/express/patch-layer.js +20 -130
- package/build/cjs/integrations/express/patch-layer.js.map +1 -1
- package/build/cjs/integrations/express/request-layer-store.js +1 -3
- package/build/cjs/integrations/express/request-layer-store.js.map +1 -1
- package/build/cjs/integrations/express/set-sdk-processing-metadata.js +0 -2
- package/build/cjs/integrations/express/set-sdk-processing-metadata.js.map +1 -1
- package/build/cjs/integrations/express/types.js +6 -7
- package/build/cjs/integrations/express/types.js.map +1 -1
- package/build/cjs/integrations/express/utils.js +37 -145
- package/build/cjs/integrations/express/utils.js.map +1 -1
- package/build/cjs/integrations/extraerrordata.js +24 -69
- package/build/cjs/integrations/extraerrordata.js.map +1 -1
- package/build/cjs/integrations/featureFlags/featureFlagsIntegration.js +3 -29
- package/build/cjs/integrations/featureFlags/featureFlagsIntegration.js.map +1 -1
- package/build/cjs/integrations/featureFlags/growthbook.js +11 -40
- package/build/cjs/integrations/featureFlags/growthbook.js.map +1 -1
- package/build/cjs/integrations/functiontostring.js +6 -27
- package/build/cjs/integrations/functiontostring.js.map +1 -1
- package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js +10 -18
- package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -1
- package/build/cjs/integrations/http/client-patch.js +8 -70
- package/build/cjs/integrations/http/client-patch.js.map +1 -1
- package/build/cjs/integrations/http/client-subscriptions.js +22 -59
- package/build/cjs/integrations/http/client-subscriptions.js.map +1 -1
- package/build/cjs/integrations/http/constants.js +3 -3
- package/build/cjs/integrations/http/double-wrap-warning.js +10 -18
- package/build/cjs/integrations/http/double-wrap-warning.js.map +1 -1
- package/build/cjs/integrations/http/get-outgoing-span-data.js +30 -47
- package/build/cjs/integrations/http/get-outgoing-span-data.js.map +1 -1
- package/build/cjs/integrations/http/get-request-url.js +7 -24
- package/build/cjs/integrations/http/get-request-url.js.map +1 -1
- package/build/cjs/integrations/http/inject-trace-propagation-headers.js +14 -38
- package/build/cjs/integrations/http/inject-trace-propagation-headers.js.map +1 -1
- package/build/cjs/integrations/http/patch-request-to-capture-body.js +80 -0
- package/build/cjs/integrations/http/patch-request-to-capture-body.js.map +1 -0
- package/build/cjs/integrations/http/record-request-session.js +61 -0
- package/build/cjs/integrations/http/record-request-session.js.map +1 -0
- package/build/cjs/integrations/http/server-subscription.js +289 -0
- package/build/cjs/integrations/http/server-subscription.js.map +1 -0
- package/build/cjs/integrations/linkederrors.js +6 -11
- package/build/cjs/integrations/linkederrors.js.map +1 -1
- package/build/cjs/integrations/mcp-server/attributeExtraction.js +26 -69
- package/build/cjs/integrations/mcp-server/attributeExtraction.js.map +1 -1
- package/build/cjs/integrations/mcp-server/attributes.js +30 -138
- package/build/cjs/integrations/mcp-server/attributes.js.map +1 -1
- package/build/cjs/integrations/mcp-server/correlation.js +20 -91
- package/build/cjs/integrations/mcp-server/correlation.js.map +1 -1
- package/build/cjs/integrations/mcp-server/errorCapture.js +6 -25
- package/build/cjs/integrations/mcp-server/errorCapture.js.map +1 -1
- package/build/cjs/integrations/mcp-server/handlers.js +55 -169
- package/build/cjs/integrations/mcp-server/handlers.js.map +1 -1
- package/build/cjs/integrations/mcp-server/index.js +7 -60
- package/build/cjs/integrations/mcp-server/index.js.map +1 -1
- package/build/cjs/integrations/mcp-server/methodConfig.js +21 -59
- package/build/cjs/integrations/mcp-server/methodConfig.js.map +1 -1
- package/build/cjs/integrations/mcp-server/piiFiltering.js +5 -33
- package/build/cjs/integrations/mcp-server/piiFiltering.js.map +1 -1
- package/build/cjs/integrations/mcp-server/resultExtraction.js +20 -76
- package/build/cjs/integrations/mcp-server/resultExtraction.js.map +1 -1
- package/build/cjs/integrations/mcp-server/sessionExtraction.js +30 -121
- package/build/cjs/integrations/mcp-server/sessionExtraction.js.map +1 -1
- package/build/cjs/integrations/mcp-server/sessionManagement.js +2 -60
- package/build/cjs/integrations/mcp-server/sessionManagement.js.map +1 -1
- package/build/cjs/integrations/mcp-server/spans.js +20 -107
- package/build/cjs/integrations/mcp-server/spans.js.map +1 -1
- package/build/cjs/integrations/mcp-server/transport.js +26 -94
- package/build/cjs/integrations/mcp-server/transport.js.map +1 -1
- package/build/cjs/integrations/mcp-server/validation.js +6 -72
- package/build/cjs/integrations/mcp-server/validation.js.map +1 -1
- package/build/cjs/integrations/moduleMetadata.js +6 -20
- package/build/cjs/integrations/moduleMetadata.js.map +1 -1
- package/build/cjs/integrations/postgresjs.js +78 -287
- package/build/cjs/integrations/postgresjs.js.map +1 -1
- package/build/cjs/integrations/requestdata.js +30 -93
- package/build/cjs/integrations/requestdata.js.map +1 -1
- package/build/cjs/integrations/rewriteframes.js +14 -45
- package/build/cjs/integrations/rewriteframes.js.map +1 -1
- package/build/cjs/integrations/spanStreaming.js +9 -15
- package/build/cjs/integrations/spanStreaming.js.map +1 -1
- package/build/cjs/integrations/supabase.js +224 -333
- package/build/cjs/integrations/supabase.js.map +1 -1
- package/build/cjs/integrations/third-party-errors-filter.js +60 -85
- package/build/cjs/integrations/third-party-errors-filter.js.map +1 -1
- package/build/cjs/integrations/zoderrors.js +35 -111
- package/build/cjs/integrations/zoderrors.js.map +1 -1
- package/build/cjs/logs/console-integration.js +15 -50
- package/build/cjs/logs/console-integration.js.map +1 -1
- package/build/cjs/logs/constants.js +1 -6
- package/build/cjs/logs/constants.js.map +1 -1
- package/build/cjs/logs/envelope.js +10 -40
- package/build/cjs/logs/envelope.js.map +1 -1
- package/build/cjs/logs/internal.js +53 -125
- package/build/cjs/logs/internal.js.map +1 -1
- package/build/cjs/logs/public-api.js +13 -228
- package/build/cjs/logs/public-api.js.map +1 -1
- package/build/cjs/logs/utils.js +6 -47
- package/build/cjs/logs/utils.js.map +1 -1
- package/build/cjs/metadata.js +6 -51
- package/build/cjs/metadata.js.map +1 -1
- package/build/cjs/metrics/envelope.js +12 -45
- package/build/cjs/metrics/envelope.js.map +1 -1
- package/build/cjs/metrics/internal.js +31 -144
- package/build/cjs/metrics/internal.js.map +1 -1
- package/build/cjs/metrics/public-api.js +4 -109
- package/build/cjs/metrics/public-api.js.map +1 -1
- package/build/cjs/profiling.js +11 -41
- package/build/cjs/profiling.js.map +1 -1
- package/build/cjs/scope.js +73 -224
- package/build/cjs/scope.js.map +1 -1
- package/build/cjs/sdk.js +2 -21
- package/build/cjs/sdk.js.map +1 -1
- package/build/cjs/semanticAttributes.js +30 -116
- package/build/cjs/semanticAttributes.js.map +1 -1
- package/build/cjs/server-runtime-client.js +32 -87
- package/build/cjs/server-runtime-client.js.map +1 -1
- package/build/cjs/server.js +17 -3
- package/build/cjs/server.js.map +1 -1
- package/build/cjs/session.js +14 -67
- package/build/cjs/session.js.map +1 -1
- package/build/cjs/tracing/ai/gen-ai-attributes.js +45 -249
- package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/cjs/tracing/ai/mediaStripping.js +21 -116
- package/build/cjs/tracing/ai/mediaStripping.js.map +1 -1
- package/build/cjs/tracing/ai/messageTruncation.js +26 -212
- package/build/cjs/tracing/ai/messageTruncation.js.map +1 -1
- package/build/cjs/tracing/ai/utils.js +40 -180
- package/build/cjs/tracing/ai/utils.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/constants.js +9 -12
- package/build/cjs/tracing/anthropic-ai/constants.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/index.js +67 -172
- package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/streaming.js +45 -149
- package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/utils.js +17 -47
- package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
- package/build/cjs/tracing/dynamicSamplingContext.js +18 -85
- package/build/cjs/tracing/dynamicSamplingContext.js.map +1 -1
- package/build/cjs/tracing/errors.js +2 -14
- package/build/cjs/tracing/errors.js.map +1 -1
- package/build/cjs/tracing/google-genai/constants.js +9 -16
- package/build/cjs/tracing/google-genai/constants.js.map +1 -1
- package/build/cjs/tracing/google-genai/index.js +79 -223
- package/build/cjs/tracing/google-genai/index.js.map +1 -1
- package/build/cjs/tracing/google-genai/streaming.js +11 -56
- package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
- package/build/cjs/tracing/google-genai/utils.js +8 -13
- package/build/cjs/tracing/google-genai/utils.js.map +1 -1
- package/build/cjs/tracing/idleSpan.js +48 -174
- package/build/cjs/tracing/idleSpan.js.map +1 -1
- package/build/cjs/tracing/langchain/constants.js +8 -9
- package/build/cjs/tracing/langchain/constants.js.map +1 -1
- package/build/cjs/tracing/langchain/embeddings.js +31 -75
- package/build/cjs/tracing/langchain/embeddings.js.map +1 -1
- package/build/cjs/tracing/langchain/index.js +64 -161
- package/build/cjs/tracing/langchain/index.js.map +1 -1
- package/build/cjs/tracing/langchain/utils.js +101 -311
- package/build/cjs/tracing/langchain/utils.js.map +1 -1
- package/build/cjs/tracing/langgraph/constants.js +2 -2
- package/build/cjs/tracing/langgraph/index.js +57 -160
- package/build/cjs/tracing/langgraph/index.js.map +1 -1
- package/build/cjs/tracing/langgraph/utils.js +53 -170
- package/build/cjs/tracing/langgraph/utils.js.map +1 -1
- package/build/cjs/tracing/logSpans.js +10 -26
- package/build/cjs/tracing/logSpans.js.map +1 -1
- package/build/cjs/tracing/measurement.js +6 -18
- package/build/cjs/tracing/measurement.js.map +1 -1
- package/build/cjs/tracing/openai/constants.js +20 -24
- package/build/cjs/tracing/openai/constants.js.map +1 -1
- package/build/cjs/tracing/openai/index.js +52 -132
- package/build/cjs/tracing/openai/index.js.map +1 -1
- package/build/cjs/tracing/openai/streaming.js +24 -102
- package/build/cjs/tracing/openai/streaming.js.map +1 -1
- package/build/cjs/tracing/openai/utils.js +36 -107
- package/build/cjs/tracing/openai/utils.js.map +1 -1
- package/build/cjs/tracing/sampling.js +23 -63
- package/build/cjs/tracing/sampling.js.map +1 -1
- package/build/cjs/tracing/sentryNonRecordingSpan.js +15 -40
- package/build/cjs/tracing/sentryNonRecordingSpan.js.map +1 -1
- package/build/cjs/tracing/sentrySpan.js +66 -172
- package/build/cjs/tracing/sentrySpan.js.map +1 -1
- package/build/cjs/tracing/spans/beforeSendSpan.js +4 -32
- package/build/cjs/tracing/spans/beforeSendSpan.js.map +1 -1
- package/build/cjs/tracing/spans/captureSpan.js +58 -156
- package/build/cjs/tracing/spans/captureSpan.js.map +1 -1
- package/build/cjs/tracing/spans/envelope.js +12 -24
- package/build/cjs/tracing/spans/envelope.js.map +1 -1
- package/build/cjs/tracing/spans/estimateSize.js +0 -22
- package/build/cjs/tracing/spans/estimateSize.js.map +1 -1
- package/build/cjs/tracing/spans/extractGenAiSpans.js +11 -33
- package/build/cjs/tracing/spans/extractGenAiSpans.js.map +1 -1
- package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js +1 -4
- package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js.map +1 -1
- package/build/cjs/tracing/spans/scopeContextAttributes.js +58 -0
- package/build/cjs/tracing/spans/scopeContextAttributes.js.map +1 -0
- package/build/cjs/tracing/spans/spanBuffer.js +21 -71
- package/build/cjs/tracing/spans/spanBuffer.js.map +1 -1
- package/build/cjs/tracing/spans/spanJsonToStreamedSpan.js +4 -8
- package/build/cjs/tracing/spans/spanJsonToStreamedSpan.js.map +1 -1
- package/build/cjs/tracing/spanstatus.js +15 -32
- package/build/cjs/tracing/spanstatus.js.map +1 -1
- package/build/cjs/tracing/trace.js +95 -311
- package/build/cjs/tracing/trace.js.map +1 -1
- package/build/cjs/tracing/utils.js +4 -14
- package/build/cjs/tracing/utils.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/constants.js +15 -26
- package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/index.js +84 -288
- package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/utils.js +30 -128
- package/build/cjs/tracing/vercel-ai/utils.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js +22 -229
- package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
- package/build/cjs/transports/base.js +32 -67
- package/build/cjs/transports/base.js.map +1 -1
- package/build/cjs/transports/multiplexed.js +38 -103
- package/build/cjs/transports/multiplexed.js.map +1 -1
- package/build/cjs/transports/offline.js +31 -72
- package/build/cjs/transports/offline.js.map +1 -1
- package/build/cjs/transports/userAgent.js +4 -13
- package/build/cjs/transports/userAgent.js.map +1 -1
- package/build/cjs/trpc.js +19 -39
- package/build/cjs/trpc.js.map +1 -1
- package/build/cjs/utils/aggregate-errors.js +18 -62
- package/build/cjs/utils/aggregate-errors.js.map +1 -1
- package/build/cjs/utils/ai/providerSkip.js +3 -50
- package/build/cjs/utils/ai/providerSkip.js.map +1 -1
- package/build/cjs/utils/anr.js +7 -36
- package/build/cjs/utils/anr.js.map +1 -1
- package/build/cjs/utils/baggage.js +37 -146
- package/build/cjs/utils/baggage.js.map +1 -1
- package/build/cjs/utils/breadcrumb-log-level.js +5 -9
- package/build/cjs/utils/breadcrumb-log-level.js.map +1 -1
- package/build/cjs/utils/browser.js +24 -86
- package/build/cjs/utils/browser.js.map +1 -1
- package/build/cjs/utils/chain-and-copy-promiselike.js +10 -27
- package/build/cjs/utils/chain-and-copy-promiselike.js.map +1 -1
- package/build/cjs/utils/clientreport.js +4 -13
- package/build/cjs/utils/clientreport.js.map +1 -1
- package/build/cjs/utils/cookie.js +6 -53
- package/build/cjs/utils/cookie.js.map +1 -1
- package/build/cjs/utils/data-collection/defaultPiiToCollectionOptions.js +28 -0
- package/build/cjs/utils/data-collection/defaultPiiToCollectionOptions.js.map +1 -0
- package/build/cjs/utils/data-collection/filterCookies.js +23 -0
- package/build/cjs/utils/data-collection/filterCookies.js.map +1 -0
- package/build/cjs/utils/data-collection/filterKeyValueData.js +43 -0
- package/build/cjs/utils/data-collection/filterKeyValueData.js.map +1 -0
- package/build/cjs/utils/data-collection/filterQueryParams.js +26 -0
- package/build/cjs/utils/data-collection/filterQueryParams.js.map +1 -0
- package/build/cjs/utils/data-collection/filtering-snippets.js +61 -0
- package/build/cjs/utils/data-collection/filtering-snippets.js.map +1 -0
- package/build/cjs/utils/data-collection/resolveDataCollectionOptions.js +37 -0
- package/build/cjs/utils/data-collection/resolveDataCollectionOptions.js.map +1 -0
- package/build/cjs/utils/debounce.js +5 -32
- package/build/cjs/utils/debounce.js.map +1 -1
- package/build/cjs/utils/debug-ids.js +4 -42
- package/build/cjs/utils/debug-ids.js.map +1 -1
- package/build/cjs/utils/debug-logger.js +23 -56
- package/build/cjs/utils/debug-logger.js.map +1 -1
- package/build/cjs/utils/dsn.js +18 -81
- package/build/cjs/utils/dsn.js.map +1 -1
- package/build/cjs/utils/env.js +3 -27
- package/build/cjs/utils/env.js.map +1 -1
- package/build/cjs/utils/envToBool.js +2 -15
- package/build/cjs/utils/envToBool.js.map +1 -1
- package/build/cjs/utils/envelope.js +39 -133
- package/build/cjs/utils/envelope.js.map +1 -1
- package/build/cjs/utils/error.js +3 -10
- package/build/cjs/utils/error.js.map +1 -1
- package/build/cjs/utils/eventUtils.js +0 -8
- package/build/cjs/utils/eventUtils.js.map +1 -1
- package/build/cjs/utils/eventbuilder.js +30 -114
- package/build/cjs/utils/eventbuilder.js.map +1 -1
- package/build/cjs/utils/exports.js +5 -24
- package/build/cjs/utils/exports.js.map +1 -1
- package/build/cjs/utils/featureFlags.js +10 -96
- package/build/cjs/utils/featureFlags.js.map +1 -1
- package/build/cjs/utils/flushIfServerless.js +14 -48
- package/build/cjs/utils/flushIfServerless.js.map +1 -1
- package/build/cjs/utils/get-default-export.js +1 -25
- package/build/cjs/utils/get-default-export.js.map +1 -1
- package/build/cjs/utils/handleCallbackErrors.js +10 -48
- package/build/cjs/utils/handleCallbackErrors.js.map +1 -1
- package/build/cjs/utils/hasSpansEnabled.js +4 -28
- package/build/cjs/utils/hasSpansEnabled.js.map +1 -1
- package/build/cjs/utils/ipAddress.js +7 -19
- package/build/cjs/utils/ipAddress.js.map +1 -1
- package/build/cjs/utils/is.js +18 -163
- package/build/cjs/utils/is.js.map +1 -1
- package/build/cjs/utils/isBrowser.js +3 -9
- package/build/cjs/utils/isBrowser.js.map +1 -1
- package/build/cjs/utils/isSentryRequestUrl.js +2 -19
- package/build/cjs/utils/isSentryRequestUrl.js.map +1 -1
- package/build/cjs/utils/lru.js +13 -24
- package/build/cjs/utils/lru.js.map +1 -1
- package/build/cjs/utils/merge.js +1 -17
- package/build/cjs/utils/merge.js.map +1 -1
- package/build/cjs/utils/meta.js +1 -24
- package/build/cjs/utils/meta.js.map +1 -1
- package/build/cjs/utils/misc.js +31 -134
- package/build/cjs/utils/misc.js.map +1 -1
- package/build/cjs/utils/node-stack-trace.js +22 -61
- package/build/cjs/utils/node-stack-trace.js.map +1 -1
- package/build/cjs/utils/node.js +3 -48
- package/build/cjs/utils/node.js.map +1 -1
- package/build/cjs/utils/normalizationHints.js +5 -18
- package/build/cjs/utils/normalizationHints.js.map +1 -1
- package/build/cjs/utils/normalize.js +39 -205
- package/build/cjs/utils/normalize.js.map +1 -1
- package/build/cjs/utils/object.js +33 -168
- package/build/cjs/utils/object.js.map +1 -1
- package/build/cjs/utils/parameterize.js +2 -21
- package/build/cjs/utils/parameterize.js.map +1 -1
- package/build/cjs/utils/parseSampleRate.js +4 -13
- package/build/cjs/utils/parseSampleRate.js.map +1 -1
- package/build/cjs/utils/path.js +28 -115
- package/build/cjs/utils/path.js.map +1 -1
- package/build/cjs/utils/prepareEvent.js +53 -191
- package/build/cjs/utils/prepareEvent.js.map +1 -1
- package/build/cjs/utils/promisebuffer.js +5 -47
- package/build/cjs/utils/promisebuffer.js.map +1 -1
- package/build/cjs/utils/propagationContext.js +0 -7
- package/build/cjs/utils/propagationContext.js.map +1 -1
- package/build/cjs/utils/randomSafeContext.js +3 -22
- package/build/cjs/utils/randomSafeContext.js.map +1 -1
- package/build/cjs/utils/ratelimit.js +13 -66
- package/build/cjs/utils/ratelimit.js.map +1 -1
- package/build/cjs/utils/request.js +62 -269
- package/build/cjs/utils/request.js.map +1 -1
- package/build/cjs/utils/scopeData.js +15 -79
- package/build/cjs/utils/scopeData.js.map +1 -1
- package/build/cjs/utils/sdkMetadata.js +5 -19
- package/build/cjs/utils/sdkMetadata.js.map +1 -1
- package/build/cjs/utils/severity.js +1 -9
- package/build/cjs/utils/severity.js.map +1 -1
- package/build/cjs/utils/should-ignore-span.js +6 -38
- package/build/cjs/utils/should-ignore-span.js.map +1 -1
- package/build/cjs/utils/spanOnScope.js +3 -14
- package/build/cjs/utils/spanOnScope.js.map +1 -1
- package/build/cjs/utils/spanUtils.js +42 -222
- package/build/cjs/utils/spanUtils.js.map +1 -1
- package/build/cjs/utils/stacktrace.js +19 -106
- package/build/cjs/utils/stacktrace.js.map +1 -1
- package/build/cjs/utils/string.js +7 -75
- package/build/cjs/utils/string.js.map +1 -1
- package/build/cjs/utils/supports.js +14 -99
- package/build/cjs/utils/supports.js.map +1 -1
- package/build/cjs/utils/syncpromise.js +19 -68
- package/build/cjs/utils/syncpromise.js.map +1 -1
- package/build/cjs/utils/time.js +7 -84
- package/build/cjs/utils/time.js.map +1 -1
- package/build/cjs/utils/timer.js +1 -10
- package/build/cjs/utils/timer.js.map +1 -1
- package/build/cjs/utils/timestampSequence.js +5 -21
- package/build/cjs/utils/timestampSequence.js.map +1 -1
- package/build/cjs/utils/trace-info.js +3 -10
- package/build/cjs/utils/trace-info.js.map +1 -1
- package/build/cjs/utils/traceData.js +4 -39
- package/build/cjs/utils/traceData.js.map +1 -1
- package/build/cjs/utils/tracePropagationTargets.js +4 -18
- package/build/cjs/utils/tracePropagationTargets.js.map +1 -1
- package/build/cjs/utils/tracing.js +32 -106
- package/build/cjs/utils/tracing.js.map +1 -1
- package/build/cjs/utils/transactionEvent.js +11 -19
- package/build/cjs/utils/transactionEvent.js.map +1 -1
- package/build/cjs/utils/tunnel.js +12 -33
- package/build/cjs/utils/tunnel.js.map +1 -1
- package/build/cjs/utils/url.js +42 -176
- package/build/cjs/utils/url.js.map +1 -1
- package/build/cjs/utils/vercelWaitUntil.js +4 -12
- package/build/cjs/utils/vercelWaitUntil.js.map +1 -1
- package/build/cjs/utils/version.js +1 -3
- package/build/cjs/utils/version.js.map +1 -1
- package/build/cjs/utils/weakRef.js +5 -36
- package/build/cjs/utils/weakRef.js.map +1 -1
- package/build/cjs/utils/worldwide.js +1 -4
- package/build/cjs/utils/worldwide.js.map +1 -1
- package/build/cjs/vendor/escapeStringForRegex.js +1 -32
- package/build/cjs/vendor/escapeStringForRegex.js.map +1 -1
- package/build/cjs/vendor/getIpAddress.js +19 -99
- package/build/cjs/vendor/getIpAddress.js.map +1 -1
- package/build/esm/api.js +10 -34
- package/build/esm/api.js.map +1 -1
- package/build/esm/asyncContext/index.js +0 -14
- package/build/esm/asyncContext/index.js.map +1 -1
- package/build/esm/asyncContext/stackStrategy.js +16 -47
- package/build/esm/asyncContext/stackStrategy.js.map +1 -1
- package/build/esm/attributes.js +17 -95
- package/build/esm/attributes.js.map +1 -1
- package/build/esm/breadcrumbs.js +2 -22
- package/build/esm/breadcrumbs.js.map +1 -1
- package/build/esm/browser.js +5 -1
- package/build/esm/browser.js.map +1 -1
- package/build/esm/carrier.js +5 -42
- package/build/esm/carrier.js.map +1 -1
- package/build/esm/checkin.js +5 -19
- package/build/esm/checkin.js.map +1 -1
- package/build/esm/client.js +216 -585
- package/build/esm/client.js.map +1 -1
- package/build/esm/constants.js +2 -2
- package/build/esm/currentScopes.js +5 -86
- package/build/esm/currentScopes.js.map +1 -1
- package/build/esm/debug-build.js +0 -5
- package/build/esm/debug-build.js.map +1 -1
- package/build/esm/defaultScopes.js +2 -5
- package/build/esm/defaultScopes.js.map +1 -1
- package/build/esm/envelope.js +32 -103
- package/build/esm/envelope.js.map +1 -1
- package/build/esm/eventProcessors.js +4 -23
- package/build/esm/eventProcessors.js.map +1 -1
- package/build/esm/exports.js +21 -197
- package/build/esm/exports.js.map +1 -1
- package/build/esm/feedback.js +7 -19
- package/build/esm/feedback.js.map +1 -1
- package/build/esm/fetch.js +66 -201
- package/build/esm/fetch.js.map +1 -1
- package/build/esm/index.js +7 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/instrument/console.js +9 -41
- package/build/esm/instrument/console.js.map +1 -1
- package/build/esm/instrument/fetch.js +47 -156
- package/build/esm/instrument/fetch.js.map +1 -1
- package/build/esm/instrument/globalError.js +4 -25
- package/build/esm/instrument/globalError.js.map +1 -1
- package/build/esm/instrument/globalUnhandledRejection.js +4 -21
- package/build/esm/instrument/globalUnhandledRejection.js.map +1 -1
- package/build/esm/instrument/handlers.js +9 -21
- package/build/esm/instrument/handlers.js.map +1 -1
- package/build/esm/integration.js +13 -77
- package/build/esm/integration.js.map +1 -1
- package/build/esm/integrations/captureconsole.js +16 -40
- package/build/esm/integrations/captureconsole.js.map +1 -1
- package/build/esm/integrations/consola.js +57 -163
- package/build/esm/integrations/consola.js.map +1 -1
- package/build/esm/integrations/console.js +11 -43
- package/build/esm/integrations/console.js.map +1 -1
- package/build/esm/integrations/conversationId.js +5 -22
- package/build/esm/integrations/conversationId.js.map +1 -1
- package/build/esm/integrations/dedupe.js +16 -74
- package/build/esm/integrations/dedupe.js.map +1 -1
- package/build/esm/integrations/eventFilters.js +63 -114
- package/build/esm/integrations/eventFilters.js.map +1 -1
- package/build/esm/integrations/express/index.js +30 -145
- package/build/esm/integrations/express/index.js.map +1 -1
- package/build/esm/integrations/express/patch-layer.js +20 -130
- package/build/esm/integrations/express/patch-layer.js.map +1 -1
- package/build/esm/integrations/express/request-layer-store.js +1 -3
- package/build/esm/integrations/express/request-layer-store.js.map +1 -1
- package/build/esm/integrations/express/set-sdk-processing-metadata.js +0 -2
- package/build/esm/integrations/express/set-sdk-processing-metadata.js.map +1 -1
- package/build/esm/integrations/express/types.js +6 -7
- package/build/esm/integrations/express/types.js.map +1 -1
- package/build/esm/integrations/express/utils.js +37 -145
- package/build/esm/integrations/express/utils.js.map +1 -1
- package/build/esm/integrations/extraerrordata.js +24 -69
- package/build/esm/integrations/extraerrordata.js.map +1 -1
- package/build/esm/integrations/featureFlags/featureFlagsIntegration.js +3 -29
- package/build/esm/integrations/featureFlags/featureFlagsIntegration.js.map +1 -1
- package/build/esm/integrations/featureFlags/growthbook.js +11 -40
- package/build/esm/integrations/featureFlags/growthbook.js.map +1 -1
- package/build/esm/integrations/functiontostring.js +6 -27
- package/build/esm/integrations/functiontostring.js.map +1 -1
- package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js +10 -18
- package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -1
- package/build/esm/integrations/http/client-patch.js +8 -70
- package/build/esm/integrations/http/client-patch.js.map +1 -1
- package/build/esm/integrations/http/client-subscriptions.js +22 -59
- package/build/esm/integrations/http/client-subscriptions.js.map +1 -1
- package/build/esm/integrations/http/constants.js +3 -3
- package/build/esm/integrations/http/double-wrap-warning.js +10 -18
- package/build/esm/integrations/http/double-wrap-warning.js.map +1 -1
- package/build/esm/integrations/http/get-outgoing-span-data.js +30 -47
- package/build/esm/integrations/http/get-outgoing-span-data.js.map +1 -1
- package/build/esm/integrations/http/get-request-url.js +7 -24
- package/build/esm/integrations/http/get-request-url.js.map +1 -1
- package/build/esm/integrations/http/inject-trace-propagation-headers.js +14 -38
- package/build/esm/integrations/http/inject-trace-propagation-headers.js.map +1 -1
- package/build/esm/integrations/http/patch-request-to-capture-body.js +78 -0
- package/build/esm/integrations/http/patch-request-to-capture-body.js.map +1 -0
- package/build/esm/integrations/http/record-request-session.js +59 -0
- package/build/esm/integrations/http/record-request-session.js.map +1 -0
- package/build/esm/integrations/http/server-subscription.js +285 -0
- package/build/esm/integrations/http/server-subscription.js.map +1 -0
- package/build/esm/integrations/linkederrors.js +6 -11
- package/build/esm/integrations/linkederrors.js.map +1 -1
- package/build/esm/integrations/mcp-server/attributeExtraction.js +26 -69
- package/build/esm/integrations/mcp-server/attributeExtraction.js.map +1 -1
- package/build/esm/integrations/mcp-server/attributes.js +30 -138
- package/build/esm/integrations/mcp-server/attributes.js.map +1 -1
- package/build/esm/integrations/mcp-server/correlation.js +20 -91
- package/build/esm/integrations/mcp-server/correlation.js.map +1 -1
- package/build/esm/integrations/mcp-server/errorCapture.js +6 -25
- package/build/esm/integrations/mcp-server/errorCapture.js.map +1 -1
- package/build/esm/integrations/mcp-server/handlers.js +55 -169
- package/build/esm/integrations/mcp-server/handlers.js.map +1 -1
- package/build/esm/integrations/mcp-server/index.js +7 -60
- package/build/esm/integrations/mcp-server/index.js.map +1 -1
- package/build/esm/integrations/mcp-server/methodConfig.js +21 -59
- package/build/esm/integrations/mcp-server/methodConfig.js.map +1 -1
- package/build/esm/integrations/mcp-server/piiFiltering.js +5 -33
- package/build/esm/integrations/mcp-server/piiFiltering.js.map +1 -1
- package/build/esm/integrations/mcp-server/resultExtraction.js +20 -76
- package/build/esm/integrations/mcp-server/resultExtraction.js.map +1 -1
- package/build/esm/integrations/mcp-server/sessionExtraction.js +30 -121
- package/build/esm/integrations/mcp-server/sessionExtraction.js.map +1 -1
- package/build/esm/integrations/mcp-server/sessionManagement.js +2 -60
- package/build/esm/integrations/mcp-server/sessionManagement.js.map +1 -1
- package/build/esm/integrations/mcp-server/spans.js +20 -107
- package/build/esm/integrations/mcp-server/spans.js.map +1 -1
- package/build/esm/integrations/mcp-server/transport.js +26 -94
- package/build/esm/integrations/mcp-server/transport.js.map +1 -1
- package/build/esm/integrations/mcp-server/validation.js +6 -72
- package/build/esm/integrations/mcp-server/validation.js.map +1 -1
- package/build/esm/integrations/moduleMetadata.js +6 -20
- package/build/esm/integrations/moduleMetadata.js.map +1 -1
- package/build/esm/integrations/postgresjs.js +78 -287
- package/build/esm/integrations/postgresjs.js.map +1 -1
- package/build/esm/integrations/requestdata.js +30 -93
- package/build/esm/integrations/requestdata.js.map +1 -1
- package/build/esm/integrations/rewriteframes.js +14 -45
- package/build/esm/integrations/rewriteframes.js.map +1 -1
- package/build/esm/integrations/spanStreaming.js +9 -15
- package/build/esm/integrations/spanStreaming.js.map +1 -1
- package/build/esm/integrations/supabase.js +224 -333
- package/build/esm/integrations/supabase.js.map +1 -1
- package/build/esm/integrations/third-party-errors-filter.js +60 -85
- package/build/esm/integrations/third-party-errors-filter.js.map +1 -1
- package/build/esm/integrations/zoderrors.js +35 -111
- package/build/esm/integrations/zoderrors.js.map +1 -1
- package/build/esm/logs/console-integration.js +15 -50
- package/build/esm/logs/console-integration.js.map +1 -1
- package/build/esm/logs/constants.js +1 -6
- package/build/esm/logs/constants.js.map +1 -1
- package/build/esm/logs/envelope.js +10 -40
- package/build/esm/logs/envelope.js.map +1 -1
- package/build/esm/logs/internal.js +53 -126
- package/build/esm/logs/internal.js.map +1 -1
- package/build/esm/logs/public-api.js +13 -228
- package/build/esm/logs/public-api.js.map +1 -1
- package/build/esm/logs/utils.js +6 -47
- package/build/esm/logs/utils.js.map +1 -1
- package/build/esm/metadata.js +6 -51
- package/build/esm/metadata.js.map +1 -1
- package/build/esm/metrics/envelope.js +12 -45
- package/build/esm/metrics/envelope.js.map +1 -1
- package/build/esm/metrics/internal.js +31 -144
- package/build/esm/metrics/internal.js.map +1 -1
- package/build/esm/metrics/public-api.js +4 -109
- package/build/esm/metrics/public-api.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/profiling.js +11 -41
- package/build/esm/profiling.js.map +1 -1
- package/build/esm/scope.js +73 -224
- package/build/esm/scope.js.map +1 -1
- package/build/esm/sdk.js +2 -21
- package/build/esm/sdk.js.map +1 -1
- package/build/esm/semanticAttributes.js +31 -118
- package/build/esm/semanticAttributes.js.map +1 -1
- package/build/esm/server-runtime-client.js +32 -87
- package/build/esm/server-runtime-client.js.map +1 -1
- package/build/esm/server.js +7 -1
- package/build/esm/server.js.map +1 -1
- package/build/esm/session.js +14 -67
- package/build/esm/session.js.map +1 -1
- package/build/esm/tracing/ai/gen-ai-attributes.js +45 -249
- package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/esm/tracing/ai/mediaStripping.js +21 -116
- package/build/esm/tracing/ai/mediaStripping.js.map +1 -1
- package/build/esm/tracing/ai/messageTruncation.js +26 -212
- package/build/esm/tracing/ai/messageTruncation.js.map +1 -1
- package/build/esm/tracing/ai/utils.js +40 -180
- package/build/esm/tracing/ai/utils.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/constants.js +9 -12
- package/build/esm/tracing/anthropic-ai/constants.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/index.js +67 -172
- package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/streaming.js +45 -149
- package/build/esm/tracing/anthropic-ai/streaming.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/utils.js +17 -47
- package/build/esm/tracing/anthropic-ai/utils.js.map +1 -1
- package/build/esm/tracing/dynamicSamplingContext.js +18 -85
- package/build/esm/tracing/dynamicSamplingContext.js.map +1 -1
- package/build/esm/tracing/errors.js +2 -14
- package/build/esm/tracing/errors.js.map +1 -1
- package/build/esm/tracing/google-genai/constants.js +9 -16
- package/build/esm/tracing/google-genai/constants.js.map +1 -1
- package/build/esm/tracing/google-genai/index.js +79 -223
- package/build/esm/tracing/google-genai/index.js.map +1 -1
- package/build/esm/tracing/google-genai/streaming.js +11 -56
- package/build/esm/tracing/google-genai/streaming.js.map +1 -1
- package/build/esm/tracing/google-genai/utils.js +8 -13
- package/build/esm/tracing/google-genai/utils.js.map +1 -1
- package/build/esm/tracing/idleSpan.js +48 -174
- package/build/esm/tracing/idleSpan.js.map +1 -1
- package/build/esm/tracing/langchain/constants.js +8 -9
- package/build/esm/tracing/langchain/constants.js.map +1 -1
- package/build/esm/tracing/langchain/embeddings.js +31 -75
- package/build/esm/tracing/langchain/embeddings.js.map +1 -1
- package/build/esm/tracing/langchain/index.js +64 -161
- package/build/esm/tracing/langchain/index.js.map +1 -1
- package/build/esm/tracing/langchain/utils.js +101 -312
- package/build/esm/tracing/langchain/utils.js.map +1 -1
- package/build/esm/tracing/langgraph/constants.js +2 -2
- package/build/esm/tracing/langgraph/index.js +59 -162
- package/build/esm/tracing/langgraph/index.js.map +1 -1
- package/build/esm/tracing/langgraph/utils.js +54 -170
- package/build/esm/tracing/langgraph/utils.js.map +1 -1
- package/build/esm/tracing/logSpans.js +10 -26
- package/build/esm/tracing/logSpans.js.map +1 -1
- package/build/esm/tracing/measurement.js +6 -18
- package/build/esm/tracing/measurement.js.map +1 -1
- package/build/esm/tracing/openai/constants.js +20 -24
- package/build/esm/tracing/openai/constants.js.map +1 -1
- package/build/esm/tracing/openai/index.js +52 -132
- package/build/esm/tracing/openai/index.js.map +1 -1
- package/build/esm/tracing/openai/streaming.js +24 -102
- package/build/esm/tracing/openai/streaming.js.map +1 -1
- package/build/esm/tracing/openai/utils.js +36 -107
- package/build/esm/tracing/openai/utils.js.map +1 -1
- package/build/esm/tracing/sampling.js +23 -63
- package/build/esm/tracing/sampling.js.map +1 -1
- package/build/esm/tracing/sentryNonRecordingSpan.js +15 -40
- package/build/esm/tracing/sentryNonRecordingSpan.js.map +1 -1
- package/build/esm/tracing/sentrySpan.js +66 -172
- package/build/esm/tracing/sentrySpan.js.map +1 -1
- package/build/esm/tracing/spans/beforeSendSpan.js +4 -32
- package/build/esm/tracing/spans/beforeSendSpan.js.map +1 -1
- package/build/esm/tracing/spans/captureSpan.js +59 -157
- package/build/esm/tracing/spans/captureSpan.js.map +1 -1
- package/build/esm/tracing/spans/envelope.js +12 -24
- package/build/esm/tracing/spans/envelope.js.map +1 -1
- package/build/esm/tracing/spans/estimateSize.js +0 -22
- package/build/esm/tracing/spans/estimateSize.js.map +1 -1
- package/build/esm/tracing/spans/extractGenAiSpans.js +11 -33
- package/build/esm/tracing/spans/extractGenAiSpans.js.map +1 -1
- package/build/esm/tracing/spans/hasSpanStreamingEnabled.js +1 -4
- package/build/esm/tracing/spans/hasSpanStreamingEnabled.js.map +1 -1
- package/build/esm/tracing/spans/scopeContextAttributes.js +56 -0
- package/build/esm/tracing/spans/scopeContextAttributes.js.map +1 -0
- package/build/esm/tracing/spans/spanBuffer.js +21 -71
- package/build/esm/tracing/spans/spanBuffer.js.map +1 -1
- package/build/esm/tracing/spans/spanJsonToStreamedSpan.js +4 -8
- package/build/esm/tracing/spans/spanJsonToStreamedSpan.js.map +1 -1
- package/build/esm/tracing/spanstatus.js +15 -32
- package/build/esm/tracing/spanstatus.js.map +1 -1
- package/build/esm/tracing/trace.js +95 -311
- package/build/esm/tracing/trace.js.map +1 -1
- package/build/esm/tracing/utils.js +4 -14
- package/build/esm/tracing/utils.js.map +1 -1
- package/build/esm/tracing/vercel-ai/constants.js +15 -26
- package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
- package/build/esm/tracing/vercel-ai/index.js +84 -288
- package/build/esm/tracing/vercel-ai/index.js.map +1 -1
- package/build/esm/tracing/vercel-ai/utils.js +30 -128
- package/build/esm/tracing/vercel-ai/utils.js.map +1 -1
- package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js +22 -229
- package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
- package/build/esm/transports/base.js +32 -67
- package/build/esm/transports/base.js.map +1 -1
- package/build/esm/transports/multiplexed.js +38 -103
- package/build/esm/transports/multiplexed.js.map +1 -1
- package/build/esm/transports/offline.js +31 -72
- package/build/esm/transports/offline.js.map +1 -1
- package/build/esm/transports/userAgent.js +4 -13
- package/build/esm/transports/userAgent.js.map +1 -1
- package/build/esm/trpc.js +19 -39
- package/build/esm/trpc.js.map +1 -1
- package/build/esm/utils/aggregate-errors.js +18 -62
- package/build/esm/utils/aggregate-errors.js.map +1 -1
- package/build/esm/utils/ai/providerSkip.js +3 -50
- package/build/esm/utils/ai/providerSkip.js.map +1 -1
- package/build/esm/utils/anr.js +7 -36
- package/build/esm/utils/anr.js.map +1 -1
- package/build/esm/utils/baggage.js +37 -146
- package/build/esm/utils/baggage.js.map +1 -1
- package/build/esm/utils/breadcrumb-log-level.js +5 -9
- package/build/esm/utils/breadcrumb-log-level.js.map +1 -1
- package/build/esm/utils/browser.js +24 -86
- package/build/esm/utils/browser.js.map +1 -1
- package/build/esm/utils/chain-and-copy-promiselike.js +10 -27
- package/build/esm/utils/chain-and-copy-promiselike.js.map +1 -1
- package/build/esm/utils/clientreport.js +4 -13
- package/build/esm/utils/clientreport.js.map +1 -1
- package/build/esm/utils/cookie.js +6 -53
- package/build/esm/utils/cookie.js.map +1 -1
- package/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js +26 -0
- package/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js.map +1 -0
- package/build/esm/utils/data-collection/filterCookies.js +21 -0
- package/build/esm/utils/data-collection/filterCookies.js.map +1 -0
- package/build/esm/utils/data-collection/filterKeyValueData.js +41 -0
- package/build/esm/utils/data-collection/filterKeyValueData.js.map +1 -0
- package/build/esm/utils/data-collection/filterQueryParams.js +24 -0
- package/build/esm/utils/data-collection/filterQueryParams.js.map +1 -0
- package/build/esm/utils/data-collection/filtering-snippets.js +56 -0
- package/build/esm/utils/data-collection/filtering-snippets.js.map +1 -0
- package/build/esm/utils/data-collection/resolveDataCollectionOptions.js +35 -0
- package/build/esm/utils/data-collection/resolveDataCollectionOptions.js.map +1 -0
- package/build/esm/utils/debounce.js +5 -32
- package/build/esm/utils/debounce.js.map +1 -1
- package/build/esm/utils/debug-ids.js +4 -42
- package/build/esm/utils/debug-ids.js.map +1 -1
- package/build/esm/utils/debug-logger.js +23 -56
- package/build/esm/utils/debug-logger.js.map +1 -1
- package/build/esm/utils/dsn.js +18 -81
- package/build/esm/utils/dsn.js.map +1 -1
- package/build/esm/utils/env.js +3 -27
- package/build/esm/utils/env.js.map +1 -1
- package/build/esm/utils/envToBool.js +2 -15
- package/build/esm/utils/envToBool.js.map +1 -1
- package/build/esm/utils/envelope.js +39 -133
- package/build/esm/utils/envelope.js.map +1 -1
- package/build/esm/utils/error.js +3 -10
- package/build/esm/utils/error.js.map +1 -1
- package/build/esm/utils/eventUtils.js +0 -8
- package/build/esm/utils/eventUtils.js.map +1 -1
- package/build/esm/utils/eventbuilder.js +30 -114
- package/build/esm/utils/eventbuilder.js.map +1 -1
- package/build/esm/utils/exports.js +5 -24
- package/build/esm/utils/exports.js.map +1 -1
- package/build/esm/utils/featureFlags.js +10 -96
- package/build/esm/utils/featureFlags.js.map +1 -1
- package/build/esm/utils/flushIfServerless.js +14 -48
- package/build/esm/utils/flushIfServerless.js.map +1 -1
- package/build/esm/utils/get-default-export.js +1 -25
- package/build/esm/utils/get-default-export.js.map +1 -1
- package/build/esm/utils/handleCallbackErrors.js +10 -48
- package/build/esm/utils/handleCallbackErrors.js.map +1 -1
- package/build/esm/utils/hasSpansEnabled.js +4 -28
- package/build/esm/utils/hasSpansEnabled.js.map +1 -1
- package/build/esm/utils/ipAddress.js +7 -19
- package/build/esm/utils/ipAddress.js.map +1 -1
- package/build/esm/utils/is.js +18 -163
- package/build/esm/utils/is.js.map +1 -1
- package/build/esm/utils/isBrowser.js +3 -9
- package/build/esm/utils/isBrowser.js.map +1 -1
- package/build/esm/utils/isSentryRequestUrl.js +2 -19
- package/build/esm/utils/isSentryRequestUrl.js.map +1 -1
- package/build/esm/utils/lru.js +13 -24
- package/build/esm/utils/lru.js.map +1 -1
- package/build/esm/utils/merge.js +1 -17
- package/build/esm/utils/merge.js.map +1 -1
- package/build/esm/utils/meta.js +1 -24
- package/build/esm/utils/meta.js.map +1 -1
- package/build/esm/utils/misc.js +31 -134
- package/build/esm/utils/misc.js.map +1 -1
- package/build/esm/utils/node-stack-trace.js +22 -61
- package/build/esm/utils/node-stack-trace.js.map +1 -1
- package/build/esm/utils/node.js +3 -48
- package/build/esm/utils/node.js.map +1 -1
- package/build/esm/utils/normalizationHints.js +5 -18
- package/build/esm/utils/normalizationHints.js.map +1 -1
- package/build/esm/utils/normalize.js +39 -205
- package/build/esm/utils/normalize.js.map +1 -1
- package/build/esm/utils/object.js +33 -168
- package/build/esm/utils/object.js.map +1 -1
- package/build/esm/utils/parameterize.js +2 -21
- package/build/esm/utils/parameterize.js.map +1 -1
- package/build/esm/utils/parseSampleRate.js +4 -13
- package/build/esm/utils/parseSampleRate.js.map +1 -1
- package/build/esm/utils/path.js +28 -115
- package/build/esm/utils/path.js.map +1 -1
- package/build/esm/utils/prepareEvent.js +53 -191
- package/build/esm/utils/prepareEvent.js.map +1 -1
- package/build/esm/utils/promisebuffer.js +5 -47
- package/build/esm/utils/promisebuffer.js.map +1 -1
- package/build/esm/utils/propagationContext.js +0 -7
- package/build/esm/utils/propagationContext.js.map +1 -1
- package/build/esm/utils/randomSafeContext.js +3 -22
- package/build/esm/utils/randomSafeContext.js.map +1 -1
- package/build/esm/utils/ratelimit.js +13 -66
- package/build/esm/utils/ratelimit.js.map +1 -1
- package/build/esm/utils/request.js +62 -269
- package/build/esm/utils/request.js.map +1 -1
- package/build/esm/utils/scopeData.js +15 -79
- package/build/esm/utils/scopeData.js.map +1 -1
- package/build/esm/utils/sdkMetadata.js +5 -19
- package/build/esm/utils/sdkMetadata.js.map +1 -1
- package/build/esm/utils/severity.js +1 -9
- package/build/esm/utils/severity.js.map +1 -1
- package/build/esm/utils/should-ignore-span.js +6 -38
- package/build/esm/utils/should-ignore-span.js.map +1 -1
- package/build/esm/utils/spanOnScope.js +3 -14
- package/build/esm/utils/spanOnScope.js.map +1 -1
- package/build/esm/utils/spanUtils.js +42 -222
- package/build/esm/utils/spanUtils.js.map +1 -1
- package/build/esm/utils/stacktrace.js +19 -106
- package/build/esm/utils/stacktrace.js.map +1 -1
- package/build/esm/utils/string.js +7 -75
- package/build/esm/utils/string.js.map +1 -1
- package/build/esm/utils/supports.js +14 -99
- package/build/esm/utils/supports.js.map +1 -1
- package/build/esm/utils/syncpromise.js +19 -68
- package/build/esm/utils/syncpromise.js.map +1 -1
- package/build/esm/utils/time.js +7 -84
- package/build/esm/utils/time.js.map +1 -1
- package/build/esm/utils/timer.js +1 -10
- package/build/esm/utils/timer.js.map +1 -1
- package/build/esm/utils/timestampSequence.js +5 -21
- package/build/esm/utils/timestampSequence.js.map +1 -1
- package/build/esm/utils/trace-info.js +3 -10
- package/build/esm/utils/trace-info.js.map +1 -1
- package/build/esm/utils/traceData.js +4 -39
- package/build/esm/utils/traceData.js.map +1 -1
- package/build/esm/utils/tracePropagationTargets.js +4 -18
- package/build/esm/utils/tracePropagationTargets.js.map +1 -1
- package/build/esm/utils/tracing.js +32 -106
- package/build/esm/utils/tracing.js.map +1 -1
- package/build/esm/utils/transactionEvent.js +11 -19
- package/build/esm/utils/transactionEvent.js.map +1 -1
- package/build/esm/utils/tunnel.js +12 -33
- package/build/esm/utils/tunnel.js.map +1 -1
- package/build/esm/utils/url.js +42 -176
- package/build/esm/utils/url.js.map +1 -1
- package/build/esm/utils/vercelWaitUntil.js +4 -12
- package/build/esm/utils/vercelWaitUntil.js.map +1 -1
- package/build/esm/utils/version.js +1 -3
- package/build/esm/utils/version.js.map +1 -1
- package/build/esm/utils/weakRef.js +5 -36
- package/build/esm/utils/weakRef.js.map +1 -1
- package/build/esm/utils/worldwide.js +1 -4
- package/build/esm/utils/worldwide.js.map +1 -1
- package/build/esm/vendor/escapeStringForRegex.js +1 -32
- package/build/esm/vendor/escapeStringForRegex.js.map +1 -1
- package/build/esm/vendor/getIpAddress.js +19 -99
- package/build/esm/vendor/getIpAddress.js.map +1 -1
- package/build/types/api.d.ts +2 -2
- package/build/types/api.d.ts.map +1 -1
- package/build/types/attributes.d.ts +5 -8
- package/build/types/attributes.d.ts.map +1 -1
- package/build/types/breadcrumbs.d.ts +1 -1
- package/build/types/breadcrumbs.d.ts.map +1 -1
- package/build/types/browser-exports.d.ts +3 -3
- package/build/types/browser-exports.d.ts.map +1 -1
- package/build/types/carrier.d.ts +2 -2
- package/build/types/carrier.d.ts.map +1 -1
- package/build/types/checkin.d.ts +4 -4
- package/build/types/checkin.d.ts.map +1 -1
- package/build/types/client.d.ts +32 -22
- package/build/types/client.d.ts.map +1 -1
- package/build/types/currentScopes.d.ts +1 -1
- package/build/types/currentScopes.d.ts.map +1 -1
- package/build/types/envelope.d.ts +7 -7
- package/build/types/envelope.d.ts.map +1 -1
- package/build/types/eventProcessors.d.ts +2 -2
- package/build/types/eventProcessors.d.ts.map +1 -1
- package/build/types/exports.d.ts +8 -8
- package/build/types/exports.d.ts.map +1 -1
- package/build/types/feedback.d.ts +2 -2
- package/build/types/feedback.d.ts.map +1 -1
- package/build/types/fetch.d.ts +3 -3
- package/build/types/fetch.d.ts.map +1 -1
- package/build/types/instrument/console.d.ts +1 -1
- package/build/types/instrument/console.d.ts.map +1 -1
- package/build/types/instrument/fetch.d.ts +1 -1
- package/build/types/instrument/fetch.d.ts.map +1 -1
- package/build/types/instrument/globalError.d.ts +1 -1
- package/build/types/instrument/globalError.d.ts.map +1 -1
- package/build/types/instrument/globalUnhandledRejection.d.ts +1 -1
- package/build/types/instrument/globalUnhandledRejection.d.ts.map +1 -1
- package/build/types/integration.d.ts +2 -2
- package/build/types/integration.d.ts.map +1 -1
- package/build/types/integrations/consola.d.ts +1 -1
- package/build/types/integrations/consola.d.ts.map +1 -1
- package/build/types/integrations/console.d.ts +1 -1
- package/build/types/integrations/console.d.ts.map +1 -1
- package/build/types/integrations/dedupe.d.ts +1 -1
- package/build/types/integrations/dedupe.d.ts.map +1 -1
- package/build/types/integrations/express/types.d.ts +2 -2
- package/build/types/integrations/express/types.d.ts.map +1 -1
- package/build/types/integrations/express/utils.d.ts +1 -1
- package/build/types/integrations/express/utils.d.ts.map +1 -1
- package/build/types/integrations/featureFlags/featureFlagsIntegration.d.ts +1 -1
- package/build/types/integrations/featureFlags/featureFlagsIntegration.d.ts.map +1 -1
- package/build/types/integrations/featureFlags/growthbook.d.ts +1 -1
- package/build/types/integrations/featureFlags/growthbook.d.ts.map +1 -1
- package/build/types/integrations/http/double-wrap-warning.d.ts +1 -1
- package/build/types/integrations/http/double-wrap-warning.d.ts.map +1 -1
- package/build/types/integrations/http/get-outgoing-span-data.d.ts +2 -2
- package/build/types/integrations/http/get-outgoing-span-data.d.ts.map +1 -1
- package/build/types/integrations/http/patch-request-to-capture-body.d.ts +12 -0
- package/build/types/integrations/http/patch-request-to-capture-body.d.ts.map +1 -0
- package/build/types/integrations/http/record-request-session.d.ts +18 -0
- package/build/types/integrations/http/record-request-session.d.ts.map +1 -0
- package/build/types/integrations/http/server-subscription.d.ts +26 -0
- package/build/types/integrations/http/server-subscription.d.ts.map +1 -0
- package/build/types/integrations/http/types.d.ts +12 -6
- package/build/types/integrations/http/types.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/correlation.d.ts +1 -1
- package/build/types/integrations/mcp-server/correlation.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/piiFiltering.d.ts +1 -1
- package/build/types/integrations/mcp-server/piiFiltering.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/types.d.ts +1 -1
- package/build/types/integrations/mcp-server/types.d.ts.map +1 -1
- package/build/types/integrations/postgresjs.d.ts +1 -1
- package/build/types/integrations/postgresjs.d.ts.map +1 -1
- package/build/types/integrations/rewriteframes.d.ts +1 -1
- package/build/types/integrations/rewriteframes.d.ts.map +1 -1
- package/build/types/integrations/supabase.d.ts +14 -3
- package/build/types/integrations/supabase.d.ts.map +1 -1
- package/build/types/integrations/third-party-errors-filter.d.ts.map +1 -1
- package/build/types/integrations/zoderrors.d.ts +1 -1
- package/build/types/integrations/zoderrors.d.ts.map +1 -1
- package/build/types/logs/console-integration.d.ts +1 -1
- package/build/types/logs/console-integration.d.ts.map +1 -1
- package/build/types/logs/constants.d.ts +1 -1
- package/build/types/logs/constants.d.ts.map +1 -1
- package/build/types/logs/envelope.d.ts +4 -4
- package/build/types/logs/envelope.d.ts.map +1 -1
- package/build/types/logs/internal.d.ts +16 -1
- package/build/types/logs/internal.d.ts.map +1 -1
- package/build/types/logs/public-api.d.ts +2 -2
- package/build/types/logs/public-api.d.ts.map +1 -1
- package/build/types/metadata.d.ts +2 -2
- package/build/types/metadata.d.ts.map +1 -1
- package/build/types/metrics/envelope.d.ts +4 -4
- package/build/types/metrics/envelope.d.ts.map +1 -1
- package/build/types/metrics/internal.d.ts +1 -1
- package/build/types/metrics/internal.d.ts.map +1 -1
- package/build/types/metrics/public-api.d.ts +1 -1
- package/build/types/metrics/public-api.d.ts.map +1 -1
- package/build/types/profiling.d.ts +1 -1
- package/build/types/profiling.d.ts.map +1 -1
- package/build/types/report-dialog.d.ts +1 -1
- package/build/types/report-dialog.d.ts.map +1 -1
- package/build/types/scope.d.ts +14 -14
- package/build/types/scope.d.ts.map +1 -1
- package/build/types/sdk.d.ts +1 -1
- package/build/types/sdk.d.ts.map +1 -1
- package/build/types/semanticAttributes.d.ts +2 -0
- package/build/types/semanticAttributes.d.ts.map +1 -1
- package/build/types/server-exports.d.ts +3 -1
- package/build/types/server-exports.d.ts.map +1 -1
- package/build/types/server-runtime-client.d.ts +6 -6
- package/build/types/server-runtime-client.d.ts.map +1 -1
- package/build/types/session.d.ts +1 -1
- package/build/types/session.d.ts.map +1 -1
- package/build/types/shared-exports.d.ts +58 -53
- package/build/types/shared-exports.d.ts.map +1 -1
- package/build/types/tracing/ai/utils.d.ts +1 -1
- package/build/types/tracing/ai/utils.d.ts.map +1 -1
- package/build/types/tracing/anthropic-ai/streaming.d.ts +1 -1
- package/build/types/tracing/anthropic-ai/streaming.d.ts.map +1 -1
- package/build/types/tracing/anthropic-ai/utils.d.ts +2 -2
- package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
- package/build/types/tracing/dynamicSamplingContext.d.ts +2 -2
- package/build/types/tracing/dynamicSamplingContext.d.ts.map +1 -1
- package/build/types/tracing/google-genai/streaming.d.ts +1 -1
- package/build/types/tracing/google-genai/streaming.d.ts.map +1 -1
- package/build/types/tracing/idleSpan.d.ts +2 -2
- package/build/types/tracing/idleSpan.d.ts.map +1 -1
- package/build/types/tracing/langchain/utils.d.ts +6 -1
- package/build/types/tracing/langchain/utils.d.ts.map +1 -1
- package/build/types/tracing/langgraph/index.d.ts.map +1 -1
- package/build/types/tracing/langgraph/utils.d.ts +1 -3
- package/build/types/tracing/langgraph/utils.d.ts.map +1 -1
- package/build/types/tracing/logSpans.d.ts +1 -1
- package/build/types/tracing/logSpans.d.ts.map +1 -1
- package/build/types/tracing/measurement.d.ts +2 -2
- package/build/types/tracing/measurement.d.ts.map +1 -1
- package/build/types/tracing/openai/streaming.d.ts +1 -1
- package/build/types/tracing/openai/streaming.d.ts.map +1 -1
- package/build/types/tracing/openai/utils.d.ts +1 -1
- package/build/types/tracing/openai/utils.d.ts.map +1 -1
- package/build/types/tracing/sampling.d.ts +2 -2
- package/build/types/tracing/sampling.d.ts.map +1 -1
- package/build/types/tracing/sentryNonRecordingSpan.d.ts +3 -3
- package/build/types/tracing/sentryNonRecordingSpan.d.ts.map +1 -1
- package/build/types/tracing/sentrySpan.d.ts +4 -4
- package/build/types/tracing/sentrySpan.d.ts.map +1 -1
- package/build/types/tracing/spans/beforeSendSpan.d.ts +3 -3
- package/build/types/tracing/spans/beforeSendSpan.d.ts.map +1 -1
- package/build/types/tracing/spans/captureSpan.d.ts +1 -1
- package/build/types/tracing/spans/captureSpan.d.ts.map +1 -1
- package/build/types/tracing/spans/envelope.d.ts +2 -2
- package/build/types/tracing/spans/envelope.d.ts.map +1 -1
- package/build/types/tracing/spans/estimateSize.d.ts +1 -1
- package/build/types/tracing/spans/estimateSize.d.ts.map +1 -1
- package/build/types/tracing/spans/extractGenAiSpans.d.ts +2 -2
- package/build/types/tracing/spans/extractGenAiSpans.d.ts.map +1 -1
- package/build/types/tracing/spans/scopeContextAttributes.d.ts +9 -0
- package/build/types/tracing/spans/scopeContextAttributes.d.ts.map +1 -0
- package/build/types/tracing/spans/spanJsonToStreamedSpan.d.ts +1 -1
- package/build/types/tracing/spans/spanJsonToStreamedSpan.d.ts.map +1 -1
- package/build/types/tracing/spanstatus.d.ts +2 -2
- package/build/types/tracing/spanstatus.d.ts.map +1 -1
- package/build/types/tracing/trace.d.ts +2 -2
- package/build/types/tracing/trace.d.ts.map +1 -1
- package/build/types/tracing/utils.d.ts +1 -1
- package/build/types/tracing/utils.d.ts.map +1 -1
- package/build/types/tracing/vercel-ai/utils.d.ts +2 -2
- package/build/types/tracing/vercel-ai/utils.d.ts.map +1 -1
- package/build/types/transports/base.d.ts +1 -1
- package/build/types/transports/base.d.ts.map +1 -1
- package/build/types/transports/multiplexed.d.ts +3 -3
- package/build/types/transports/multiplexed.d.ts.map +1 -1
- package/build/types/transports/offline.d.ts +2 -2
- package/build/types/transports/offline.d.ts.map +1 -1
- package/build/types/transports/userAgent.d.ts +1 -1
- package/build/types/transports/userAgent.d.ts.map +1 -1
- package/build/types/trpc.d.ts.map +1 -1
- package/build/types/types/attachment.d.ts.map +1 -0
- package/build/types/types/breadcrumb.d.ts.map +1 -0
- package/build/types/types/browseroptions.d.ts.map +1 -0
- package/build/types/types/checkin.d.ts.map +1 -0
- package/build/types/types/clientreport.d.ts.map +1 -0
- package/build/types/types/context.d.ts.map +1 -0
- package/build/types/types/csp.d.ts.map +1 -0
- package/build/types/types/datacategory.d.ts.map +1 -0
- package/build/types/types/datacollection.d.ts +75 -0
- package/build/types/types/datacollection.d.ts.map +1 -0
- package/build/types/types/debugMeta.d.ts.map +1 -0
- package/build/types/types/dsn.d.ts.map +1 -0
- package/build/types/types/envelope.d.ts.map +1 -0
- package/build/types/types/error.d.ts.map +1 -0
- package/build/types/types/event.d.ts.map +1 -0
- package/build/types/types/eventprocessor.d.ts.map +1 -0
- package/build/types/types/exception.d.ts.map +1 -0
- package/build/types/types/extra.d.ts.map +1 -0
- package/build/types/types/feedback/config.d.ts.map +1 -0
- package/build/types/types/feedback/form.d.ts.map +1 -0
- package/build/types/types/feedback/index.d.ts.map +1 -0
- package/build/types/types/feedback/sendFeedback.d.ts.map +1 -0
- package/build/types/types/feedback/theme.d.ts.map +1 -0
- package/build/types/types/instrument.d.ts.map +1 -0
- package/build/types/types/integration.d.ts.map +1 -0
- package/build/types/types/link.d.ts.map +1 -0
- package/build/types/types/log.d.ts.map +1 -0
- package/build/types/types/measurement.d.ts.map +1 -0
- package/build/types/types/mechanism.d.ts.map +1 -0
- package/build/types/types/metric.d.ts.map +1 -0
- package/build/types/types/misc.d.ts.map +1 -0
- package/build/types/types/opentelemetry.d.ts.map +1 -0
- package/build/types/{types-hoist → types}/options.d.ts +17 -0
- package/build/types/types/options.d.ts.map +1 -0
- package/build/types/types/package.d.ts.map +1 -0
- package/build/types/types/parameterize.d.ts.map +1 -0
- package/build/types/types/polymorphics.d.ts.map +1 -0
- package/build/types/types/profiling.d.ts.map +1 -0
- package/build/types/types/replay.d.ts.map +1 -0
- package/build/types/types/request.d.ts.map +1 -0
- package/build/types/types/runtime.d.ts.map +1 -0
- package/build/types/{types-hoist → types}/samplingcontext.d.ts +1 -1
- package/build/types/types/samplingcontext.d.ts.map +1 -0
- package/build/types/types/sdkinfo.d.ts.map +1 -0
- package/build/types/types/sdkmetadata.d.ts.map +1 -0
- package/build/types/types/session.d.ts.map +1 -0
- package/build/types/types/severity.d.ts.map +1 -0
- package/build/types/types/span.d.ts.map +1 -0
- package/build/types/types/spanStatus.d.ts.map +1 -0
- package/build/types/types/stackframe.d.ts.map +1 -0
- package/build/types/types/stacktrace.d.ts.map +1 -0
- package/build/types/{types-hoist → types}/startSpanOptions.d.ts +13 -0
- package/build/types/types/startSpanOptions.d.ts.map +1 -0
- package/build/types/types/thread.d.ts.map +1 -0
- package/build/types/types/timedEvent.d.ts.map +1 -0
- package/build/types/types/tracing.d.ts.map +1 -0
- package/build/types/types/transaction.d.ts.map +1 -0
- package/build/types/types/transport.d.ts.map +1 -0
- package/build/types/types/user.d.ts.map +1 -0
- package/build/types/types/view-hierarchy.d.ts.map +1 -0
- package/build/types/types/vue.d.ts.map +1 -0
- package/build/types/types/webfetchapi.d.ts.map +1 -0
- package/build/types/types/wrappedfunction.d.ts.map +1 -0
- package/build/types/utils/aggregate-errors.d.ts +3 -3
- package/build/types/utils/aggregate-errors.d.ts.map +1 -1
- package/build/types/utils/anr.d.ts +1 -1
- package/build/types/utils/anr.d.ts.map +1 -1
- package/build/types/utils/baggage.d.ts +1 -1
- package/build/types/utils/baggage.d.ts.map +1 -1
- package/build/types/utils/breadcrumb-log-level.d.ts +1 -1
- package/build/types/utils/breadcrumb-log-level.d.ts.map +1 -1
- package/build/types/utils/clientreport.d.ts +2 -2
- package/build/types/utils/clientreport.d.ts.map +1 -1
- package/build/types/utils/data-collection/defaultPiiToCollectionOptions.d.ts +6 -0
- package/build/types/utils/data-collection/defaultPiiToCollectionOptions.d.ts.map +1 -0
- package/build/types/utils/data-collection/filterCookies.d.ts +9 -0
- package/build/types/utils/data-collection/filterCookies.d.ts.map +1 -0
- package/build/types/utils/data-collection/filterKeyValueData.d.ts +11 -0
- package/build/types/utils/data-collection/filterKeyValueData.d.ts.map +1 -0
- package/build/types/utils/data-collection/filterQueryParams.d.ts +9 -0
- package/build/types/utils/data-collection/filterQueryParams.d.ts.map +1 -0
- package/build/types/utils/data-collection/filtering-snippets.d.ts +14 -0
- package/build/types/utils/data-collection/filtering-snippets.d.ts.map +1 -0
- package/build/types/utils/data-collection/resolveDataCollectionOptions.d.ts +14 -0
- package/build/types/utils/data-collection/resolveDataCollectionOptions.d.ts.map +1 -0
- package/build/types/utils/debug-ids.d.ts +2 -2
- package/build/types/utils/debug-ids.d.ts.map +1 -1
- package/build/types/utils/debug-logger.d.ts +1 -1
- package/build/types/utils/debug-logger.d.ts.map +1 -1
- package/build/types/utils/dsn.d.ts +1 -1
- package/build/types/utils/dsn.d.ts.map +1 -1
- package/build/types/utils/env.d.ts.map +1 -1
- package/build/types/utils/envelope.d.ts +8 -8
- package/build/types/utils/envelope.d.ts.map +1 -1
- package/build/types/utils/error.d.ts +1 -1
- package/build/types/utils/error.d.ts.map +1 -1
- package/build/types/utils/eventUtils.d.ts +1 -1
- package/build/types/utils/eventUtils.d.ts.map +1 -1
- package/build/types/utils/eventbuilder.d.ts +6 -6
- package/build/types/utils/eventbuilder.d.ts.map +1 -1
- package/build/types/utils/featureFlags.d.ts +1 -1
- package/build/types/utils/featureFlags.d.ts.map +1 -1
- package/build/types/utils/hasSpansEnabled.d.ts +1 -1
- package/build/types/utils/hasSpansEnabled.d.ts.map +1 -1
- package/build/types/utils/ipAddress.d.ts +2 -2
- package/build/types/utils/ipAddress.d.ts.map +1 -1
- package/build/types/utils/is.d.ts +4 -4
- package/build/types/utils/is.d.ts.map +1 -1
- package/build/types/utils/meta.d.ts +1 -1
- package/build/types/utils/meta.d.ts.map +1 -1
- package/build/types/utils/misc.d.ts +3 -3
- package/build/types/utils/misc.d.ts.map +1 -1
- package/build/types/utils/node-stack-trace.d.ts +1 -1
- package/build/types/utils/node-stack-trace.d.ts.map +1 -1
- package/build/types/utils/object.d.ts +1 -1
- package/build/types/utils/object.d.ts.map +1 -1
- package/build/types/utils/parameterize.d.ts +1 -1
- package/build/types/utils/parameterize.d.ts.map +1 -1
- package/build/types/utils/prepareEvent.d.ts +3 -3
- package/build/types/utils/prepareEvent.d.ts.map +1 -1
- package/build/types/utils/ratelimit.d.ts +2 -2
- package/build/types/utils/ratelimit.d.ts.map +1 -1
- package/build/types/utils/request.d.ts +3 -3
- package/build/types/utils/request.d.ts.map +1 -1
- package/build/types/utils/scopeData.d.ts +1 -1
- package/build/types/utils/scopeData.d.ts.map +1 -1
- package/build/types/utils/sdkMetadata.d.ts +1 -1
- package/build/types/utils/sdkMetadata.d.ts.map +1 -1
- package/build/types/utils/severity.d.ts +1 -1
- package/build/types/utils/severity.d.ts.map +1 -1
- package/build/types/utils/should-ignore-span.d.ts +2 -2
- package/build/types/utils/should-ignore-span.d.ts.map +1 -1
- package/build/types/utils/spanOnScope.d.ts +1 -1
- package/build/types/utils/spanOnScope.d.ts.map +1 -1
- package/build/types/utils/spanUtils.d.ts +4 -4
- package/build/types/utils/spanUtils.d.ts.map +1 -1
- package/build/types/utils/stacktrace.d.ts +4 -4
- package/build/types/utils/stacktrace.d.ts.map +1 -1
- package/build/types/utils/trace-info.d.ts +2 -2
- package/build/types/utils/trace-info.d.ts.map +1 -1
- package/build/types/utils/traceData.d.ts +2 -2
- package/build/types/utils/traceData.d.ts.map +1 -1
- package/build/types/utils/tracePropagationTargets.d.ts +1 -1
- package/build/types/utils/tracePropagationTargets.d.ts.map +1 -1
- package/build/types/utils/tracing.d.ts +2 -2
- package/build/types/utils/tracing.d.ts.map +1 -1
- package/build/types/utils/transactionEvent.d.ts +2 -2
- package/build/types/utils/transactionEvent.d.ts.map +1 -1
- package/build/types/utils/url.d.ts +1 -1
- package/build/types/utils/url.d.ts.map +1 -1
- package/build/types/utils/worldwide.d.ts +1 -0
- package/build/types/utils/worldwide.d.ts.map +1 -1
- package/build/types-ts3.8/api.d.ts +2 -2
- package/build/types-ts3.8/attributes.d.ts +5 -8
- package/build/types-ts3.8/breadcrumbs.d.ts +1 -1
- package/build/types-ts3.8/browser-exports.d.ts +3 -3
- package/build/types-ts3.8/carrier.d.ts +2 -2
- package/build/types-ts3.8/checkin.d.ts +4 -4
- package/build/types-ts3.8/client.d.ts +32 -22
- package/build/types-ts3.8/currentScopes.d.ts +1 -1
- package/build/types-ts3.8/envelope.d.ts +7 -7
- package/build/types-ts3.8/eventProcessors.d.ts +2 -2
- package/build/types-ts3.8/exports.d.ts +8 -8
- package/build/types-ts3.8/feedback.d.ts +2 -2
- package/build/types-ts3.8/fetch.d.ts +3 -3
- package/build/types-ts3.8/instrument/console.d.ts +1 -1
- package/build/types-ts3.8/instrument/fetch.d.ts +1 -1
- package/build/types-ts3.8/instrument/globalError.d.ts +1 -1
- package/build/types-ts3.8/instrument/globalUnhandledRejection.d.ts +1 -1
- package/build/types-ts3.8/integration.d.ts +2 -2
- package/build/types-ts3.8/integrations/consola.d.ts +1 -1
- package/build/types-ts3.8/integrations/console.d.ts +1 -1
- package/build/types-ts3.8/integrations/dedupe.d.ts +1 -1
- package/build/types-ts3.8/integrations/express/types.d.ts +2 -2
- package/build/types-ts3.8/integrations/express/utils.d.ts +1 -1
- package/build/types-ts3.8/integrations/featureFlags/featureFlagsIntegration.d.ts +1 -1
- package/build/types-ts3.8/integrations/featureFlags/growthbook.d.ts +1 -1
- package/build/types-ts3.8/integrations/http/double-wrap-warning.d.ts +1 -1
- package/build/types-ts3.8/integrations/http/get-outgoing-span-data.d.ts +2 -2
- package/build/types-ts3.8/integrations/http/patch-request-to-capture-body.d.ts +12 -0
- package/build/types-ts3.8/integrations/http/record-request-session.d.ts +18 -0
- package/build/types-ts3.8/integrations/http/server-subscription.d.ts +26 -0
- package/build/types-ts3.8/integrations/http/types.d.ts +12 -6
- package/build/types-ts3.8/integrations/mcp-server/correlation.d.ts +1 -1
- package/build/types-ts3.8/integrations/mcp-server/piiFiltering.d.ts +1 -1
- package/build/types-ts3.8/integrations/mcp-server/types.d.ts +1 -1
- package/build/types-ts3.8/integrations/postgresjs.d.ts +1 -1
- package/build/types-ts3.8/integrations/rewriteframes.d.ts +1 -1
- package/build/types-ts3.8/integrations/supabase.d.ts +14 -3
- package/build/types-ts3.8/integrations/zoderrors.d.ts +1 -1
- package/build/types-ts3.8/logs/console-integration.d.ts +1 -1
- package/build/types-ts3.8/logs/constants.d.ts +1 -1
- package/build/types-ts3.8/logs/envelope.d.ts +4 -4
- package/build/types-ts3.8/logs/internal.d.ts +16 -1
- package/build/types-ts3.8/logs/public-api.d.ts +2 -2
- package/build/types-ts3.8/metadata.d.ts +2 -2
- package/build/types-ts3.8/metrics/envelope.d.ts +4 -4
- package/build/types-ts3.8/metrics/internal.d.ts +1 -1
- package/build/types-ts3.8/metrics/public-api.d.ts +1 -1
- package/build/types-ts3.8/profiling.d.ts +1 -1
- package/build/types-ts3.8/report-dialog.d.ts +1 -1
- package/build/types-ts3.8/scope.d.ts +14 -14
- package/build/types-ts3.8/sdk.d.ts +1 -1
- package/build/types-ts3.8/semanticAttributes.d.ts +2 -0
- package/build/types-ts3.8/server-exports.d.ts +3 -1
- package/build/types-ts3.8/server-runtime-client.d.ts +6 -6
- package/build/types-ts3.8/session.d.ts +1 -1
- package/build/types-ts3.8/shared-exports.d.ts +58 -53
- package/build/types-ts3.8/tracing/ai/utils.d.ts +1 -1
- package/build/types-ts3.8/tracing/anthropic-ai/streaming.d.ts +1 -1
- package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +2 -2
- package/build/types-ts3.8/tracing/dynamicSamplingContext.d.ts +2 -2
- package/build/types-ts3.8/tracing/google-genai/streaming.d.ts +1 -1
- package/build/types-ts3.8/tracing/idleSpan.d.ts +2 -2
- package/build/types-ts3.8/tracing/langchain/utils.d.ts +6 -1
- package/build/types-ts3.8/tracing/langgraph/utils.d.ts +1 -3
- package/build/types-ts3.8/tracing/logSpans.d.ts +1 -1
- package/build/types-ts3.8/tracing/measurement.d.ts +2 -2
- package/build/types-ts3.8/tracing/openai/streaming.d.ts +1 -1
- package/build/types-ts3.8/tracing/openai/utils.d.ts +1 -1
- package/build/types-ts3.8/tracing/sampling.d.ts +2 -2
- package/build/types-ts3.8/tracing/sentryNonRecordingSpan.d.ts +3 -3
- package/build/types-ts3.8/tracing/sentrySpan.d.ts +4 -4
- package/build/types-ts3.8/tracing/spans/beforeSendSpan.d.ts +3 -3
- package/build/types-ts3.8/tracing/spans/captureSpan.d.ts +1 -1
- package/build/types-ts3.8/tracing/spans/envelope.d.ts +2 -2
- package/build/types-ts3.8/tracing/spans/estimateSize.d.ts +1 -1
- package/build/types-ts3.8/tracing/spans/extractGenAiSpans.d.ts +2 -2
- package/build/types-ts3.8/tracing/spans/scopeContextAttributes.d.ts +9 -0
- package/build/types-ts3.8/tracing/spans/spanJsonToStreamedSpan.d.ts +1 -1
- package/build/types-ts3.8/tracing/spanstatus.d.ts +2 -2
- package/build/types-ts3.8/tracing/trace.d.ts +2 -2
- package/build/types-ts3.8/tracing/utils.d.ts +1 -1
- package/build/types-ts3.8/tracing/vercel-ai/utils.d.ts +2 -2
- package/build/types-ts3.8/transports/base.d.ts +1 -1
- package/build/types-ts3.8/transports/multiplexed.d.ts +3 -3
- package/build/types-ts3.8/transports/offline.d.ts +2 -2
- package/build/types-ts3.8/transports/userAgent.d.ts +1 -1
- package/build/types-ts3.8/types/datacollection.d.ts +75 -0
- package/build/types-ts3.8/{types-hoist → types}/options.d.ts +17 -0
- package/build/types-ts3.8/{types-hoist → types}/samplingcontext.d.ts +1 -1
- package/build/types-ts3.8/{types-hoist → types}/startSpanOptions.d.ts +13 -0
- package/build/types-ts3.8/utils/aggregate-errors.d.ts +3 -3
- package/build/types-ts3.8/utils/anr.d.ts +1 -1
- package/build/types-ts3.8/utils/baggage.d.ts +1 -1
- package/build/types-ts3.8/utils/breadcrumb-log-level.d.ts +1 -1
- package/build/types-ts3.8/utils/clientreport.d.ts +2 -2
- package/build/types-ts3.8/utils/data-collection/defaultPiiToCollectionOptions.d.ts +6 -0
- package/build/types-ts3.8/utils/data-collection/filterCookies.d.ts +9 -0
- package/build/types-ts3.8/utils/data-collection/filterKeyValueData.d.ts +11 -0
- package/build/types-ts3.8/utils/data-collection/filterQueryParams.d.ts +9 -0
- package/build/types-ts3.8/utils/data-collection/filtering-snippets.d.ts +14 -0
- package/build/types-ts3.8/utils/data-collection/resolveDataCollectionOptions.d.ts +14 -0
- package/build/types-ts3.8/utils/debug-ids.d.ts +2 -2
- package/build/types-ts3.8/utils/debug-logger.d.ts +1 -1
- package/build/types-ts3.8/utils/dsn.d.ts +1 -1
- package/build/types-ts3.8/utils/envelope.d.ts +8 -8
- package/build/types-ts3.8/utils/error.d.ts +1 -1
- package/build/types-ts3.8/utils/eventUtils.d.ts +1 -1
- package/build/types-ts3.8/utils/eventbuilder.d.ts +6 -6
- package/build/types-ts3.8/utils/featureFlags.d.ts +1 -1
- package/build/types-ts3.8/utils/hasSpansEnabled.d.ts +1 -1
- package/build/types-ts3.8/utils/ipAddress.d.ts +2 -2
- package/build/types-ts3.8/utils/is.d.ts +4 -4
- package/build/types-ts3.8/utils/meta.d.ts +1 -1
- package/build/types-ts3.8/utils/misc.d.ts +3 -3
- package/build/types-ts3.8/utils/node-stack-trace.d.ts +1 -1
- package/build/types-ts3.8/utils/object.d.ts +1 -1
- package/build/types-ts3.8/utils/parameterize.d.ts +1 -1
- package/build/types-ts3.8/utils/prepareEvent.d.ts +3 -3
- package/build/types-ts3.8/utils/ratelimit.d.ts +2 -2
- package/build/types-ts3.8/utils/request.d.ts +3 -3
- package/build/types-ts3.8/utils/scopeData.d.ts +1 -1
- package/build/types-ts3.8/utils/sdkMetadata.d.ts +1 -1
- package/build/types-ts3.8/utils/severity.d.ts +1 -1
- package/build/types-ts3.8/utils/should-ignore-span.d.ts +2 -2
- package/build/types-ts3.8/utils/spanOnScope.d.ts +1 -1
- package/build/types-ts3.8/utils/spanUtils.d.ts +4 -4
- package/build/types-ts3.8/utils/stacktrace.d.ts +4 -4
- package/build/types-ts3.8/utils/trace-info.d.ts +2 -2
- package/build/types-ts3.8/utils/traceData.d.ts +2 -2
- package/build/types-ts3.8/utils/tracePropagationTargets.d.ts +1 -1
- package/build/types-ts3.8/utils/tracing.d.ts +2 -2
- package/build/types-ts3.8/utils/transactionEvent.d.ts +2 -2
- package/build/types-ts3.8/utils/url.d.ts +1 -1
- package/build/types-ts3.8/utils/worldwide.d.ts +1 -0
- package/package.json +1 -1
- package/build/types/types-hoist/attachment.d.ts.map +0 -1
- package/build/types/types-hoist/breadcrumb.d.ts.map +0 -1
- package/build/types/types-hoist/browseroptions.d.ts.map +0 -1
- package/build/types/types-hoist/checkin.d.ts.map +0 -1
- package/build/types/types-hoist/clientreport.d.ts.map +0 -1
- package/build/types/types-hoist/context.d.ts.map +0 -1
- package/build/types/types-hoist/csp.d.ts.map +0 -1
- package/build/types/types-hoist/datacategory.d.ts.map +0 -1
- package/build/types/types-hoist/debugMeta.d.ts.map +0 -1
- package/build/types/types-hoist/dsn.d.ts.map +0 -1
- package/build/types/types-hoist/envelope.d.ts.map +0 -1
- package/build/types/types-hoist/error.d.ts.map +0 -1
- package/build/types/types-hoist/event.d.ts.map +0 -1
- package/build/types/types-hoist/eventprocessor.d.ts.map +0 -1
- package/build/types/types-hoist/exception.d.ts.map +0 -1
- package/build/types/types-hoist/extra.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/config.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/form.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/index.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/sendFeedback.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/theme.d.ts.map +0 -1
- package/build/types/types-hoist/instrument.d.ts.map +0 -1
- package/build/types/types-hoist/integration.d.ts.map +0 -1
- package/build/types/types-hoist/link.d.ts.map +0 -1
- package/build/types/types-hoist/log.d.ts.map +0 -1
- package/build/types/types-hoist/measurement.d.ts.map +0 -1
- package/build/types/types-hoist/mechanism.d.ts.map +0 -1
- package/build/types/types-hoist/metric.d.ts.map +0 -1
- package/build/types/types-hoist/misc.d.ts.map +0 -1
- package/build/types/types-hoist/opentelemetry.d.ts.map +0 -1
- package/build/types/types-hoist/options.d.ts.map +0 -1
- package/build/types/types-hoist/package.d.ts.map +0 -1
- package/build/types/types-hoist/parameterize.d.ts.map +0 -1
- package/build/types/types-hoist/polymorphics.d.ts.map +0 -1
- package/build/types/types-hoist/profiling.d.ts.map +0 -1
- package/build/types/types-hoist/replay.d.ts.map +0 -1
- package/build/types/types-hoist/request.d.ts.map +0 -1
- package/build/types/types-hoist/runtime.d.ts.map +0 -1
- package/build/types/types-hoist/samplingcontext.d.ts.map +0 -1
- package/build/types/types-hoist/sdkinfo.d.ts.map +0 -1
- package/build/types/types-hoist/sdkmetadata.d.ts.map +0 -1
- package/build/types/types-hoist/session.d.ts.map +0 -1
- package/build/types/types-hoist/severity.d.ts.map +0 -1
- package/build/types/types-hoist/span.d.ts.map +0 -1
- package/build/types/types-hoist/spanStatus.d.ts.map +0 -1
- package/build/types/types-hoist/stackframe.d.ts.map +0 -1
- package/build/types/types-hoist/stacktrace.d.ts.map +0 -1
- package/build/types/types-hoist/startSpanOptions.d.ts.map +0 -1
- package/build/types/types-hoist/thread.d.ts.map +0 -1
- package/build/types/types-hoist/timedEvent.d.ts.map +0 -1
- package/build/types/types-hoist/tracing.d.ts.map +0 -1
- package/build/types/types-hoist/transaction.d.ts.map +0 -1
- package/build/types/types-hoist/transport.d.ts.map +0 -1
- package/build/types/types-hoist/user.d.ts.map +0 -1
- package/build/types/types-hoist/view-hierarchy.d.ts.map +0 -1
- package/build/types/types-hoist/vue.d.ts.map +0 -1
- package/build/types/types-hoist/webfetchapi.d.ts.map +0 -1
- package/build/types/types-hoist/wrappedfunction.d.ts.map +0 -1
- /package/build/types/{types-hoist → types}/attachment.d.ts +0 -0
- /package/build/types/{types-hoist → types}/breadcrumb.d.ts +0 -0
- /package/build/types/{types-hoist → types}/browseroptions.d.ts +0 -0
- /package/build/types/{types-hoist → types}/checkin.d.ts +0 -0
- /package/build/types/{types-hoist → types}/clientreport.d.ts +0 -0
- /package/build/types/{types-hoist → types}/context.d.ts +0 -0
- /package/build/types/{types-hoist → types}/csp.d.ts +0 -0
- /package/build/types/{types-hoist → types}/datacategory.d.ts +0 -0
- /package/build/types/{types-hoist → types}/debugMeta.d.ts +0 -0
- /package/build/types/{types-hoist → types}/dsn.d.ts +0 -0
- /package/build/types/{types-hoist → types}/envelope.d.ts +0 -0
- /package/build/types/{types-hoist → types}/error.d.ts +0 -0
- /package/build/types/{types-hoist → types}/event.d.ts +0 -0
- /package/build/types/{types-hoist → types}/eventprocessor.d.ts +0 -0
- /package/build/types/{types-hoist → types}/exception.d.ts +0 -0
- /package/build/types/{types-hoist → types}/extra.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/config.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/form.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/index.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/sendFeedback.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/theme.d.ts +0 -0
- /package/build/types/{types-hoist → types}/instrument.d.ts +0 -0
- /package/build/types/{types-hoist → types}/integration.d.ts +0 -0
- /package/build/types/{types-hoist → types}/link.d.ts +0 -0
- /package/build/types/{types-hoist → types}/log.d.ts +0 -0
- /package/build/types/{types-hoist → types}/measurement.d.ts +0 -0
- /package/build/types/{types-hoist → types}/mechanism.d.ts +0 -0
- /package/build/types/{types-hoist → types}/metric.d.ts +0 -0
- /package/build/types/{types-hoist → types}/misc.d.ts +0 -0
- /package/build/types/{types-hoist → types}/opentelemetry.d.ts +0 -0
- /package/build/types/{types-hoist → types}/package.d.ts +0 -0
- /package/build/types/{types-hoist → types}/parameterize.d.ts +0 -0
- /package/build/types/{types-hoist → types}/polymorphics.d.ts +0 -0
- /package/build/types/{types-hoist → types}/profiling.d.ts +0 -0
- /package/build/types/{types-hoist → types}/replay.d.ts +0 -0
- /package/build/types/{types-hoist → types}/request.d.ts +0 -0
- /package/build/types/{types-hoist → types}/runtime.d.ts +0 -0
- /package/build/types/{types-hoist → types}/sdkinfo.d.ts +0 -0
- /package/build/types/{types-hoist → types}/sdkmetadata.d.ts +0 -0
- /package/build/types/{types-hoist → types}/session.d.ts +0 -0
- /package/build/types/{types-hoist → types}/severity.d.ts +0 -0
- /package/build/types/{types-hoist → types}/span.d.ts +0 -0
- /package/build/types/{types-hoist → types}/spanStatus.d.ts +0 -0
- /package/build/types/{types-hoist → types}/stackframe.d.ts +0 -0
- /package/build/types/{types-hoist → types}/stacktrace.d.ts +0 -0
- /package/build/types/{types-hoist → types}/thread.d.ts +0 -0
- /package/build/types/{types-hoist → types}/timedEvent.d.ts +0 -0
- /package/build/types/{types-hoist → types}/tracing.d.ts +0 -0
- /package/build/types/{types-hoist → types}/transaction.d.ts +0 -0
- /package/build/types/{types-hoist → types}/transport.d.ts +0 -0
- /package/build/types/{types-hoist → types}/user.d.ts +0 -0
- /package/build/types/{types-hoist → types}/view-hierarchy.d.ts +0 -0
- /package/build/types/{types-hoist → types}/vue.d.ts +0 -0
- /package/build/types/{types-hoist → types}/webfetchapi.d.ts +0 -0
- /package/build/types/{types-hoist → types}/wrappedfunction.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/attachment.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/breadcrumb.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/browseroptions.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/checkin.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/clientreport.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/context.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/csp.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/datacategory.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/debugMeta.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/dsn.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/envelope.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/error.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/event.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/eventprocessor.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/exception.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/extra.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/config.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/form.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/index.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/sendFeedback.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/theme.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/instrument.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/integration.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/link.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/log.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/measurement.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/mechanism.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/metric.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/misc.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/opentelemetry.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/package.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/parameterize.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/polymorphics.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/profiling.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/replay.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/request.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/runtime.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/sdkinfo.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/sdkmetadata.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/session.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/severity.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/span.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/spanStatus.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/stackframe.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/stacktrace.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/thread.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/timedEvent.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/tracing.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/transaction.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/transport.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/user.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/view-hierarchy.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/vue.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/webfetchapi.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/wrappedfunction.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correlation.js","sources":["../../../../src/integrations/mcp-server/correlation.ts"],"sourcesContent":["/**\n * Request-span correlation system for MCP server instrumentation\n *\n * Handles mapping requestId to span data for correlation with handler execution.\n *\n * Uses sessionId as the primary key for stateful transports. This handles the wrapper\n * transport pattern (e.g., NodeStreamableHTTPServerTransport wrapping WebStandardStreamableHTTPServerTransport)\n * where onmessage and send may receive different `this` values but share the same sessionId.\n *\n * Falls back to WeakMap by transport instance for stateless transports (no sessionId).\n */\n\nimport { SPAN_STATUS_ERROR } from '../../tracing';\nimport type { Span } from '../../types
|
|
1
|
+
{"version":3,"file":"correlation.js","sources":["../../../../src/integrations/mcp-server/correlation.ts"],"sourcesContent":["/**\n * Request-span correlation system for MCP server instrumentation\n *\n * Handles mapping requestId to span data for correlation with handler execution.\n *\n * Uses sessionId as the primary key for stateful transports. This handles the wrapper\n * transport pattern (e.g., NodeStreamableHTTPServerTransport wrapping WebStandardStreamableHTTPServerTransport)\n * where onmessage and send may receive different `this` values but share the same sessionId.\n *\n * Falls back to WeakMap by transport instance for stateless transports (no sessionId).\n */\n\nimport { SPAN_STATUS_ERROR } from '../../tracing';\nimport type { Span } from '../../types/span';\nimport { MCP_PROTOCOL_VERSION_ATTRIBUTE } from './attributes';\nimport { extractPromptResultAttributes, extractToolResultAttributes } from './resultExtraction';\nimport { buildServerAttributesFromInfo, extractSessionDataFromInitializeResponse } from './sessionExtraction';\nimport type { MCPTransport, RequestId, RequestSpanMapValue, ResolvedMcpOptions } from './types';\n\n/**\n * Session-scoped correlation for stateful transports (with sessionId)\n * @internal Using sessionId as key handles wrapper transport patterns where\n * different transport objects share the same logical session\n */\nconst sessionToSpanMap = new Map<string, Map<RequestId, RequestSpanMapValue>>();\n\n/**\n * Transport-scoped correlation fallback for stateless transports (no sessionId)\n * @internal WeakMap allows automatic cleanup when transport is garbage collected\n */\nconst statelessSpanMap = new WeakMap<MCPTransport, Map<RequestId, RequestSpanMapValue>>();\n\n/**\n * Gets or creates the span map for a transport, using sessionId when available\n * @internal\n * @param transport - MCP transport instance\n * @returns Span map for the transport/session\n */\nfunction getOrCreateSpanMap(transport: MCPTransport): Map<RequestId, RequestSpanMapValue> {\n const sessionId = transport.sessionId;\n\n if (sessionId) {\n // Stateful transport - use sessionId as key (handles wrapper pattern)\n let spanMap = sessionToSpanMap.get(sessionId);\n if (!spanMap) {\n spanMap = new Map();\n sessionToSpanMap.set(sessionId, spanMap);\n }\n return spanMap;\n }\n\n // Stateless fallback - use transport instance as key\n let spanMap = statelessSpanMap.get(transport);\n if (!spanMap) {\n spanMap = new Map();\n statelessSpanMap.set(transport, spanMap);\n }\n return spanMap;\n}\n\n/**\n * Stores span context for later correlation with handler execution\n * @param transport - MCP transport instance\n * @param requestId - Request identifier\n * @param span - Active span to correlate\n * @param method - MCP method name\n */\nexport function storeSpanForRequest(transport: MCPTransport, requestId: RequestId, span: Span, method: string): void {\n const spanMap = getOrCreateSpanMap(transport);\n spanMap.set(requestId, {\n span,\n method,\n // oxlint-disable-next-line sdk/no-unsafe-random-apis\n startTime: Date.now(),\n });\n}\n\n/**\n * Completes span with results and cleans up correlation\n * @param transport - MCP transport instance\n * @param requestId - Request identifier\n * @param result - Execution result for attribute extraction\n * @param options - Resolved MCP options\n * @param hasError - Whether the JSON-RPC response contained an error\n */\nexport function completeSpanWithResults(\n transport: MCPTransport,\n requestId: RequestId,\n result: unknown,\n options: ResolvedMcpOptions,\n hasError = false,\n): void {\n const spanMap = getOrCreateSpanMap(transport);\n const spanData = spanMap.get(requestId);\n if (spanData) {\n const { span, method } = spanData;\n\n if (hasError) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n } else if (method === 'initialize') {\n const sessionData = extractSessionDataFromInitializeResponse(result);\n const serverAttributes = buildServerAttributesFromInfo(sessionData.serverInfo);\n\n const initAttributes: Record<string, string | number> = {\n ...serverAttributes,\n };\n if (sessionData.protocolVersion) {\n initAttributes[MCP_PROTOCOL_VERSION_ATTRIBUTE] = sessionData.protocolVersion;\n }\n\n span.setAttributes(initAttributes);\n } else if (method === 'tools/call') {\n const toolAttributes = extractToolResultAttributes(result, options.recordOutputs);\n span.setAttributes(toolAttributes);\n } else if (method === 'prompts/get') {\n const promptAttributes = extractPromptResultAttributes(result, options.recordOutputs);\n span.setAttributes(promptAttributes);\n }\n\n span.end();\n spanMap.delete(requestId);\n }\n}\n\n/**\n * Cleans up pending spans for a specific transport (when that transport closes)\n * @param transport - MCP transport instance\n */\nexport function cleanupPendingSpansForTransport(transport: MCPTransport): void {\n const sessionId = transport.sessionId;\n\n // Try sessionId-based cleanup first (for stateful transports)\n if (sessionId) {\n const spanMap = sessionToSpanMap.get(sessionId);\n if (spanMap) {\n for (const [, spanData] of spanMap) {\n spanData.span.setStatus({\n code: SPAN_STATUS_ERROR,\n message: 'cancelled',\n });\n spanData.span.end();\n }\n sessionToSpanMap.delete(sessionId);\n }\n return;\n }\n\n // Fallback to transport-based cleanup (for stateless transports)\n const spanMap = statelessSpanMap.get(transport);\n if (spanMap) {\n for (const [, spanData] of spanMap) {\n spanData.span.setStatus({\n code: SPAN_STATUS_ERROR,\n message: 'cancelled',\n });\n spanData.span.end();\n }\n spanMap.clear();\n // Note: WeakMap entries are automatically cleaned up when transport is GC'd\n }\n}\n"],"names":["spanMap","SPAN_STATUS_ERROR","extractSessionDataFromInitializeResponse","buildServerAttributesFromInfo","MCP_PROTOCOL_VERSION_ATTRIBUTE","extractToolResultAttributes","extractPromptResultAttributes"],"mappings":";;;;;;;AAwBA,MAAM,gBAAA,uBAAuB,GAAA,EAAiD;AAM9E,MAAM,gBAAA,uBAAuB,OAAA,EAA2D;AAQxF,SAAS,mBAAmB,SAAA,EAA8D;AACxF,EAAA,MAAM,YAAY,SAAA,CAAU,SAAA;AAE5B,EAAA,IAAI,SAAA,EAAW;AAEb,IAAA,IAAIA,QAAAA,GAAU,gBAAA,CAAiB,GAAA,CAAI,SAAS,CAAA;AAC5C,IAAA,IAAI,CAACA,QAAAA,EAAS;AACZ,MAAAA,QAAAA,uBAAc,GAAA,EAAI;AAClB,MAAA,gBAAA,CAAiB,GAAA,CAAI,WAAWA,QAAO,CAAA;AAAA,IACzC;AACA,IAAA,OAAOA,QAAAA;AAAA,EACT;AAGA,EAAA,IAAI,OAAA,GAAU,gBAAA,CAAiB,GAAA,CAAI,SAAS,CAAA;AAC5C,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA,OAAA,uBAAc,GAAA,EAAI;AAClB,IAAA,gBAAA,CAAiB,GAAA,CAAI,WAAW,OAAO,CAAA;AAAA,EACzC;AACA,EAAA,OAAO,OAAA;AACT;AASO,SAAS,mBAAA,CAAoB,SAAA,EAAyB,SAAA,EAAsB,IAAA,EAAY,MAAA,EAAsB;AACnH,EAAA,MAAM,OAAA,GAAU,mBAAmB,SAAS,CAAA;AAC5C,EAAA,OAAA,CAAQ,IAAI,SAAA,EAAW;AAAA,IACrB,IAAA;A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,IACrC;AAEA,IAAA,IAAA,CAAK,GAAA,EAAI;AACT,IAAA,OAAA,CAAQ,OAAO,SAAS,CAAA;AAAA,EAC1B;AACF;AAMO,SAAS,gCAAgC,SAAA,EAA+B;AAC7E,EAAA,MAAM,YAAY,SAAA,CAAU,SAAA;AAG5B,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,MAAMN,QAAAA,GAAU,gBAAA,CAAiB,GAAA,CAAI,SAAS,CAAA;AAC9C,IAAA,IAAIA,QAAAA,EAAS;AACX,MAAA,KAAA,MAAW,GAAG,QAAQ,CAAA,IAAKA,QAAAA,EAAS;AAClC,QAAA,QAAA,CAAS,KAAK,SAAA,CAAU;AAAA,UACtB,IAAA,EAAMC,4BAAA;AAAA,UACN,OAAA,EAAS;AAAA,SACV,CAAA;AACD,QAAA,QAAA,CAAS,KAAK,GAAA,EAAI;AAAA,MACpB;AACA,MAAA,gBAAA,CAAiB,OAAO,SAAS,CAAA;AAAA,IACnC;AACA,IAAA;AAAA,EACF;AAGA,EAAA,MAAM,OAAA,GAAU,gBAAA,CAAiB,GAAA,CAAI,SAAS,CAAA;AAC9C,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,KAAA,MAAW,GAAG,QAAQ,CAAA,IAAK,OAAA,EAAS;AAClC,MAAA,QAAA,CAAS,KAAK,SAAA,CAAU;AAAA,QACtB,IAAA,EAAMA,4BAAA;AAAA,QACN,OAAA,EAAS;AAAA,OACV,CAAA;AACD,MAAA,QAAA,CAAS,KAAK,GAAA,EAAI;AAAA,IACpB;AACA,IAAA,OAAA,CAAQ,KAAA,EAAM;AAAA,EAEhB;AACF;;;;;;"}
|
|
@@ -5,49 +5,30 @@ const exports$1 = require('../../exports.js');
|
|
|
5
5
|
const spanUtils = require('../../utils/spanUtils.js');
|
|
6
6
|
const spanstatus = require('../../tracing/spanstatus.js');
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Safe error capture utilities for MCP server instrumentation
|
|
10
|
-
*
|
|
11
|
-
* Ensures error reporting never interferes with MCP server operation.
|
|
12
|
-
* All capture operations are wrapped in try-catch to prevent side effects.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Captures an error without affecting MCP server operation.
|
|
18
|
-
*
|
|
19
|
-
* The active span already contains all MCP context (method, tool, arguments, etc.)
|
|
20
|
-
* @param error - Error to capture
|
|
21
|
-
* @param errorType - Classification of error type for filtering
|
|
22
|
-
* @param extraData - Additional context data to include
|
|
23
|
-
*/
|
|
24
8
|
function captureError(error, errorType, extraData) {
|
|
25
9
|
try {
|
|
26
10
|
const client = currentScopes.getClient();
|
|
27
11
|
if (!client) {
|
|
28
12
|
return;
|
|
29
13
|
}
|
|
30
|
-
|
|
31
14
|
const activeSpan = spanUtils.getActiveSpan();
|
|
32
15
|
if (activeSpan?.isRecording()) {
|
|
33
16
|
activeSpan.setStatus({
|
|
34
17
|
code: spanstatus.SPAN_STATUS_ERROR,
|
|
35
|
-
message:
|
|
18
|
+
message: "internal_error"
|
|
36
19
|
});
|
|
37
20
|
}
|
|
38
|
-
|
|
39
21
|
exports$1.captureException(error, {
|
|
40
22
|
mechanism: {
|
|
41
|
-
type:
|
|
23
|
+
type: "auto.ai.mcp_server",
|
|
42
24
|
handled: false,
|
|
43
25
|
data: {
|
|
44
|
-
error_type: errorType ||
|
|
45
|
-
...extraData
|
|
46
|
-
}
|
|
47
|
-
}
|
|
26
|
+
error_type: errorType || "handler_execution",
|
|
27
|
+
...extraData
|
|
28
|
+
}
|
|
29
|
+
}
|
|
48
30
|
});
|
|
49
31
|
} catch {
|
|
50
|
-
// noop
|
|
51
32
|
}
|
|
52
33
|
}
|
|
53
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorCapture.js","sources":["../../../../src/integrations/mcp-server/errorCapture.ts"],"sourcesContent":["/**\n * Safe error capture utilities for MCP server instrumentation\n *\n * Ensures error reporting never interferes with MCP server operation.\n * All capture operations are wrapped in try-catch to prevent side effects.\n */\n\nimport { getClient } from '../../currentScopes';\nimport { captureException } from '../../exports';\nimport { SPAN_STATUS_ERROR } from '../../tracing';\nimport { getActiveSpan } from '../../utils/spanUtils';\nimport type { McpErrorType } from './types';\n\n/**\n * Captures an error without affecting MCP server operation.\n *\n * The active span already contains all MCP context (method, tool, arguments, etc.)\n * @param error - Error to capture\n * @param errorType - Classification of error type for filtering\n * @param extraData - Additional context data to include\n */\nexport function captureError(error: Error, errorType?: McpErrorType, extraData?: Record<string, unknown>): void {\n try {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (activeSpan?.isRecording()) {\n activeSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: 'internal_error',\n });\n }\n\n captureException(error, {\n mechanism: {\n type: 'auto.ai.mcp_server',\n handled: false,\n data: {\n error_type: errorType || 'handler_execution',\n ...extraData,\n },\n },\n });\n } catch {\n // noop\n }\n}\n"],"names":["getClient","getActiveSpan","SPAN_STATUS_ERROR","captureException"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"errorCapture.js","sources":["../../../../src/integrations/mcp-server/errorCapture.ts"],"sourcesContent":["/**\n * Safe error capture utilities for MCP server instrumentation\n *\n * Ensures error reporting never interferes with MCP server operation.\n * All capture operations are wrapped in try-catch to prevent side effects.\n */\n\nimport { getClient } from '../../currentScopes';\nimport { captureException } from '../../exports';\nimport { SPAN_STATUS_ERROR } from '../../tracing';\nimport { getActiveSpan } from '../../utils/spanUtils';\nimport type { McpErrorType } from './types';\n\n/**\n * Captures an error without affecting MCP server operation.\n *\n * The active span already contains all MCP context (method, tool, arguments, etc.)\n * @param error - Error to capture\n * @param errorType - Classification of error type for filtering\n * @param extraData - Additional context data to include\n */\nexport function captureError(error: Error, errorType?: McpErrorType, extraData?: Record<string, unknown>): void {\n try {\n const client = getClient();\n if (!client) {\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (activeSpan?.isRecording()) {\n activeSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: 'internal_error',\n });\n }\n\n captureException(error, {\n mechanism: {\n type: 'auto.ai.mcp_server',\n handled: false,\n data: {\n error_type: errorType || 'handler_execution',\n ...extraData,\n },\n },\n });\n } catch {\n // noop\n }\n}\n"],"names":["getClient","getActiveSpan","SPAN_STATUS_ERROR","captureException"],"mappings":";;;;;;;AAqBO,SAAS,YAAA,CAAa,KAAA,EAAc,SAAA,EAA0B,SAAA,EAA2C;AAC9G,EAAA,IAAI;AACF,IAAA,MAAM,SAASA,uBAAA,EAAU;AACzB,IAAA,IAAI,CAAC,MAAA,EAAQ;AACX,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,aAAaC,uBAAA,EAAc;AACjC,IAAA,IAAI,UAAA,EAAY,aAAY,EAAG;AAC7B,MAAA,UAAA,CAAW,SAAA,CAAU;AAAA,QACnB,IAAA,EAAMC,4BAAA;AAAA,QACN,OAAA,EAAS;AAAA,OACV,CAAA;AAAA,IACH;AAEA,IAAAC,0BAAA,CAAiB,KAAA,EAAO;AAAA,MACtB,SAAA,EAAW;AAAA,QACT,IAAA,EAAM,oBAAA;AAAA,QACN,OAAA,EAAS,KAAA;AAAA,QACT,IAAA,EAAM;AAAA,UACJ,YAAY,SAAA,IAAa,mBAAA;AAAA,UACzB,GAAG;AAAA;AACL;AACF,KACD,CAAA;AAAA,EACH,CAAA,CAAA,MAAQ;AAAA,EAER;AACF;;;;"}
|
|
@@ -5,237 +5,123 @@ const debugLogger = require('../../utils/debug-logger.js');
|
|
|
5
5
|
const object = require('../../utils/object.js');
|
|
6
6
|
const errorCapture = require('./errorCapture.js');
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Handler method wrapping for MCP server instrumentation
|
|
10
|
-
*
|
|
11
|
-
* Provides automatic error capture and span correlation for tool, resource,
|
|
12
|
-
* and prompt handlers.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Generic function to wrap MCP server method handlers
|
|
18
|
-
* @internal
|
|
19
|
-
* @param serverInstance - MCP server instance
|
|
20
|
-
* @param methodName - Method name to wrap (tool, resource, prompt)
|
|
21
|
-
*/
|
|
22
8
|
function wrapMethodHandler(serverInstance, methodName) {
|
|
23
|
-
object.fill(serverInstance, methodName, originalMethod => {
|
|
24
|
-
return function
|
|
9
|
+
object.fill(serverInstance, methodName, (originalMethod) => {
|
|
10
|
+
return function(name, ...args) {
|
|
25
11
|
const handler = args[args.length - 1];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return (originalMethod ).call(this, name, ...args);
|
|
12
|
+
if (typeof handler !== "function") {
|
|
13
|
+
return originalMethod.call(this, name, ...args);
|
|
29
14
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return (originalMethod ).call(this, name, ...args.slice(0, -1), wrappedHandler);
|
|
15
|
+
const wrappedHandler = createWrappedHandler(handler, methodName, name);
|
|
16
|
+
return originalMethod.call(this, name, ...args.slice(0, -1), wrappedHandler);
|
|
33
17
|
};
|
|
34
18
|
});
|
|
35
19
|
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Creates a wrapped handler with span correlation and error capture
|
|
39
|
-
* @internal
|
|
40
|
-
* @param originalHandler - Original handler function
|
|
41
|
-
* @param methodName - MCP method name
|
|
42
|
-
* @param handlerName - Handler identifier
|
|
43
|
-
* @returns Wrapped handler function
|
|
44
|
-
*/
|
|
45
20
|
function createWrappedHandler(originalHandler, methodName, handlerName) {
|
|
46
|
-
return function
|
|
21
|
+
return function(...handlerArgs) {
|
|
47
22
|
try {
|
|
48
23
|
return createErrorCapturingHandler.call(this, originalHandler, methodName, handlerName, handlerArgs);
|
|
49
24
|
} catch (error) {
|
|
50
|
-
debugBuild.DEBUG_BUILD && debugLogger.debug.warn(
|
|
25
|
+
debugBuild.DEBUG_BUILD && debugLogger.debug.warn("MCP handler wrapping failed:", error);
|
|
51
26
|
return originalHandler.apply(this, handlerArgs);
|
|
52
27
|
}
|
|
53
28
|
};
|
|
54
29
|
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Creates an error-capturing wrapper for handler execution
|
|
58
|
-
* @internal
|
|
59
|
-
* @param originalHandler - Original handler function
|
|
60
|
-
* @param methodName - MCP method name
|
|
61
|
-
* @param handlerName - Handler identifier
|
|
62
|
-
* @param handlerArgs - Handler arguments
|
|
63
|
-
* @param extraHandlerData - Additional handler context
|
|
64
|
-
* @returns Handler execution result
|
|
65
|
-
*/
|
|
66
|
-
function createErrorCapturingHandler(
|
|
67
|
-
|
|
68
|
-
originalHandler,
|
|
69
|
-
methodName,
|
|
70
|
-
handlerName,
|
|
71
|
-
handlerArgs,
|
|
72
|
-
) {
|
|
30
|
+
function createErrorCapturingHandler(originalHandler, methodName, handlerName, handlerArgs) {
|
|
73
31
|
try {
|
|
74
32
|
const result = originalHandler.apply(this, handlerArgs);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return Promise.resolve(result).catch(error => {
|
|
33
|
+
if (result && typeof result === "object" && typeof result.then === "function") {
|
|
34
|
+
return Promise.resolve(result).catch((error) => {
|
|
78
35
|
captureHandlerError(error, methodName, handlerName);
|
|
79
36
|
throw error;
|
|
80
37
|
});
|
|
81
38
|
}
|
|
82
|
-
|
|
83
39
|
return result;
|
|
84
40
|
} catch (error) {
|
|
85
|
-
captureHandlerError(error
|
|
41
|
+
captureHandlerError(error, methodName, handlerName);
|
|
86
42
|
throw error;
|
|
87
43
|
}
|
|
88
44
|
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Captures handler execution errors based on handler type
|
|
92
|
-
* @internal
|
|
93
|
-
* @param error - Error to capture
|
|
94
|
-
* @param methodName - MCP method name
|
|
95
|
-
* @param handlerName - Handler identifier
|
|
96
|
-
*/
|
|
97
45
|
function captureHandlerError(error, methodName, handlerName) {
|
|
98
46
|
try {
|
|
99
47
|
const extraData = {};
|
|
100
|
-
|
|
101
|
-
if (methodName === 'tool' || methodName === 'registerTool') {
|
|
48
|
+
if (methodName === "tool" || methodName === "registerTool") {
|
|
102
49
|
extraData.tool_name = handlerName;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
error.message.includes('protocol')
|
|
108
|
-
) {
|
|
109
|
-
errorCapture.captureError(error, 'validation', extraData);
|
|
110
|
-
} else if (
|
|
111
|
-
error.name === 'ServerTimeoutError' ||
|
|
112
|
-
error.message.includes('timed out') ||
|
|
113
|
-
error.message.includes('timeout')
|
|
114
|
-
) {
|
|
115
|
-
errorCapture.captureError(error, 'timeout', extraData);
|
|
50
|
+
if (error.name === "ProtocolValidationError" || error.message.includes("validation") || error.message.includes("protocol")) {
|
|
51
|
+
errorCapture.captureError(error, "validation", extraData);
|
|
52
|
+
} else if (error.name === "ServerTimeoutError" || error.message.includes("timed out") || error.message.includes("timeout")) {
|
|
53
|
+
errorCapture.captureError(error, "timeout", extraData);
|
|
116
54
|
} else {
|
|
117
|
-
errorCapture.captureError(error,
|
|
55
|
+
errorCapture.captureError(error, "tool_execution", extraData);
|
|
118
56
|
}
|
|
119
|
-
} else if (methodName ===
|
|
57
|
+
} else if (methodName === "resource" || methodName === "registerResource") {
|
|
120
58
|
extraData.resource_uri = handlerName;
|
|
121
|
-
errorCapture.captureError(error,
|
|
122
|
-
} else if (methodName ===
|
|
59
|
+
errorCapture.captureError(error, "resource_execution", extraData);
|
|
60
|
+
} else if (methodName === "prompt" || methodName === "registerPrompt") {
|
|
123
61
|
extraData.prompt_name = handlerName;
|
|
124
|
-
errorCapture.captureError(error,
|
|
62
|
+
errorCapture.captureError(error, "prompt_execution", extraData);
|
|
125
63
|
}
|
|
126
64
|
} catch (_captureErr) {
|
|
127
|
-
// noop
|
|
128
65
|
}
|
|
129
66
|
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Wraps tool handlers to associate them with request spans.
|
|
133
|
-
* Instruments both `tool` (legacy API) and `registerTool` (new API) if present.
|
|
134
|
-
* @param serverInstance - MCP server instance
|
|
135
|
-
*/
|
|
136
67
|
function wrapToolHandlers(serverInstance) {
|
|
137
|
-
if (typeof serverInstance.tool ===
|
|
138
|
-
if (typeof serverInstance.registerTool ===
|
|
68
|
+
if (typeof serverInstance.tool === "function") wrapMethodHandler(serverInstance, "tool");
|
|
69
|
+
if (typeof serverInstance.registerTool === "function") wrapMethodHandler(serverInstance, "registerTool");
|
|
139
70
|
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Wraps resource handlers to associate them with request spans.
|
|
143
|
-
* Instruments both `resource` (legacy API) and `registerResource` (new API) if present.
|
|
144
|
-
* @param serverInstance - MCP server instance
|
|
145
|
-
*/
|
|
146
71
|
function wrapResourceHandlers(serverInstance) {
|
|
147
|
-
if (typeof serverInstance.resource ===
|
|
148
|
-
if (typeof serverInstance.registerResource ===
|
|
72
|
+
if (typeof serverInstance.resource === "function") wrapMethodHandler(serverInstance, "resource");
|
|
73
|
+
if (typeof serverInstance.registerResource === "function") wrapMethodHandler(serverInstance, "registerResource");
|
|
149
74
|
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Wraps prompt handlers to associate them with request spans.
|
|
153
|
-
* Instruments both `prompt` (legacy API) and `registerPrompt` (new API) if present.
|
|
154
|
-
* @param serverInstance - MCP server instance
|
|
155
|
-
*/
|
|
156
75
|
function wrapPromptHandlers(serverInstance) {
|
|
157
|
-
if (typeof serverInstance.prompt ===
|
|
158
|
-
if (typeof serverInstance.registerPrompt ===
|
|
76
|
+
if (typeof serverInstance.prompt === "function") wrapMethodHandler(serverInstance, "prompt");
|
|
77
|
+
if (typeof serverInstance.registerPrompt === "function") wrapMethodHandler(serverInstance, "registerPrompt");
|
|
159
78
|
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Wraps all MCP handler types for span correlation.
|
|
163
|
-
* Supports both the legacy API (`tool`, `resource`, `prompt`) and the newer API
|
|
164
|
-
* (`registerTool`, `registerResource`, `registerPrompt`), instrumenting whichever methods are present.
|
|
165
|
-
* @param serverInstance - MCP server instance
|
|
166
|
-
*/
|
|
167
79
|
function wrapAllMCPHandlers(serverInstance) {
|
|
168
80
|
wrapToolHandlers(serverInstance);
|
|
169
81
|
wrapResourceHandlers(serverInstance);
|
|
170
82
|
wrapPromptHandlers(serverInstance);
|
|
171
83
|
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Retroactively wraps handlers on tools, resources, and prompts that were registered
|
|
175
|
-
* before `wrapMcpServerWithSentry` was called.
|
|
176
|
-
*
|
|
177
|
-
* The MCP SDK stores registered entries in private maps and invokes them via the entry's
|
|
178
|
-
* own property at call time — `executor` for tools, `readCallback` for resources, and
|
|
179
|
-
* `handler` for prompts. Replacing those properties
|
|
180
|
-
* in-place is therefore equivalent to having wrapped the original registration call.
|
|
181
|
-
*
|
|
182
|
-
* NOTE: This intentionally accesses private MCP SDK internals (`_registeredTools` etc.).
|
|
183
|
-
* The properties and their shapes are verified against @modelcontextprotocol/sdk source:
|
|
184
|
-
* https://github.com/modelcontextprotocol/typescript-sdk/blob/2c0c481cb9dbfd15c8613f765c940a5f5bace94d/packages/server/src/server/mcp.ts#L304
|
|
185
|
-
* When upgrading the MCP SDK, re-verify that these internal maps and their callable
|
|
186
|
-
* properties still exist and are invoked directly (not captured by closure at registration).
|
|
187
|
-
* All access is defensive — if a property is absent or not a function we skip silently.
|
|
188
|
-
* @internal
|
|
189
|
-
*/
|
|
190
84
|
function wrapExistingHandlers(serverInstance) {
|
|
191
|
-
const server = serverInstance
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
if (typeof tool['executor'] === 'function') {
|
|
198
|
-
tool['executor'] = createWrappedHandler(tool['executor'] , 'registerTool', name);
|
|
85
|
+
const server = serverInstance;
|
|
86
|
+
const registeredTools = server["_registeredTools"];
|
|
87
|
+
if (registeredTools && typeof registeredTools === "object") {
|
|
88
|
+
for (const [name, tool] of Object.entries(registeredTools)) {
|
|
89
|
+
if (typeof tool["executor"] === "function") {
|
|
90
|
+
tool["executor"] = createWrappedHandler(tool["executor"], "registerTool", name);
|
|
199
91
|
}
|
|
200
92
|
}
|
|
201
93
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
'registerResource',
|
|
211
|
-
name,
|
|
94
|
+
const registeredResources = server["_registeredResources"];
|
|
95
|
+
if (registeredResources && typeof registeredResources === "object") {
|
|
96
|
+
for (const [name, resource] of Object.entries(registeredResources)) {
|
|
97
|
+
if (typeof resource["readCallback"] === "function") {
|
|
98
|
+
resource["readCallback"] = createWrappedHandler(
|
|
99
|
+
resource["readCallback"],
|
|
100
|
+
"registerResource",
|
|
101
|
+
name
|
|
212
102
|
);
|
|
213
103
|
}
|
|
214
104
|
}
|
|
215
105
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const registeredResourceTemplates = server['_registeredResourceTemplates'];
|
|
219
|
-
if (registeredResourceTemplates && typeof registeredResourceTemplates === 'object') {
|
|
106
|
+
const registeredResourceTemplates = server["_registeredResourceTemplates"];
|
|
107
|
+
if (registeredResourceTemplates && typeof registeredResourceTemplates === "object") {
|
|
220
108
|
for (const [name, template] of Object.entries(
|
|
221
|
-
registeredResourceTemplates
|
|
109
|
+
registeredResourceTemplates
|
|
222
110
|
)) {
|
|
223
|
-
if (typeof template[
|
|
224
|
-
template[
|
|
225
|
-
template[
|
|
226
|
-
|
|
227
|
-
name
|
|
111
|
+
if (typeof template["readCallback"] === "function") {
|
|
112
|
+
template["readCallback"] = createWrappedHandler(
|
|
113
|
+
template["readCallback"],
|
|
114
|
+
"registerResource",
|
|
115
|
+
name
|
|
228
116
|
);
|
|
229
117
|
}
|
|
230
118
|
}
|
|
231
119
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
if (typeof prompt['handler'] === 'function') {
|
|
238
|
-
prompt['handler'] = createWrappedHandler(prompt['handler'] , 'registerPrompt', name);
|
|
120
|
+
const registeredPrompts = server["_registeredPrompts"];
|
|
121
|
+
if (registeredPrompts && typeof registeredPrompts === "object") {
|
|
122
|
+
for (const [name, prompt] of Object.entries(registeredPrompts)) {
|
|
123
|
+
if (typeof prompt["handler"] === "function") {
|
|
124
|
+
prompt["handler"] = createWrappedHandler(prompt["handler"], "registerPrompt", name);
|
|
239
125
|
}
|
|
240
126
|
}
|
|
241
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sources":["../../../../src/integrations/mcp-server/handlers.ts"],"sourcesContent":["/**\n * Handler method wrapping for MCP server instrumentation\n *\n * Provides automatic error capture and span correlation for tool, resource,\n * and prompt handlers.\n */\n\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { debug } from '../../utils/debug-logger';\nimport { fill } from '../../utils/object';\nimport { captureError } from './errorCapture';\nimport type { MCPHandler, MCPServerInstance } from './types';\n\n/**\n * Generic function to wrap MCP server method handlers\n * @internal\n * @param serverInstance - MCP server instance\n * @param methodName - Method name to wrap (tool, resource, prompt)\n */\nfunction wrapMethodHandler(serverInstance: MCPServerInstance, methodName: keyof MCPServerInstance): void {\n fill(serverInstance, methodName, originalMethod => {\n return function (this: MCPServerInstance, name: string, ...args: unknown[]) {\n const handler = args[args.length - 1];\n\n if (typeof handler !== 'function') {\n return (originalMethod as (...args: unknown[]) => unknown).call(this, name, ...args);\n }\n\n const wrappedHandler = createWrappedHandler(handler as MCPHandler, methodName, name);\n return (originalMethod as (...args: unknown[]) => unknown).call(this, name, ...args.slice(0, -1), wrappedHandler);\n };\n });\n}\n\n/**\n * Creates a wrapped handler with span correlation and error capture\n * @internal\n * @param originalHandler - Original handler function\n * @param methodName - MCP method name\n * @param handlerName - Handler identifier\n * @returns Wrapped handler function\n */\nfunction createWrappedHandler(originalHandler: MCPHandler, methodName: keyof MCPServerInstance, handlerName: string) {\n return function (this: unknown, ...handlerArgs: unknown[]): unknown {\n try {\n return createErrorCapturingHandler.call(this, originalHandler, methodName, handlerName, handlerArgs);\n } catch (error) {\n DEBUG_BUILD && debug.warn('MCP handler wrapping failed:', error);\n return originalHandler.apply(this, handlerArgs);\n }\n };\n}\n\n/**\n * Creates an error-capturing wrapper for handler execution\n * @internal\n * @param originalHandler - Original handler function\n * @param methodName - MCP method name\n * @param handlerName - Handler identifier\n * @param handlerArgs - Handler arguments\n * @param extraHandlerData - Additional handler context\n * @returns Handler execution result\n */\nfunction createErrorCapturingHandler(\n this: MCPServerInstance,\n originalHandler: MCPHandler,\n methodName: keyof MCPServerInstance,\n handlerName: string,\n handlerArgs: unknown[],\n): unknown {\n try {\n const result = originalHandler.apply(this, handlerArgs);\n\n if (result && typeof result === 'object' && typeof (result as { then?: unknown }).then === 'function') {\n return Promise.resolve(result).catch(error => {\n captureHandlerError(error, methodName, handlerName);\n throw error;\n });\n }\n\n return result;\n } catch (error) {\n captureHandlerError(error as Error, methodName, handlerName);\n throw error;\n }\n}\n\n/**\n * Captures handler execution errors based on handler type\n * @internal\n * @param error - Error to capture\n * @param methodName - MCP method name\n * @param handlerName - Handler identifier\n */\nfunction captureHandlerError(error: Error, methodName: keyof MCPServerInstance, handlerName: string): void {\n try {\n const extraData: Record<string, unknown> = {};\n\n if (methodName === 'tool' || methodName === 'registerTool') {\n extraData.tool_name = handlerName;\n\n if (\n error.name === 'ProtocolValidationError' ||\n error.message.includes('validation') ||\n error.message.includes('protocol')\n ) {\n captureError(error, 'validation', extraData);\n } else if (\n error.name === 'ServerTimeoutError' ||\n error.message.includes('timed out') ||\n error.message.includes('timeout')\n ) {\n captureError(error, 'timeout', extraData);\n } else {\n captureError(error, 'tool_execution', extraData);\n }\n } else if (methodName === 'resource' || methodName === 'registerResource') {\n extraData.resource_uri = handlerName;\n captureError(error, 'resource_execution', extraData);\n } else if (methodName === 'prompt' || methodName === 'registerPrompt') {\n extraData.prompt_name = handlerName;\n captureError(error, 'prompt_execution', extraData);\n }\n } catch (_captureErr) {\n // noop\n }\n}\n\n/**\n * Wraps tool handlers to associate them with request spans.\n * Instruments both `tool` (legacy API) and `registerTool` (new API) if present.\n * @param serverInstance - MCP server instance\n */\nexport function wrapToolHandlers(serverInstance: MCPServerInstance): void {\n if (typeof serverInstance.tool === 'function') wrapMethodHandler(serverInstance, 'tool');\n if (typeof serverInstance.registerTool === 'function') wrapMethodHandler(serverInstance, 'registerTool');\n}\n\n/**\n * Wraps resource handlers to associate them with request spans.\n * Instruments both `resource` (legacy API) and `registerResource` (new API) if present.\n * @param serverInstance - MCP server instance\n */\nexport function wrapResourceHandlers(serverInstance: MCPServerInstance): void {\n if (typeof serverInstance.resource === 'function') wrapMethodHandler(serverInstance, 'resource');\n if (typeof serverInstance.registerResource === 'function') wrapMethodHandler(serverInstance, 'registerResource');\n}\n\n/**\n * Wraps prompt handlers to associate them with request spans.\n * Instruments both `prompt` (legacy API) and `registerPrompt` (new API) if present.\n * @param serverInstance - MCP server instance\n */\nexport function wrapPromptHandlers(serverInstance: MCPServerInstance): void {\n if (typeof serverInstance.prompt === 'function') wrapMethodHandler(serverInstance, 'prompt');\n if (typeof serverInstance.registerPrompt === 'function') wrapMethodHandler(serverInstance, 'registerPrompt');\n}\n\n/**\n * Wraps all MCP handler types for span correlation.\n * Supports both the legacy API (`tool`, `resource`, `prompt`) and the newer API\n * (`registerTool`, `registerResource`, `registerPrompt`), instrumenting whichever methods are present.\n * @param serverInstance - MCP server instance\n */\nexport function wrapAllMCPHandlers(serverInstance: MCPServerInstance): void {\n wrapToolHandlers(serverInstance);\n wrapResourceHandlers(serverInstance);\n wrapPromptHandlers(serverInstance);\n}\n\n/**\n * Retroactively wraps handlers on tools, resources, and prompts that were registered\n * before `wrapMcpServerWithSentry` was called.\n *\n * The MCP SDK stores registered entries in private maps and invokes them via the entry's\n * own property at call time — `executor` for tools, `readCallback` for resources, and\n * `handler` for prompts. Replacing those properties\n * in-place is therefore equivalent to having wrapped the original registration call.\n *\n * NOTE: This intentionally accesses private MCP SDK internals (`_registeredTools` etc.).\n * The properties and their shapes are verified against @modelcontextprotocol/sdk source:\n * https://github.com/modelcontextprotocol/typescript-sdk/blob/2c0c481cb9dbfd15c8613f765c940a5f5bace94d/packages/server/src/server/mcp.ts#L304\n * When upgrading the MCP SDK, re-verify that these internal maps and their callable\n * properties still exist and are invoked directly (not captured by closure at registration).\n * All access is defensive — if a property is absent or not a function we skip silently.\n * @internal\n */\nexport function wrapExistingHandlers(serverInstance: MCPServerInstance): void {\n const server = serverInstance as unknown as Record<string, unknown>;\n\n // Tools: MCP SDK calls registeredTool.executor (generated from handler at registration time)\n const registeredTools = server['_registeredTools'];\n if (registeredTools && typeof registeredTools === 'object') {\n for (const [name, tool] of Object.entries(registeredTools as Record<string, Record<string, unknown>>)) {\n if (typeof tool['executor'] === 'function') {\n tool['executor'] = createWrappedHandler(tool['executor'] as MCPHandler, 'registerTool', name);\n }\n }\n }\n\n // Resources: MCP SDK calls registeredResource.readCallback\n const registeredResources = server['_registeredResources'];\n if (registeredResources && typeof registeredResources === 'object') {\n for (const [name, resource] of Object.entries(registeredResources as Record<string, Record<string, unknown>>)) {\n if (typeof resource['readCallback'] === 'function') {\n resource['readCallback'] = createWrappedHandler(\n resource['readCallback'] as MCPHandler,\n 'registerResource',\n name,\n );\n }\n }\n }\n\n // Resource templates: MCP SDK calls registeredResourceTemplate.readCallback\n const registeredResourceTemplates = server['_registeredResourceTemplates'];\n if (registeredResourceTemplates && typeof registeredResourceTemplates === 'object') {\n for (const [name, template] of Object.entries(\n registeredResourceTemplates as Record<string, Record<string, unknown>>,\n )) {\n if (typeof template['readCallback'] === 'function') {\n template['readCallback'] = createWrappedHandler(\n template['readCallback'] as MCPHandler,\n 'registerResource',\n name,\n );\n }\n }\n }\n\n // Prompts: MCP SDK calls registeredPrompt.handler\n const registeredPrompts = server['_registeredPrompts'];\n if (registeredPrompts && typeof registeredPrompts === 'object') {\n for (const [name, prompt] of Object.entries(registeredPrompts as Record<string, Record<string, unknown>>)) {\n if (typeof prompt['handler'] === 'function') {\n prompt['handler'] = createWrappedHandler(prompt['handler'] as MCPHandler, 'registerPrompt', name);\n }\n }\n }\n}\n"],"names":["fill","DEBUG_BUILD","debug","captureError"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB,CAAC,cAAc,EAAqB,UAAU,EAAiC;AACzG,EAAEA,WAAI,CAAC,cAAc,EAAE,UAAU,EAAE,kBAAkB;AACrD,IAAI,OAAO,WAAmC,IAAI,EAAU,GAAG,IAAI,EAAa;AAChF,MAAM,MAAM,OAAA,GAAU,IAAI,CAAC,IAAI,CAAC,MAAA,GAAS,CAAC,CAAC;;AAE3C,MAAM,IAAI,OAAO,OAAA,KAAY,UAAU,EAAE;AACzC,QAAQ,OAAO,CAAC,cAAA,GAAmD,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;AAC5F,MAAM;;AAEN,MAAM,MAAM,cAAA,GAAiB,oBAAoB,CAAC,UAAuB,UAAU,EAAE,IAAI,CAAC;AAC1F,MAAM,OAAO,CAAC,cAAA,GAAmD,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,cAAc,CAAC;AACvH,IAAI,CAAC;AACL,EAAE,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB,CAAC,eAAe,EAAc,UAAU,EAA2B,WAAW,EAAU;AACrH,EAAE,OAAO,WAAyB,GAAG,WAAW,EAAsB;AACtE,IAAI,IAAI;AACR,MAAM,OAAO,2BAA2B,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC;AAC1G,IAAI,CAAA,CAAE,OAAO,KAAK,EAAE;AACpB,MAAMC,s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AAA,KAAsB,QAAQ,EAAE;AAClE,IAAI,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAA,IAAK,MAAM,CAAC,OAAO,CAAC,iBAAA,EAA6D,EAAE;AAC/G,MAAM,IAAI,OAAO,MAAM,CAAC,SAAS,CAAA,KAAM,UAAU,EAAE;AACnD,QAAQ,MAAM,CAAC,SAAS,CAAA,GAAI,oBAAoB,CAAC,MAAM,CAAC,SAAS,CAAA,GAAiB,gBAAgB,EAAE,IAAI,CAAC;AACzG,MAAM;AACN,IAAI;AACJ,EAAE;AACF;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"handlers.js","sources":["../../../../src/integrations/mcp-server/handlers.ts"],"sourcesContent":["/**\n * Handler method wrapping for MCP server instrumentation\n *\n * Provides automatic error capture and span correlation for tool, resource,\n * and prompt handlers.\n */\n\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { debug } from '../../utils/debug-logger';\nimport { fill } from '../../utils/object';\nimport { captureError } from './errorCapture';\nimport type { MCPHandler, MCPServerInstance } from './types';\n\n/**\n * Generic function to wrap MCP server method handlers\n * @internal\n * @param serverInstance - MCP server instance\n * @param methodName - Method name to wrap (tool, resource, prompt)\n */\nfunction wrapMethodHandler(serverInstance: MCPServerInstance, methodName: keyof MCPServerInstance): void {\n fill(serverInstance, methodName, originalMethod => {\n return function (this: MCPServerInstance, name: string, ...args: unknown[]) {\n const handler = args[args.length - 1];\n\n if (typeof handler !== 'function') {\n return (originalMethod as (...args: unknown[]) => unknown).call(this, name, ...args);\n }\n\n const wrappedHandler = createWrappedHandler(handler as MCPHandler, methodName, name);\n return (originalMethod as (...args: unknown[]) => unknown).call(this, name, ...args.slice(0, -1), wrappedHandler);\n };\n });\n}\n\n/**\n * Creates a wrapped handler with span correlation and error capture\n * @internal\n * @param originalHandler - Original handler function\n * @param methodName - MCP method name\n * @param handlerName - Handler identifier\n * @returns Wrapped handler function\n */\nfunction createWrappedHandler(originalHandler: MCPHandler, methodName: keyof MCPServerInstance, handlerName: string) {\n return function (this: unknown, ...handlerArgs: unknown[]): unknown {\n try {\n return createErrorCapturingHandler.call(this, originalHandler, methodName, handlerName, handlerArgs);\n } catch (error) {\n DEBUG_BUILD && debug.warn('MCP handler wrapping failed:', error);\n return originalHandler.apply(this, handlerArgs);\n }\n };\n}\n\n/**\n * Creates an error-capturing wrapper for handler execution\n * @internal\n * @param originalHandler - Original handler function\n * @param methodName - MCP method name\n * @param handlerName - Handler identifier\n * @param handlerArgs - Handler arguments\n * @param extraHandlerData - Additional handler context\n * @returns Handler execution result\n */\nfunction createErrorCapturingHandler(\n this: MCPServerInstance,\n originalHandler: MCPHandler,\n methodName: keyof MCPServerInstance,\n handlerName: string,\n handlerArgs: unknown[],\n): unknown {\n try {\n const result = originalHandler.apply(this, handlerArgs);\n\n if (result && typeof result === 'object' && typeof (result as { then?: unknown }).then === 'function') {\n return Promise.resolve(result).catch(error => {\n captureHandlerError(error, methodName, handlerName);\n throw error;\n });\n }\n\n return result;\n } catch (error) {\n captureHandlerError(error as Error, methodName, handlerName);\n throw error;\n }\n}\n\n/**\n * Captures handler execution errors based on handler type\n * @internal\n * @param error - Error to capture\n * @param methodName - MCP method name\n * @param handlerName - Handler identifier\n */\nfunction captureHandlerError(error: Error, methodName: keyof MCPServerInstance, handlerName: string): void {\n try {\n const extraData: Record<string, unknown> = {};\n\n if (methodName === 'tool' || methodName === 'registerTool') {\n extraData.tool_name = handlerName;\n\n if (\n error.name === 'ProtocolValidationError' ||\n error.message.includes('validation') ||\n error.message.includes('protocol')\n ) {\n captureError(error, 'validation', extraData);\n } else if (\n error.name === 'ServerTimeoutError' ||\n error.message.includes('timed out') ||\n error.message.includes('timeout')\n ) {\n captureError(error, 'timeout', extraData);\n } else {\n captureError(error, 'tool_execution', extraData);\n }\n } else if (methodName === 'resource' || methodName === 'registerResource') {\n extraData.resource_uri = handlerName;\n captureError(error, 'resource_execution', extraData);\n } else if (methodName === 'prompt' || methodName === 'registerPrompt') {\n extraData.prompt_name = handlerName;\n captureError(error, 'prompt_execution', extraData);\n }\n } catch (_captureErr) {\n // noop\n }\n}\n\n/**\n * Wraps tool handlers to associate them with request spans.\n * Instruments both `tool` (legacy API) and `registerTool` (new API) if present.\n * @param serverInstance - MCP server instance\n */\nexport function wrapToolHandlers(serverInstance: MCPServerInstance): void {\n if (typeof serverInstance.tool === 'function') wrapMethodHandler(serverInstance, 'tool');\n if (typeof serverInstance.registerTool === 'function') wrapMethodHandler(serverInstance, 'registerTool');\n}\n\n/**\n * Wraps resource handlers to associate them with request spans.\n * Instruments both `resource` (legacy API) and `registerResource` (new API) if present.\n * @param serverInstance - MCP server instance\n */\nexport function wrapResourceHandlers(serverInstance: MCPServerInstance): void {\n if (typeof serverInstance.resource === 'function') wrapMethodHandler(serverInstance, 'resource');\n if (typeof serverInstance.registerResource === 'function') wrapMethodHandler(serverInstance, 'registerResource');\n}\n\n/**\n * Wraps prompt handlers to associate them with request spans.\n * Instruments both `prompt` (legacy API) and `registerPrompt` (new API) if present.\n * @param serverInstance - MCP server instance\n */\nexport function wrapPromptHandlers(serverInstance: MCPServerInstance): void {\n if (typeof serverInstance.prompt === 'function') wrapMethodHandler(serverInstance, 'prompt');\n if (typeof serverInstance.registerPrompt === 'function') wrapMethodHandler(serverInstance, 'registerPrompt');\n}\n\n/**\n * Wraps all MCP handler types for span correlation.\n * Supports both the legacy API (`tool`, `resource`, `prompt`) and the newer API\n * (`registerTool`, `registerResource`, `registerPrompt`), instrumenting whichever methods are present.\n * @param serverInstance - MCP server instance\n */\nexport function wrapAllMCPHandlers(serverInstance: MCPServerInstance): void {\n wrapToolHandlers(serverInstance);\n wrapResourceHandlers(serverInstance);\n wrapPromptHandlers(serverInstance);\n}\n\n/**\n * Retroactively wraps handlers on tools, resources, and prompts that were registered\n * before `wrapMcpServerWithSentry` was called.\n *\n * The MCP SDK stores registered entries in private maps and invokes them via the entry's\n * own property at call time — `executor` for tools, `readCallback` for resources, and\n * `handler` for prompts. Replacing those properties\n * in-place is therefore equivalent to having wrapped the original registration call.\n *\n * NOTE: This intentionally accesses private MCP SDK internals (`_registeredTools` etc.).\n * The properties and their shapes are verified against @modelcontextprotocol/sdk source:\n * https://github.com/modelcontextprotocol/typescript-sdk/blob/2c0c481cb9dbfd15c8613f765c940a5f5bace94d/packages/server/src/server/mcp.ts#L304\n * When upgrading the MCP SDK, re-verify that these internal maps and their callable\n * properties still exist and are invoked directly (not captured by closure at registration).\n * All access is defensive — if a property is absent or not a function we skip silently.\n * @internal\n */\nexport function wrapExistingHandlers(serverInstance: MCPServerInstance): void {\n const server = serverInstance as unknown as Record<string, unknown>;\n\n // Tools: MCP SDK calls registeredTool.executor (generated from handler at registration time)\n const registeredTools = server['_registeredTools'];\n if (registeredTools && typeof registeredTools === 'object') {\n for (const [name, tool] of Object.entries(registeredTools as Record<string, Record<string, unknown>>)) {\n if (typeof tool['executor'] === 'function') {\n tool['executor'] = createWrappedHandler(tool['executor'] as MCPHandler, 'registerTool', name);\n }\n }\n }\n\n // Resources: MCP SDK calls registeredResource.readCallback\n const registeredResources = server['_registeredResources'];\n if (registeredResources && typeof registeredResources === 'object') {\n for (const [name, resource] of Object.entries(registeredResources as Record<string, Record<string, unknown>>)) {\n if (typeof resource['readCallback'] === 'function') {\n resource['readCallback'] = createWrappedHandler(\n resource['readCallback'] as MCPHandler,\n 'registerResource',\n name,\n );\n }\n }\n }\n\n // Resource templates: MCP SDK calls registeredResourceTemplate.readCallback\n const registeredResourceTemplates = server['_registeredResourceTemplates'];\n if (registeredResourceTemplates && typeof registeredResourceTemplates === 'object') {\n for (const [name, template] of Object.entries(\n registeredResourceTemplates as Record<string, Record<string, unknown>>,\n )) {\n if (typeof template['readCallback'] === 'function') {\n template['readCallback'] = createWrappedHandler(\n template['readCallback'] as MCPHandler,\n 'registerResource',\n name,\n );\n }\n }\n }\n\n // Prompts: MCP SDK calls registeredPrompt.handler\n const registeredPrompts = server['_registeredPrompts'];\n if (registeredPrompts && typeof registeredPrompts === 'object') {\n for (const [name, prompt] of Object.entries(registeredPrompts as Record<string, Record<string, unknown>>)) {\n if (typeof prompt['handler'] === 'function') {\n prompt['handler'] = createWrappedHandler(prompt['handler'] as MCPHandler, 'registerPrompt', name);\n }\n }\n }\n}\n"],"names":["fill","DEBUG_BUILD","debug","captureError"],"mappings":";;;;;;;AAmBA,SAAS,iBAAA,CAAkB,gBAAmC,UAAA,EAA2C;AACvG,EAAAA,WAAA,CAAK,cAAA,EAAgB,YAAY,CAAA,cAAA,KAAkB;AACjD,IAAA,OAAO,SAAmC,SAAiB,IAAA,EAAiB;AAC1E,MAAA,MAAM,OAAA,GAAU,IAAA,CAAK,IAAA,CAAK,MAAA,GAAS,CAAC,CAAA;AAEpC,MAAA,IAAI,OAAO,YAAY,UAAA,EAAY;AACjC,QAAA,OAAQ,cAAA,CAAmD,IAAA,CAAK,IAAA,EAAM,IAAA,EAAM,GAAG,IAAI,CAAA;AAAA,MACrF;AAEA,MAAA,MAAM,cAAA,GAAiB,oBAAA,CAAqB,OAAA,EAAuB,UAAA,EAAY,IAAI,CAAA;AACnF,MAAA,OAAQ,cAAA,CAAmD,IAAA,CAAK,IAAA,EAAM,IAAA,EAAM,GAAG,KAAK,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA,EAAG,cAAc,CAAA;AAAA,IAClH,CAAA;AAAA,EACF,CAAC,CAAA;AACH;AAUA,SAAS,oBAAA,CAAqB,eAAA,EAA6B,UAAA,EAAqC,WAAA,EAAqB;AACnH,EAAA,OAAO,YAA4B,WAAA,EAAiC;AAClE,IAAA,IAAI;AACF,MAAA,OAAO,4BAA4B,IAAA,CAAK,IAAA,EAAM,eAAA,EAAiB,UAAA,EAAY,aAAa,WAAW,CAAA;AAAA,IACrG,SAAS,KAAA,EAAO;AACd,MAAAC,sBAAA,IAAeC,iBAAA,CAAM,IAAA,CAAK,8BAAA,EAAgC,KAAK,CAAA;AAC/D,MAAA,OAAO,eAAA,CAAgB,KAAA,CAAM,IAAA,EAAM,WAAW,CAAA;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BAAA,IAA+B,OAAO,2BAAA,KAAgC,QAAA,EAAU;AAClF,IAAA,KAAA,MAAW,CAAC,IAAA,EAAM,QAAQ,CAAA,IAAK,MAAA,CAAO,OAAA;AAAA,MACpC;AAAA,KACF,EAAG;AACD,MAAA,IAAI,OAAO,QAAA,CAAS,cAAc,CAAA,KAAM,UAAA,EAAY;AAClD,QAAA,QAAA,CAAS,cAAc,CAAA,GAAI,oBAAA;AAAA,UACzB,SAAS,cAAc,CAAA;AAAA,UACvB,kBAAA;AAAA,UACA;AAAA,SACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAGA,EAAA,MAAM,iBAAA,GAAoB,OAAO,oBAAoB,CAAA;AACrD,EAAA,IAAI,iBAAA,IAAqB,OAAO,iBAAA,KAAsB,QAAA,EAAU;AAC9D,IAAA,KAAA,MAAW,CAAC,IAAA,EAAM,MAAM,KAAK,MAAA,CAAO,OAAA,CAAQ,iBAA4D,CAAA,EAAG;AACzG,MAAA,IAAI,OAAO,MAAA,CAAO,SAAS,CAAA,KAAM,UAAA,EAAY;AAC3C,QAAA,MAAA,CAAO,SAAS,CAAA,GAAI,oBAAA,CAAqB,OAAO,SAAS,CAAA,EAAiB,kBAAkB,IAAI,CAAA;AAAA,MAClG;AAAA,IACF;AAAA,EACF;AACF;;;;;;;;"}
|
|
@@ -6,90 +6,37 @@ const handlers = require('./handlers.js');
|
|
|
6
6
|
const transport = require('./transport.js');
|
|
7
7
|
const validation = require('./validation.js');
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
* Tracks wrapped MCP server instances to prevent double-wrapping
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
const wrappedMcpServerInstances = new WeakSet();
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Wraps a MCP Server instance from the `@modelcontextprotocol/sdk` package with Sentry instrumentation.
|
|
17
|
-
*
|
|
18
|
-
* Compatible with versions `^1.9.0` of the `@modelcontextprotocol/sdk` package (legacy `tool`/`resource`/`prompt` API)
|
|
19
|
-
* and versions that expose the newer `registerTool`/`registerResource`/`registerPrompt` API (introduced in 1.x, sole API in 2.x).
|
|
20
|
-
* Automatically instruments transport methods and handler functions for comprehensive monitoring.
|
|
21
|
-
*
|
|
22
|
-
* Both call orderings are supported: wrapping before or after registering tools, resources,
|
|
23
|
-
* and prompts. Sentry patches the registration methods for future handlers and retroactively
|
|
24
|
-
* wraps any already-registered ones. Wrapping at construction time is recommended by
|
|
25
|
-
* convention (consistent with other SDK integrations), but is not required.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```typescript
|
|
29
|
-
* import * as Sentry from '@sentry/core';
|
|
30
|
-
* import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
31
|
-
* import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
32
|
-
*
|
|
33
|
-
* // Wrap first, then register tools — this is the correct order
|
|
34
|
-
* const server = Sentry.wrapMcpServerWithSentry(
|
|
35
|
-
* new McpServer({ name: "my-server", version: "1.0.0" })
|
|
36
|
-
* );
|
|
37
|
-
*
|
|
38
|
-
* server.registerTool('my-tool', schema, handler);
|
|
39
|
-
*
|
|
40
|
-
* // Explicitly control input/output capture
|
|
41
|
-
* const server = Sentry.wrapMcpServerWithSentry(
|
|
42
|
-
* new McpServer({ name: "my-server", version: "1.0.0" }),
|
|
43
|
-
* { recordInputs: true, recordOutputs: false }
|
|
44
|
-
* );
|
|
45
|
-
*
|
|
46
|
-
* const transport = new StreamableHTTPServerTransport();
|
|
47
|
-
* await server.connect(transport);
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* @param mcpServerInstance - MCP server instance to instrument
|
|
51
|
-
* @param options - Optional configuration for recording inputs and outputs
|
|
52
|
-
* @returns Instrumented server instance (same reference)
|
|
53
|
-
*/
|
|
9
|
+
const wrappedMcpServerInstances = /* @__PURE__ */ new WeakSet();
|
|
54
10
|
function wrapMcpServerWithSentry(mcpServerInstance, options) {
|
|
55
11
|
if (wrappedMcpServerInstances.has(mcpServerInstance)) {
|
|
56
12
|
return mcpServerInstance;
|
|
57
13
|
}
|
|
58
|
-
|
|
59
14
|
if (!validation.validateMcpServerInstance(mcpServerInstance)) {
|
|
60
15
|
return mcpServerInstance;
|
|
61
16
|
}
|
|
62
|
-
|
|
63
|
-
const serverInstance = mcpServerInstance ;
|
|
17
|
+
const serverInstance = mcpServerInstance;
|
|
64
18
|
const client = currentScopes.getClient();
|
|
65
19
|
const sendDefaultPii = Boolean(client?.getOptions().sendDefaultPii);
|
|
66
|
-
|
|
67
20
|
const resolvedOptions = {
|
|
68
21
|
recordInputs: options?.recordInputs ?? sendDefaultPii,
|
|
69
|
-
recordOutputs: options?.recordOutputs ?? sendDefaultPii
|
|
22
|
+
recordOutputs: options?.recordOutputs ?? sendDefaultPii
|
|
70
23
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const result = await (originalConnect ).call(
|
|
24
|
+
object.fill(serverInstance, "connect", (originalConnect) => {
|
|
25
|
+
return async function(transport$1, ...restArgs) {
|
|
26
|
+
const result = await originalConnect.call(
|
|
75
27
|
this,
|
|
76
28
|
transport$1,
|
|
77
|
-
...restArgs
|
|
29
|
+
...restArgs
|
|
78
30
|
);
|
|
79
|
-
|
|
80
31
|
transport.wrapTransportOnMessage(transport$1, resolvedOptions);
|
|
81
32
|
transport.wrapTransportSend(transport$1, resolvedOptions);
|
|
82
33
|
transport.wrapTransportOnClose(transport$1);
|
|
83
34
|
transport.wrapTransportError(transport$1);
|
|
84
|
-
|
|
85
35
|
return result;
|
|
86
36
|
};
|
|
87
37
|
});
|
|
88
|
-
|
|
89
38
|
handlers.wrapAllMCPHandlers(serverInstance);
|
|
90
|
-
|
|
91
39
|
handlers.wrapExistingHandlers(serverInstance);
|
|
92
|
-
|
|
93
40
|
wrappedMcpServerInstances.add(mcpServerInstance);
|
|
94
41
|
return mcpServerInstance;
|
|
95
42
|
}
|