@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":"spans.js","sources":["../../../../src/integrations/mcp-server/spans.ts"],"sourcesContent":["/**\n * Span creation and management functions for MCP server instrumentation\n *\n * Provides unified span creation following OpenTelemetry MCP semantic conventions and our opinitionated take on MCP.\n * Handles both request and notification spans with attribute extraction.\n */\n\nimport { getClient } from '../../currentScopes';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '../../semanticAttributes';\nimport { startSpan } from '../../tracing';\nimport { buildTransportAttributes, buildTypeSpecificAttributes } from './attributeExtraction';\nimport {\n MCP_FUNCTION_ORIGIN_VALUE,\n MCP_METHOD_NAME_ATTRIBUTE,\n MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE,\n MCP_NOTIFICATION_ORIGIN_VALUE,\n MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE,\n MCP_ROUTE_SOURCE_VALUE,\n MCP_SERVER_OP_VALUE,\n} from './attributes';\nimport { extractTargetInfo } from './methodConfig';\nimport { filterMcpPiiFromSpanData } from './piiFiltering';\nimport type {\n ExtraHandlerData,\n JsonRpcNotification,\n JsonRpcRequest,\n McpSpanConfig,\n MCPTransport,\n ResolvedMcpOptions,\n} from './types';\n\n/**\n * Creates a span name based on the method and target\n * @internal\n * @param method - MCP method name\n * @param target - Optional target identifier\n * @returns Formatted span name\n */\nfunction createSpanName(method: string, target?: string): string {\n return target ? `${method} ${target}` : method;\n}\n\n/**\n * Build Sentry-specific attributes based on span type\n * @internal\n * @param type - Span type configuration\n * @returns Sentry-specific attributes\n */\nfunction buildSentryAttributes(type: McpSpanConfig['type']): Record<string, string> {\n let op: string;\n let origin: string;\n\n switch (type) {\n case 'request':\n op = MCP_SERVER_OP_VALUE;\n origin = MCP_FUNCTION_ORIGIN_VALUE;\n break;\n case 'notification-incoming':\n op = MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE;\n origin = MCP_NOTIFICATION_ORIGIN_VALUE;\n break;\n case 'notification-outgoing':\n op = MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE;\n origin = MCP_NOTIFICATION_ORIGIN_VALUE;\n break;\n }\n\n return {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin,\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: MCP_ROUTE_SOURCE_VALUE,\n };\n}\n\n/**\n * Unified builder for creating MCP spans\n * @internal\n * @param config - Span configuration\n * @returns Created span\n */\nfunction createMcpSpan(config: McpSpanConfig): unknown {\n const { type, message, transport, extra, callback, options } = config;\n const { method } = message;\n const params = message.params;\n\n // Determine span name based on type and OTEL conventions\n let spanName: string;\n if (type === 'request') {\n const targetInfo = extractTargetInfo(method, params || {});\n spanName = createSpanName(method, targetInfo.target);\n } else {\n // For notifications, use method name directly per OpenTelemetry conventions\n spanName = method;\n }\n\n const rawAttributes: Record<string, string | number> = {\n ...buildTransportAttributes(transport, extra),\n [MCP_METHOD_NAME_ATTRIBUTE]: method,\n ...buildTypeSpecificAttributes(type, message, params, options?.recordInputs),\n ...buildSentryAttributes(type),\n };\n\n const client = getClient();\n const sendDefaultPii = Boolean(client?.getOptions().sendDefaultPii);\n const attributes = filterMcpPiiFromSpanData(rawAttributes, sendDefaultPii) as Record<string, string | number>;\n\n return startSpan(\n {\n name: spanName,\n forceTransaction: true,\n attributes,\n },\n callback,\n );\n}\n\n/**\n * Creates a span for incoming MCP notifications\n * @param jsonRpcMessage - Notification message\n * @param transport - MCP transport instance\n * @param extra - Extra handler data\n * @param options - Resolved MCP options\n * @param callback - Span execution callback\n * @returns Span execution result\n */\nexport function createMcpNotificationSpan(\n jsonRpcMessage: JsonRpcNotification,\n transport: MCPTransport,\n extra: ExtraHandlerData,\n options: ResolvedMcpOptions,\n callback: () => unknown,\n): unknown {\n return createMcpSpan({\n type: 'notification-incoming',\n message: jsonRpcMessage,\n transport,\n extra,\n callback,\n options,\n });\n}\n\n/**\n * Creates a span for outgoing MCP notifications\n * @param jsonRpcMessage - Notification message\n * @param transport - MCP transport instance\n * @param options - Resolved MCP options\n * @param callback - Span execution callback\n * @returns Span execution result\n */\nexport function createMcpOutgoingNotificationSpan(\n jsonRpcMessage: JsonRpcNotification,\n transport: MCPTransport,\n options: ResolvedMcpOptions,\n callback: () => unknown,\n): unknown {\n return createMcpSpan({\n type: 'notification-outgoing',\n message: jsonRpcMessage,\n transport,\n options,\n callback,\n });\n}\n\n/**\n * Builds span configuration for MCP server requests\n * @param jsonRpcMessage - Request message\n * @param transport - MCP transport instance\n * @param extra - Optional extra handler data\n * @param options - Resolved MCP options\n * @returns Span configuration object\n */\nexport function buildMcpServerSpanConfig(\n jsonRpcMessage: JsonRpcRequest,\n transport: MCPTransport,\n extra?: ExtraHandlerData,\n options?: ResolvedMcpOptions,\n): {\n name: string;\n op: string;\n forceTransaction: boolean;\n attributes: Record<string, string | number>;\n} {\n const { method } = jsonRpcMessage;\n const params = jsonRpcMessage.params;\n\n const targetInfo = extractTargetInfo(method, params || {});\n const spanName = createSpanName(method, targetInfo.target);\n\n const rawAttributes: Record<string, string | number> = {\n ...buildTransportAttributes(transport, extra),\n [MCP_METHOD_NAME_ATTRIBUTE]: method,\n ...buildTypeSpecificAttributes('request', jsonRpcMessage, params, options?.recordInputs),\n ...buildSentryAttributes('request'),\n };\n\n const client = getClient();\n const sendDefaultPii = Boolean(client?.getOptions().sendDefaultPii);\n const attributes = filterMcpPiiFromSpanData(rawAttributes, sendDefaultPii) as Record<string, string | number>;\n\n return {\n name: spanName,\n op: MCP_SERVER_OP_VALUE,\n forceTransaction: true,\n attributes,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"spans.js","sources":["../../../../src/integrations/mcp-server/spans.ts"],"sourcesContent":["/**\n * Span creation and management functions for MCP server instrumentation\n *\n * Provides unified span creation following OpenTelemetry MCP semantic conventions and our opinitionated take on MCP.\n * Handles both request and notification spans with attribute extraction.\n */\n\nimport { getClient } from '../../currentScopes';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '../../semanticAttributes';\nimport { startSpan } from '../../tracing';\nimport { buildTransportAttributes, buildTypeSpecificAttributes } from './attributeExtraction';\nimport {\n MCP_FUNCTION_ORIGIN_VALUE,\n MCP_METHOD_NAME_ATTRIBUTE,\n MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE,\n MCP_NOTIFICATION_ORIGIN_VALUE,\n MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE,\n MCP_ROUTE_SOURCE_VALUE,\n MCP_SERVER_OP_VALUE,\n} from './attributes';\nimport { extractTargetInfo } from './methodConfig';\nimport { filterMcpPiiFromSpanData } from './piiFiltering';\nimport type {\n ExtraHandlerData,\n JsonRpcNotification,\n JsonRpcRequest,\n McpSpanConfig,\n MCPTransport,\n ResolvedMcpOptions,\n} from './types';\n\n/**\n * Creates a span name based on the method and target\n * @internal\n * @param method - MCP method name\n * @param target - Optional target identifier\n * @returns Formatted span name\n */\nfunction createSpanName(method: string, target?: string): string {\n return target ? `${method} ${target}` : method;\n}\n\n/**\n * Build Sentry-specific attributes based on span type\n * @internal\n * @param type - Span type configuration\n * @returns Sentry-specific attributes\n */\nfunction buildSentryAttributes(type: McpSpanConfig['type']): Record<string, string> {\n let op: string;\n let origin: string;\n\n switch (type) {\n case 'request':\n op = MCP_SERVER_OP_VALUE;\n origin = MCP_FUNCTION_ORIGIN_VALUE;\n break;\n case 'notification-incoming':\n op = MCP_NOTIFICATION_CLIENT_TO_SERVER_OP_VALUE;\n origin = MCP_NOTIFICATION_ORIGIN_VALUE;\n break;\n case 'notification-outgoing':\n op = MCP_NOTIFICATION_SERVER_TO_CLIENT_OP_VALUE;\n origin = MCP_NOTIFICATION_ORIGIN_VALUE;\n break;\n }\n\n return {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin,\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: MCP_ROUTE_SOURCE_VALUE,\n };\n}\n\n/**\n * Unified builder for creating MCP spans\n * @internal\n * @param config - Span configuration\n * @returns Created span\n */\nfunction createMcpSpan(config: McpSpanConfig): unknown {\n const { type, message, transport, extra, callback, options } = config;\n const { method } = message;\n const params = message.params;\n\n // Determine span name based on type and OTEL conventions\n let spanName: string;\n if (type === 'request') {\n const targetInfo = extractTargetInfo(method, params || {});\n spanName = createSpanName(method, targetInfo.target);\n } else {\n // For notifications, use method name directly per OpenTelemetry conventions\n spanName = method;\n }\n\n const rawAttributes: Record<string, string | number> = {\n ...buildTransportAttributes(transport, extra),\n [MCP_METHOD_NAME_ATTRIBUTE]: method,\n ...buildTypeSpecificAttributes(type, message, params, options?.recordInputs),\n ...buildSentryAttributes(type),\n };\n\n const client = getClient();\n const sendDefaultPii = Boolean(client?.getOptions().sendDefaultPii);\n const attributes = filterMcpPiiFromSpanData(rawAttributes, sendDefaultPii) as Record<string, string | number>;\n\n return startSpan(\n {\n name: spanName,\n forceTransaction: true,\n attributes,\n },\n callback,\n );\n}\n\n/**\n * Creates a span for incoming MCP notifications\n * @param jsonRpcMessage - Notification message\n * @param transport - MCP transport instance\n * @param extra - Extra handler data\n * @param options - Resolved MCP options\n * @param callback - Span execution callback\n * @returns Span execution result\n */\nexport function createMcpNotificationSpan(\n jsonRpcMessage: JsonRpcNotification,\n transport: MCPTransport,\n extra: ExtraHandlerData,\n options: ResolvedMcpOptions,\n callback: () => unknown,\n): unknown {\n return createMcpSpan({\n type: 'notification-incoming',\n message: jsonRpcMessage,\n transport,\n extra,\n callback,\n options,\n });\n}\n\n/**\n * Creates a span for outgoing MCP notifications\n * @param jsonRpcMessage - Notification message\n * @param transport - MCP transport instance\n * @param options - Resolved MCP options\n * @param callback - Span execution callback\n * @returns Span execution result\n */\nexport function createMcpOutgoingNotificationSpan(\n jsonRpcMessage: JsonRpcNotification,\n transport: MCPTransport,\n options: ResolvedMcpOptions,\n callback: () => unknown,\n): unknown {\n return createMcpSpan({\n type: 'notification-outgoing',\n message: jsonRpcMessage,\n transport,\n options,\n callback,\n });\n}\n\n/**\n * Builds span configuration for MCP server requests\n * @param jsonRpcMessage - Request message\n * @param transport - MCP transport instance\n * @param extra - Optional extra handler data\n * @param options - Resolved MCP options\n * @returns Span configuration object\n */\nexport function buildMcpServerSpanConfig(\n jsonRpcMessage: JsonRpcRequest,\n transport: MCPTransport,\n extra?: ExtraHandlerData,\n options?: ResolvedMcpOptions,\n): {\n name: string;\n op: string;\n forceTransaction: boolean;\n attributes: Record<string, string | number>;\n} {\n const { method } = jsonRpcMessage;\n const params = jsonRpcMessage.params;\n\n const targetInfo = extractTargetInfo(method, params || {});\n const spanName = createSpanName(method, targetInfo.target);\n\n const rawAttributes: Record<string, string | number> = {\n ...buildTransportAttributes(transport, extra),\n [MCP_METHOD_NAME_ATTRIBUTE]: method,\n ...buildTypeSpecificAttributes('request', jsonRpcMessage, params, options?.recordInputs),\n ...buildSentryAttributes('request'),\n };\n\n const client = getClient();\n const sendDefaultPii = Boolean(client?.getOptions().sendDefaultPii);\n const attributes = filterMcpPiiFromSpanData(rawAttributes, sendDefaultPii) as Record<string, string | number>;\n\n return {\n name: spanName,\n op: MCP_SERVER_OP_VALUE,\n forceTransaction: true,\n attributes,\n };\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -9,187 +9,119 @@ import { storeSessionDataForTransport, updateSessionDataForTransport, cleanupSes
|
|
|
9
9
|
import { buildMcpServerSpanConfig, createMcpNotificationSpan, createMcpOutgoingNotificationSpan } from './spans.js';
|
|
10
10
|
import { isJsonRpcRequest, isJsonRpcNotification, isJsonRpcResponse, isValidContentItem } from './validation.js';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Transport layer instrumentation for MCP server
|
|
14
|
-
*
|
|
15
|
-
* Handles message interception and response correlation.
|
|
16
|
-
* @see https://modelcontextprotocol.io/specification/2025-06-18/basic/transports
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Wraps transport.onmessage to create spans for incoming messages.
|
|
22
|
-
* For "initialize" requests, extracts and stores client info and protocol version
|
|
23
|
-
* in the session data for the transport.
|
|
24
|
-
* @param transport - MCP transport instance to wrap
|
|
25
|
-
* @param options - Resolved MCP options
|
|
26
|
-
*/
|
|
27
12
|
function wrapTransportOnMessage(transport, options) {
|
|
28
13
|
if (transport.onmessage) {
|
|
29
|
-
fill(transport,
|
|
30
|
-
return function
|
|
14
|
+
fill(transport, "onmessage", (originalOnMessage) => {
|
|
15
|
+
return function(message, extra) {
|
|
31
16
|
if (isJsonRpcRequest(message)) {
|
|
32
|
-
const isInitialize = message.method ===
|
|
17
|
+
const isInitialize = message.method === "initialize";
|
|
33
18
|
let initSessionData;
|
|
34
|
-
|
|
35
19
|
if (isInitialize) {
|
|
36
20
|
try {
|
|
37
21
|
initSessionData = extractSessionDataFromInitializeRequest(message);
|
|
38
22
|
storeSessionDataForTransport(transport, initSessionData);
|
|
39
23
|
} catch {
|
|
40
|
-
// noop
|
|
41
24
|
}
|
|
42
25
|
}
|
|
43
|
-
|
|
44
26
|
const isolationScope = getIsolationScope().clone();
|
|
45
|
-
|
|
46
27
|
return withIsolationScope(isolationScope, () => {
|
|
47
|
-
const spanConfig = buildMcpServerSpanConfig(message, transport, extra
|
|
28
|
+
const spanConfig = buildMcpServerSpanConfig(message, transport, extra, options);
|
|
48
29
|
const span = startInactiveSpan(spanConfig);
|
|
49
|
-
|
|
50
|
-
// For initialize requests, add client info directly to span (works even for stateless transports)
|
|
51
30
|
if (isInitialize && initSessionData) {
|
|
52
31
|
span.setAttributes({
|
|
53
32
|
...buildClientAttributesFromInfo(initSessionData.clientInfo),
|
|
54
|
-
...
|
|
55
|
-
[MCP_PROTOCOL_VERSION_ATTRIBUTE]: initSessionData.protocolVersion
|
|
56
|
-
}
|
|
33
|
+
...initSessionData.protocolVersion && {
|
|
34
|
+
[MCP_PROTOCOL_VERSION_ATTRIBUTE]: initSessionData.protocolVersion
|
|
35
|
+
}
|
|
57
36
|
});
|
|
58
37
|
}
|
|
59
|
-
|
|
60
38
|
storeSpanForRequest(transport, message.id, span, message.method);
|
|
61
|
-
|
|
62
39
|
return withActiveSpan(span, () => {
|
|
63
|
-
return
|
|
40
|
+
return originalOnMessage.call(this, message, extra);
|
|
64
41
|
});
|
|
65
42
|
});
|
|
66
43
|
}
|
|
67
|
-
|
|
68
44
|
if (isJsonRpcNotification(message)) {
|
|
69
|
-
return createMcpNotificationSpan(message, transport, extra
|
|
70
|
-
return
|
|
45
|
+
return createMcpNotificationSpan(message, transport, extra, options, () => {
|
|
46
|
+
return originalOnMessage.call(this, message, extra);
|
|
71
47
|
});
|
|
72
48
|
}
|
|
73
|
-
|
|
74
|
-
return (originalOnMessage ).call(this, message, extra);
|
|
49
|
+
return originalOnMessage.call(this, message, extra);
|
|
75
50
|
};
|
|
76
51
|
});
|
|
77
52
|
}
|
|
78
53
|
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Wraps transport.send to handle outgoing messages and response correlation.
|
|
82
|
-
* For "initialize" responses, extracts and stores protocol version and server info
|
|
83
|
-
* in the session data for the transport.
|
|
84
|
-
* @param transport - MCP transport instance to wrap
|
|
85
|
-
* @param options - Resolved MCP options
|
|
86
|
-
*/
|
|
87
54
|
function wrapTransportSend(transport, options) {
|
|
88
55
|
if (transport.send) {
|
|
89
|
-
fill(transport,
|
|
90
|
-
return async function
|
|
56
|
+
fill(transport, "send", (originalSend) => {
|
|
57
|
+
return async function(...args) {
|
|
91
58
|
const [message] = args;
|
|
92
|
-
|
|
93
59
|
if (isJsonRpcNotification(message)) {
|
|
94
60
|
return createMcpOutgoingNotificationSpan(message, transport, options, () => {
|
|
95
|
-
return
|
|
61
|
+
return originalSend.call(this, ...args);
|
|
96
62
|
});
|
|
97
63
|
}
|
|
98
|
-
|
|
99
64
|
if (isJsonRpcResponse(message)) {
|
|
100
|
-
if (message.id !== null && message.id !==
|
|
65
|
+
if (message.id !== null && message.id !== void 0) {
|
|
101
66
|
if (message.error) {
|
|
102
67
|
captureJsonRpcErrorResponse(message.error);
|
|
103
68
|
}
|
|
104
|
-
|
|
105
69
|
if (isValidContentItem(message.result)) {
|
|
106
70
|
if (message.result.protocolVersion || message.result.serverInfo) {
|
|
107
71
|
try {
|
|
108
72
|
const serverData = extractSessionDataFromInitializeResponse(message.result);
|
|
109
73
|
updateSessionDataForTransport(transport, serverData);
|
|
110
74
|
} catch {
|
|
111
|
-
// noop
|
|
112
75
|
}
|
|
113
76
|
}
|
|
114
77
|
}
|
|
115
|
-
|
|
116
78
|
completeSpanWithResults(transport, message.id, message.result, options, !!message.error);
|
|
117
79
|
}
|
|
118
80
|
}
|
|
119
|
-
|
|
120
|
-
return (originalSend ).call(this, ...args);
|
|
81
|
+
return originalSend.call(this, ...args);
|
|
121
82
|
};
|
|
122
83
|
});
|
|
123
84
|
}
|
|
124
85
|
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Wraps transport.onclose to clean up pending spans for this transport only
|
|
128
|
-
* @param transport - MCP transport instance to wrap
|
|
129
|
-
*/
|
|
130
86
|
function wrapTransportOnClose(transport) {
|
|
131
87
|
if (transport.onclose) {
|
|
132
|
-
fill(transport,
|
|
133
|
-
return function
|
|
88
|
+
fill(transport, "onclose", (originalOnClose) => {
|
|
89
|
+
return function(...args) {
|
|
134
90
|
cleanupPendingSpansForTransport(transport);
|
|
135
91
|
cleanupSessionDataForTransport(transport);
|
|
136
|
-
return
|
|
92
|
+
return originalOnClose.call(this, ...args);
|
|
137
93
|
};
|
|
138
94
|
});
|
|
139
95
|
}
|
|
140
96
|
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Wraps transport error handlers to capture connection errors
|
|
144
|
-
* @param transport - MCP transport instance to wrap
|
|
145
|
-
*/
|
|
146
97
|
function wrapTransportError(transport) {
|
|
147
98
|
if (transport.onerror) {
|
|
148
|
-
fill(transport,
|
|
149
|
-
return function
|
|
99
|
+
fill(transport, "onerror", (originalOnError) => {
|
|
100
|
+
return function(error) {
|
|
150
101
|
captureTransportError(error);
|
|
151
102
|
return originalOnError.call(this, error);
|
|
152
103
|
};
|
|
153
104
|
});
|
|
154
105
|
}
|
|
155
106
|
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Captures JSON-RPC error responses for server-side errors.
|
|
159
|
-
* @see https://www.jsonrpc.org/specification#error_object
|
|
160
|
-
* @internal
|
|
161
|
-
* @param errorResponse - JSON-RPC error response
|
|
162
|
-
*/
|
|
163
107
|
function captureJsonRpcErrorResponse(errorResponse) {
|
|
164
108
|
try {
|
|
165
|
-
if (errorResponse && typeof errorResponse ===
|
|
166
|
-
const jsonRpcError = errorResponse
|
|
167
|
-
|
|
168
|
-
const isServerError =
|
|
169
|
-
jsonRpcError.code === -32603 || (jsonRpcError.code >= -32099 && jsonRpcError.code <= -32000);
|
|
170
|
-
|
|
109
|
+
if (errorResponse && typeof errorResponse === "object" && "code" in errorResponse && "message" in errorResponse) {
|
|
110
|
+
const jsonRpcError = errorResponse;
|
|
111
|
+
const isServerError = jsonRpcError.code === -32603 || jsonRpcError.code >= -32099 && jsonRpcError.code <= -32e3;
|
|
171
112
|
if (isServerError) {
|
|
172
113
|
const error = new Error(jsonRpcError.message);
|
|
173
114
|
error.name = `JsonRpcError_${jsonRpcError.code}`;
|
|
174
|
-
|
|
175
|
-
captureError(error, 'protocol');
|
|
115
|
+
captureError(error, "protocol");
|
|
176
116
|
}
|
|
177
117
|
}
|
|
178
118
|
} catch {
|
|
179
|
-
// noop
|
|
180
119
|
}
|
|
181
120
|
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Captures transport connection errors
|
|
185
|
-
* @internal
|
|
186
|
-
* @param error - Transport error
|
|
187
|
-
*/
|
|
188
121
|
function captureTransportError(error) {
|
|
189
122
|
try {
|
|
190
|
-
captureError(error,
|
|
123
|
+
captureError(error, "transport");
|
|
191
124
|
} catch {
|
|
192
|
-
// noop
|
|
193
125
|
}
|
|
194
126
|
}
|
|
195
127
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sources":["../../../../src/integrations/mcp-server/transport.ts"],"sourcesContent":["/**\n * Transport layer instrumentation for MCP server\n *\n * Handles message interception and response correlation.\n * @see https://modelcontextprotocol.io/specification/2025-06-18/basic/transports\n */\n\nimport { getIsolationScope, withIsolationScope } from '../../currentScopes';\nimport { startInactiveSpan, withActiveSpan } from '../../tracing';\nimport { fill } from '../../utils/object';\nimport { MCP_PROTOCOL_VERSION_ATTRIBUTE } from './attributes';\nimport { cleanupPendingSpansForTransport, completeSpanWithResults, storeSpanForRequest } from './correlation';\nimport { captureError } from './errorCapture';\nimport {\n buildClientAttributesFromInfo,\n extractSessionDataFromInitializeRequest,\n extractSessionDataFromInitializeResponse,\n} from './sessionExtraction';\nimport {\n cleanupSessionDataForTransport,\n storeSessionDataForTransport,\n updateSessionDataForTransport,\n} from './sessionManagement';\nimport { buildMcpServerSpanConfig, createMcpNotificationSpan, createMcpOutgoingNotificationSpan } from './spans';\nimport type { ExtraHandlerData, MCPTransport, ResolvedMcpOptions, SessionData } from './types';\nimport { isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isValidContentItem } from './validation';\n\n/**\n * Wraps transport.onmessage to create spans for incoming messages.\n * For \"initialize\" requests, extracts and stores client info and protocol version\n * in the session data for the transport.\n * @param transport - MCP transport instance to wrap\n * @param options - Resolved MCP options\n */\nexport function wrapTransportOnMessage(transport: MCPTransport, options: ResolvedMcpOptions): void {\n if (transport.onmessage) {\n fill(transport, 'onmessage', originalOnMessage => {\n return function (this: MCPTransport, message: unknown, extra?: unknown) {\n if (isJsonRpcRequest(message)) {\n const isInitialize = message.method === 'initialize';\n let initSessionData: SessionData | undefined;\n\n if (isInitialize) {\n try {\n initSessionData = extractSessionDataFromInitializeRequest(message);\n storeSessionDataForTransport(transport, initSessionData);\n } catch {\n // noop\n }\n }\n\n const isolationScope = getIsolationScope().clone();\n\n return withIsolationScope(isolationScope, () => {\n const spanConfig = buildMcpServerSpanConfig(message, transport, extra as ExtraHandlerData, options);\n const span = startInactiveSpan(spanConfig);\n\n // For initialize requests, add client info directly to span (works even for stateless transports)\n if (isInitialize && initSessionData) {\n span.setAttributes({\n ...buildClientAttributesFromInfo(initSessionData.clientInfo),\n ...(initSessionData.protocolVersion && {\n [MCP_PROTOCOL_VERSION_ATTRIBUTE]: initSessionData.protocolVersion,\n }),\n });\n }\n\n storeSpanForRequest(transport, message.id, span, message.method);\n\n return withActiveSpan(span, () => {\n return (originalOnMessage as (...args: unknown[]) => unknown).call(this, message, extra);\n });\n });\n }\n\n if (isJsonRpcNotification(message)) {\n return createMcpNotificationSpan(message, transport, extra as ExtraHandlerData, options, () => {\n return (originalOnMessage as (...args: unknown[]) => unknown).call(this, message, extra);\n });\n }\n\n return (originalOnMessage as (...args: unknown[]) => unknown).call(this, message, extra);\n };\n });\n }\n}\n\n/**\n * Wraps transport.send to handle outgoing messages and response correlation.\n * For \"initialize\" responses, extracts and stores protocol version and server info\n * in the session data for the transport.\n * @param transport - MCP transport instance to wrap\n * @param options - Resolved MCP options\n */\nexport function wrapTransportSend(transport: MCPTransport, options: ResolvedMcpOptions): void {\n if (transport.send) {\n fill(transport, 'send', originalSend => {\n return async function (this: MCPTransport, ...args: unknown[]) {\n const [message] = args;\n\n if (isJsonRpcNotification(message)) {\n return createMcpOutgoingNotificationSpan(message, transport, options, () => {\n return (originalSend as (...args: unknown[]) => unknown).call(this, ...args);\n });\n }\n\n if (isJsonRpcResponse(message)) {\n if (message.id !== null && message.id !== undefined) {\n if (message.error) {\n captureJsonRpcErrorResponse(message.error);\n }\n\n if (isValidContentItem(message.result)) {\n if (message.result.protocolVersion || message.result.serverInfo) {\n try {\n const serverData = extractSessionDataFromInitializeResponse(message.result);\n updateSessionDataForTransport(transport, serverData);\n } catch {\n // noop\n }\n }\n }\n\n completeSpanWithResults(transport, message.id, message.result, options, !!message.error);\n }\n }\n\n return (originalSend as (...args: unknown[]) => unknown).call(this, ...args);\n };\n });\n }\n}\n\n/**\n * Wraps transport.onclose to clean up pending spans for this transport only\n * @param transport - MCP transport instance to wrap\n */\nexport function wrapTransportOnClose(transport: MCPTransport): void {\n if (transport.onclose) {\n fill(transport, 'onclose', originalOnClose => {\n return function (this: MCPTransport, ...args: unknown[]) {\n cleanupPendingSpansForTransport(transport);\n cleanupSessionDataForTransport(transport);\n return (originalOnClose as (...args: unknown[]) => unknown).call(this, ...args);\n };\n });\n }\n}\n\n/**\n * Wraps transport error handlers to capture connection errors\n * @param transport - MCP transport instance to wrap\n */\nexport function wrapTransportError(transport: MCPTransport): void {\n if (transport.onerror) {\n fill(transport, 'onerror', (originalOnError: (error: Error) => void) => {\n return function (this: MCPTransport, error: Error) {\n captureTransportError(error);\n return originalOnError.call(this, error);\n };\n });\n }\n}\n\n/**\n * Captures JSON-RPC error responses for server-side errors.\n * @see https://www.jsonrpc.org/specification#error_object\n * @internal\n * @param errorResponse - JSON-RPC error response\n */\nfunction captureJsonRpcErrorResponse(errorResponse: unknown): void {\n try {\n if (errorResponse && typeof errorResponse === 'object' && 'code' in errorResponse && 'message' in errorResponse) {\n const jsonRpcError = errorResponse as { code: number; message: string; data?: unknown };\n\n const isServerError =\n jsonRpcError.code === -32603 || (jsonRpcError.code >= -32099 && jsonRpcError.code <= -32000);\n\n if (isServerError) {\n const error = new Error(jsonRpcError.message);\n error.name = `JsonRpcError_${jsonRpcError.code}`;\n\n captureError(error, 'protocol');\n }\n }\n } catch {\n // noop\n }\n}\n\n/**\n * Captures transport connection errors\n * @internal\n * @param error - Transport error\n */\nfunction captureTransportError(error: Error): void {\n try {\n captureError(error, 'transport');\n } catch {\n // noop\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,SAAS,EAAgB,OAAO,EAA4B;AACnG,EAAE,IAAI,SAAS,CAAC,SAAS,EAAE;AAC3B,IAAI,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,qBAAqB;AACtD,MAAM,OAAO,WAA8B,OAAO,EAAW,KAAK,EAAY;AAC9E,QAAQ,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE;AACvC,UAAU,MAAM,YAAA,GAAe,OAAO,CAAC,MAAA,KAAW,YAAY;AAC9D,UAAU,IAAI,eAAe;;AAE7B,UAAU,IAAI,YAAY,EAAE;AAC5B,YAAY,IAAI;AAChB,cAAc,eAAA,GAAkB,uCAAuC,CAAC,OAAO,CAAC;AAChF,cAAc,4BAA4B,CAAC,SAAS,EAAE,eAAe,CAAC;AACtE,YAAY,EAAE,MAAM;AACpB;AACA,YAAY;AACZ,UAAU;;AAEV,UAAU,MAAM,iBAAiB,iBAAiB,EAAE,CAAC,KAAK,EAAE;;AAE5D,UAAU,OAAO,kBAAkB,CAAC,cAAc,EAAE,MAAM;AAC1D,YAAY,MAAM,UAAA,GAAa,wBAAwB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAA,GAA2B,OAAO,CAAC;AAC/G,YAAY,MAAM,IAAA,GAAO,iBAAiB,CAAC,UAAU,CAAC;;AAEtD;AACA,YAAY,IAAI,YAAA,IAAgB,eAAe,EAAE;AACjD,cAAc,IAAI,CAAC,aAAa,CAAC;AACjC,gBAAgB,GAAG,6BAA6B,CAAC,eAAe,CAAC,UAAU,CAAC;AAC5E,gBAAgB,IAAI,eAAe,CAAC,mBAAmB;AACvD,kBAAkB,CAAC,8BAA8B,GAAG,eAAe,CAAC,eAAe;AACnF,iBAAiB,CAAC;AAClB,eAAe,CAAC;AAChB,YAAY;;AAEZ,YAAY,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;;AAE5E,YAAY,OAAO,cAAc,CAAC,IAAI,EAAE,MAAM;AAC9C,cAAc,OAAO,CAAC,iBAAA,GAAsD,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC;AACtG,YAAY,CAAC,CAAC;AACd,UAAU,CAAC,CAAC;AACZ,QAAQ;;AAER,QAAQ,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE;AAC5C,UAAU,OAAO,yBAAyB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAA,GAA2B,OAAO,EAAE,MAAM;AACzG,YAAY,OAAO,CAAC,iBAAA,GAAsD,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC;AACpG,UAAU,CAAC,CAAC;AACZ,QAAQ;;AAER,QAAQ,OAAO,CAAC,iBAAA,GAAsD,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC;AAChG,MAAM,CAAC;AACP,IAAI,CAAC,CAAC;AACN,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,SAAS,EAAgB,OAAO,EAA4B;AAC9F,EAAE,IAAI,SAAS,CAAC,IAAI,EAAE;AACtB,IAAI,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB;AAC5C,MAAM,OAAO,iBAAoC,GAAG,IAAI,EAAa;AACrE,QAAQ,MAAM,CAAC,OAAO,CAAA,GAAI,IAAI;;AAE9B,QAAQ,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE;AAC5C,UAAU,OAAO,iCAAiC,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM;AACtF,YAAY,OAAO,CAAC,YAAA,GAAiD,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AACxF,UAAU,CAAC,CAAC;AACZ,QAAQ;;AAER,QAAQ,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE;AACxC,UAAU,IAAI,OAAO,CAAC,EAAA,KAAO,IAAA,IAAQ,OAAO,CAAC,EAAA,KAAO,SAAS,EAAE;AAC/D,YAAY,IAAI,OAAO,CAAC,KAAK,EAAE;AAC/B,cAAc,2BAA2B,CAAC,OAAO,CAAC,KAAK,CAAC;AACxD,YAAY;;AAEZ,YAAY,IAAI,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACpD,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,eAAA,IAAmB,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE;AAC/E,gBAAgB,IAAI;AACpB,kBAAkB,MAAM,aAAa,wCAAwC,CAAC,OAAO,CAAC,MAAM,CAAC;AAC7F,kBAAkB,6BAA6B,CAAC,SAAS,EAAE,UAAU,CAAC;AACtE,gBAAgB,EAAE,MAAM;AACxB;AACA,gBAAgB;AAChB,cAAc;AACd,YAAY;;AAEZ,YAAY,uBAAuB,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;AACpG,UAAU;AACV,QAAQ;;AAER,QAAQ,OAAO,CAAC,YAAA,GAAiD,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AACpF,MAAM,CAAC;AACP,IAAI,CAAC,CAAC;AACN,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,SAAS,EAAsB;AACpE,EAAE,IAAI,SAAS,CAAC,OAAO,EAAE;AACzB,IAAI,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB;AAClD,MAAM,OAAO,WAA8B,GAAG,IAAI,EAAa;AAC/D,QAAQ,+BAA+B,CAAC,SAAS,CAAC;AAClD,QAAQ,8BAA8B,CAAC,SAAS,CAAC;AACjD,QAAQ,OAAO,CAAC,eAAA,GAAoD,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AACvF,MAAM,CAAC;AACP,IAAI,CAAC,CAAC;AACN,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,SAAS,EAAsB;AAClE,EAAE,IAAI,SAAS,CAAC,OAAO,EAAE;AACzB,IAAI,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC,eAAe,KAA6B;AAC5E,MAAM,OAAO,WAA8B,KAAK,EAAS;AACzD,QAAQ,qBAAqB,CAAC,KAAK,CAAC;AACpC,QAAQ,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;AAChD,MAAM,CAAC;AACP,IAAI,CAAC,CAAC;AACN,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B,CAAC,aAAa,EAAiB;AACnE,EAAE,IAAI;AACN,IAAI,IAAI,aAAA,IAAiB,OAAO,kBAAkB,QAAA,IAAY,MAAA,IAAU,aAAA,IAAiB,SAAA,IAAa,aAAa,EAAE;AACrH,MAAM,MAAM,YAAA,GAAe,aAAA;;AAE3B,MAAM,MAAM,aAAA;AACZ,QAAQ,YAAY,CAAC,IAAA,KAAS,CAAC,KAAA,KAAU,YAAY,CAAC,QAAQ,CAAC,SAAS,YAAY,CAAC,IAAA,IAAQ,CAAC,KAAK,CAAC;;AAEpG,MAAM,IAAI,aAAa,EAAE;AACzB,QAAQ,MAAM,QAAQ,IAAI,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC;AACrD,QAAQ,KAAK,CAAC,IAAA,GAAO,CAAC,aAAa,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;;AAEA,QAAA,YAAA,CAAA,KAAA,EAAA,UAAA,CAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,EAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAA,qBAAA,CAAA,KAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,YAAA,CAAA,KAAA,EAAA,WAAA,CAAA;AACA,EAAA,CAAA,CAAA,MAAA;AACA;AACA,EAAA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"transport.js","sources":["../../../../src/integrations/mcp-server/transport.ts"],"sourcesContent":["/**\n * Transport layer instrumentation for MCP server\n *\n * Handles message interception and response correlation.\n * @see https://modelcontextprotocol.io/specification/2025-06-18/basic/transports\n */\n\nimport { getIsolationScope, withIsolationScope } from '../../currentScopes';\nimport { startInactiveSpan, withActiveSpan } from '../../tracing';\nimport { fill } from '../../utils/object';\nimport { MCP_PROTOCOL_VERSION_ATTRIBUTE } from './attributes';\nimport { cleanupPendingSpansForTransport, completeSpanWithResults, storeSpanForRequest } from './correlation';\nimport { captureError } from './errorCapture';\nimport {\n buildClientAttributesFromInfo,\n extractSessionDataFromInitializeRequest,\n extractSessionDataFromInitializeResponse,\n} from './sessionExtraction';\nimport {\n cleanupSessionDataForTransport,\n storeSessionDataForTransport,\n updateSessionDataForTransport,\n} from './sessionManagement';\nimport { buildMcpServerSpanConfig, createMcpNotificationSpan, createMcpOutgoingNotificationSpan } from './spans';\nimport type { ExtraHandlerData, MCPTransport, ResolvedMcpOptions, SessionData } from './types';\nimport { isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isValidContentItem } from './validation';\n\n/**\n * Wraps transport.onmessage to create spans for incoming messages.\n * For \"initialize\" requests, extracts and stores client info and protocol version\n * in the session data for the transport.\n * @param transport - MCP transport instance to wrap\n * @param options - Resolved MCP options\n */\nexport function wrapTransportOnMessage(transport: MCPTransport, options: ResolvedMcpOptions): void {\n if (transport.onmessage) {\n fill(transport, 'onmessage', originalOnMessage => {\n return function (this: MCPTransport, message: unknown, extra?: unknown) {\n if (isJsonRpcRequest(message)) {\n const isInitialize = message.method === 'initialize';\n let initSessionData: SessionData | undefined;\n\n if (isInitialize) {\n try {\n initSessionData = extractSessionDataFromInitializeRequest(message);\n storeSessionDataForTransport(transport, initSessionData);\n } catch {\n // noop\n }\n }\n\n const isolationScope = getIsolationScope().clone();\n\n return withIsolationScope(isolationScope, () => {\n const spanConfig = buildMcpServerSpanConfig(message, transport, extra as ExtraHandlerData, options);\n const span = startInactiveSpan(spanConfig);\n\n // For initialize requests, add client info directly to span (works even for stateless transports)\n if (isInitialize && initSessionData) {\n span.setAttributes({\n ...buildClientAttributesFromInfo(initSessionData.clientInfo),\n ...(initSessionData.protocolVersion && {\n [MCP_PROTOCOL_VERSION_ATTRIBUTE]: initSessionData.protocolVersion,\n }),\n });\n }\n\n storeSpanForRequest(transport, message.id, span, message.method);\n\n return withActiveSpan(span, () => {\n return (originalOnMessage as (...args: unknown[]) => unknown).call(this, message, extra);\n });\n });\n }\n\n if (isJsonRpcNotification(message)) {\n return createMcpNotificationSpan(message, transport, extra as ExtraHandlerData, options, () => {\n return (originalOnMessage as (...args: unknown[]) => unknown).call(this, message, extra);\n });\n }\n\n return (originalOnMessage as (...args: unknown[]) => unknown).call(this, message, extra);\n };\n });\n }\n}\n\n/**\n * Wraps transport.send to handle outgoing messages and response correlation.\n * For \"initialize\" responses, extracts and stores protocol version and server info\n * in the session data for the transport.\n * @param transport - MCP transport instance to wrap\n * @param options - Resolved MCP options\n */\nexport function wrapTransportSend(transport: MCPTransport, options: ResolvedMcpOptions): void {\n if (transport.send) {\n fill(transport, 'send', originalSend => {\n return async function (this: MCPTransport, ...args: unknown[]) {\n const [message] = args;\n\n if (isJsonRpcNotification(message)) {\n return createMcpOutgoingNotificationSpan(message, transport, options, () => {\n return (originalSend as (...args: unknown[]) => unknown).call(this, ...args);\n });\n }\n\n if (isJsonRpcResponse(message)) {\n if (message.id !== null && message.id !== undefined) {\n if (message.error) {\n captureJsonRpcErrorResponse(message.error);\n }\n\n if (isValidContentItem(message.result)) {\n if (message.result.protocolVersion || message.result.serverInfo) {\n try {\n const serverData = extractSessionDataFromInitializeResponse(message.result);\n updateSessionDataForTransport(transport, serverData);\n } catch {\n // noop\n }\n }\n }\n\n completeSpanWithResults(transport, message.id, message.result, options, !!message.error);\n }\n }\n\n return (originalSend as (...args: unknown[]) => unknown).call(this, ...args);\n };\n });\n }\n}\n\n/**\n * Wraps transport.onclose to clean up pending spans for this transport only\n * @param transport - MCP transport instance to wrap\n */\nexport function wrapTransportOnClose(transport: MCPTransport): void {\n if (transport.onclose) {\n fill(transport, 'onclose', originalOnClose => {\n return function (this: MCPTransport, ...args: unknown[]) {\n cleanupPendingSpansForTransport(transport);\n cleanupSessionDataForTransport(transport);\n return (originalOnClose as (...args: unknown[]) => unknown).call(this, ...args);\n };\n });\n }\n}\n\n/**\n * Wraps transport error handlers to capture connection errors\n * @param transport - MCP transport instance to wrap\n */\nexport function wrapTransportError(transport: MCPTransport): void {\n if (transport.onerror) {\n fill(transport, 'onerror', (originalOnError: (error: Error) => void) => {\n return function (this: MCPTransport, error: Error) {\n captureTransportError(error);\n return originalOnError.call(this, error);\n };\n });\n }\n}\n\n/**\n * Captures JSON-RPC error responses for server-side errors.\n * @see https://www.jsonrpc.org/specification#error_object\n * @internal\n * @param errorResponse - JSON-RPC error response\n */\nfunction captureJsonRpcErrorResponse(errorResponse: unknown): void {\n try {\n if (errorResponse && typeof errorResponse === 'object' && 'code' in errorResponse && 'message' in errorResponse) {\n const jsonRpcError = errorResponse as { code: number; message: string; data?: unknown };\n\n const isServerError =\n jsonRpcError.code === -32603 || (jsonRpcError.code >= -32099 && jsonRpcError.code <= -32000);\n\n if (isServerError) {\n const error = new Error(jsonRpcError.message);\n error.name = `JsonRpcError_${jsonRpcError.code}`;\n\n captureError(error, 'protocol');\n }\n }\n } catch {\n // noop\n }\n}\n\n/**\n * Captures transport connection errors\n * @internal\n * @param error - Transport error\n */\nfunction captureTransportError(error: Error): void {\n try {\n captureError(error, 'transport');\n } catch {\n // noop\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,90 +1,24 @@
|
|
|
1
1
|
import { DEBUG_BUILD } from '../../debug-build.js';
|
|
2
2
|
import { debug } from '../../utils/debug-logger.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Message validation functions for MCP server instrumentation
|
|
6
|
-
*
|
|
7
|
-
* Provides JSON-RPC 2.0 message type validation and MCP server instance validation.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Validates if a message is a JSON-RPC request
|
|
13
|
-
* @param message - Message to validate
|
|
14
|
-
* @returns True if message is a JSON-RPC request
|
|
15
|
-
*/
|
|
16
4
|
function isJsonRpcRequest(message) {
|
|
17
|
-
return
|
|
18
|
-
typeof message === 'object' &&
|
|
19
|
-
message !== null &&
|
|
20
|
-
'jsonrpc' in message &&
|
|
21
|
-
(message ).jsonrpc === '2.0' &&
|
|
22
|
-
'method' in message &&
|
|
23
|
-
'id' in message
|
|
24
|
-
);
|
|
5
|
+
return typeof message === "object" && message !== null && "jsonrpc" in message && message.jsonrpc === "2.0" && "method" in message && "id" in message;
|
|
25
6
|
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Validates if a message is a JSON-RPC notification
|
|
29
|
-
* @param message - Message to validate
|
|
30
|
-
* @returns True if message is a JSON-RPC notification
|
|
31
|
-
*/
|
|
32
7
|
function isJsonRpcNotification(message) {
|
|
33
|
-
return (
|
|
34
|
-
typeof message === 'object' &&
|
|
35
|
-
message !== null &&
|
|
36
|
-
'jsonrpc' in message &&
|
|
37
|
-
(message ).jsonrpc === '2.0' &&
|
|
38
|
-
'method' in message &&
|
|
39
|
-
!('id' in message)
|
|
40
|
-
);
|
|
8
|
+
return typeof message === "object" && message !== null && "jsonrpc" in message && message.jsonrpc === "2.0" && "method" in message && !("id" in message);
|
|
41
9
|
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Validates if a message is a JSON-RPC response
|
|
45
|
-
* @param message - Message to validate
|
|
46
|
-
* @returns True if message is a JSON-RPC response
|
|
47
|
-
*/
|
|
48
10
|
function isJsonRpcResponse(message) {
|
|
49
|
-
return (
|
|
50
|
-
typeof message === 'object' &&
|
|
51
|
-
message !== null &&
|
|
52
|
-
'jsonrpc' in message &&
|
|
53
|
-
(message ).jsonrpc === '2.0' &&
|
|
54
|
-
'id' in message &&
|
|
55
|
-
('result' in message || 'error' in message)
|
|
56
|
-
);
|
|
11
|
+
return typeof message === "object" && message !== null && "jsonrpc" in message && message.jsonrpc === "2.0" && "id" in message && ("result" in message || "error" in message);
|
|
57
12
|
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Validates MCP server instance with type checking.
|
|
61
|
-
* Accepts both the legacy API (`tool`, `resource`, `prompt`) used in SDK 1.x
|
|
62
|
-
* and the newer API (`registerTool`, `registerResource`, `registerPrompt`) introduced
|
|
63
|
-
* alongside the legacy API in SDK 1.x and made the only option in SDK 2.x.
|
|
64
|
-
* @param instance - Object to validate as MCP server instance
|
|
65
|
-
* @returns True if instance has required MCP server methods
|
|
66
|
-
*/
|
|
67
13
|
function validateMcpServerInstance(instance) {
|
|
68
|
-
if (
|
|
69
|
-
typeof instance === 'object' &&
|
|
70
|
-
instance !== null &&
|
|
71
|
-
'connect' in instance &&
|
|
72
|
-
(('tool' in instance && 'resource' in instance && 'prompt' in instance) ||
|
|
73
|
-
('registerTool' in instance && 'registerResource' in instance && 'registerPrompt' in instance))
|
|
74
|
-
) {
|
|
14
|
+
if (typeof instance === "object" && instance !== null && "connect" in instance && ("tool" in instance && "resource" in instance && "prompt" in instance || "registerTool" in instance && "registerResource" in instance && "registerPrompt" in instance)) {
|
|
75
15
|
return true;
|
|
76
16
|
}
|
|
77
|
-
DEBUG_BUILD && debug.warn(
|
|
17
|
+
DEBUG_BUILD && debug.warn("Did not patch MCP server. Interface is incompatible.");
|
|
78
18
|
return false;
|
|
79
19
|
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Check if the item is a valid content item
|
|
83
|
-
* @param item - The item to check
|
|
84
|
-
* @returns True if the item is a valid content item, false otherwise
|
|
85
|
-
*/
|
|
86
20
|
function isValidContentItem(item) {
|
|
87
|
-
return item != null && typeof item ===
|
|
21
|
+
return item != null && typeof item === "object";
|
|
88
22
|
}
|
|
89
23
|
|
|
90
24
|
export { isJsonRpcNotification, isJsonRpcRequest, isJsonRpcResponse, isValidContentItem, validateMcpServerInstance };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sources":["../../../../src/integrations/mcp-server/validation.ts"],"sourcesContent":["/**\n * Message validation functions for MCP server instrumentation\n *\n * Provides JSON-RPC 2.0 message type validation and MCP server instance validation.\n */\n\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { debug } from '../../utils/debug-logger';\nimport type { JsonRpcNotification, JsonRpcRequest, JsonRpcResponse } from './types';\n\n/**\n * Validates if a message is a JSON-RPC request\n * @param message - Message to validate\n * @returns True if message is a JSON-RPC request\n */\nexport function isJsonRpcRequest(message: unknown): message is JsonRpcRequest {\n return (\n typeof message === 'object' &&\n message !== null &&\n 'jsonrpc' in message &&\n (message as JsonRpcRequest).jsonrpc === '2.0' &&\n 'method' in message &&\n 'id' in message\n );\n}\n\n/**\n * Validates if a message is a JSON-RPC notification\n * @param message - Message to validate\n * @returns True if message is a JSON-RPC notification\n */\nexport function isJsonRpcNotification(message: unknown): message is JsonRpcNotification {\n return (\n typeof message === 'object' &&\n message !== null &&\n 'jsonrpc' in message &&\n (message as JsonRpcNotification).jsonrpc === '2.0' &&\n 'method' in message &&\n !('id' in message)\n );\n}\n\n/**\n * Validates if a message is a JSON-RPC response\n * @param message - Message to validate\n * @returns True if message is a JSON-RPC response\n */\nexport function isJsonRpcResponse(message: unknown): message is JsonRpcResponse {\n return (\n typeof message === 'object' &&\n message !== null &&\n 'jsonrpc' in message &&\n (message as { jsonrpc: string }).jsonrpc === '2.0' &&\n 'id' in message &&\n ('result' in message || 'error' in message)\n );\n}\n\n/**\n * Validates MCP server instance with type checking.\n * Accepts both the legacy API (`tool`, `resource`, `prompt`) used in SDK 1.x\n * and the newer API (`registerTool`, `registerResource`, `registerPrompt`) introduced\n * alongside the legacy API in SDK 1.x and made the only option in SDK 2.x.\n * @param instance - Object to validate as MCP server instance\n * @returns True if instance has required MCP server methods\n */\nexport function validateMcpServerInstance(instance: unknown): boolean {\n if (\n typeof instance === 'object' &&\n instance !== null &&\n 'connect' in instance &&\n (('tool' in instance && 'resource' in instance && 'prompt' in instance) ||\n ('registerTool' in instance && 'registerResource' in instance && 'registerPrompt' in instance))\n ) {\n return true;\n }\n DEBUG_BUILD && debug.warn('Did not patch MCP server. Interface is incompatible.');\n return false;\n}\n\n/**\n * Check if the item is a valid content item\n * @param item - The item to check\n * @returns True if the item is a valid content item, false otherwise\n */\nexport function isValidContentItem(item: unknown): item is Record<string, unknown> {\n return item != null && typeof item === 'object';\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"validation.js","sources":["../../../../src/integrations/mcp-server/validation.ts"],"sourcesContent":["/**\n * Message validation functions for MCP server instrumentation\n *\n * Provides JSON-RPC 2.0 message type validation and MCP server instance validation.\n */\n\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { debug } from '../../utils/debug-logger';\nimport type { JsonRpcNotification, JsonRpcRequest, JsonRpcResponse } from './types';\n\n/**\n * Validates if a message is a JSON-RPC request\n * @param message - Message to validate\n * @returns True if message is a JSON-RPC request\n */\nexport function isJsonRpcRequest(message: unknown): message is JsonRpcRequest {\n return (\n typeof message === 'object' &&\n message !== null &&\n 'jsonrpc' in message &&\n (message as JsonRpcRequest).jsonrpc === '2.0' &&\n 'method' in message &&\n 'id' in message\n );\n}\n\n/**\n * Validates if a message is a JSON-RPC notification\n * @param message - Message to validate\n * @returns True if message is a JSON-RPC notification\n */\nexport function isJsonRpcNotification(message: unknown): message is JsonRpcNotification {\n return (\n typeof message === 'object' &&\n message !== null &&\n 'jsonrpc' in message &&\n (message as JsonRpcNotification).jsonrpc === '2.0' &&\n 'method' in message &&\n !('id' in message)\n );\n}\n\n/**\n * Validates if a message is a JSON-RPC response\n * @param message - Message to validate\n * @returns True if message is a JSON-RPC response\n */\nexport function isJsonRpcResponse(message: unknown): message is JsonRpcResponse {\n return (\n typeof message === 'object' &&\n message !== null &&\n 'jsonrpc' in message &&\n (message as { jsonrpc: string }).jsonrpc === '2.0' &&\n 'id' in message &&\n ('result' in message || 'error' in message)\n );\n}\n\n/**\n * Validates MCP server instance with type checking.\n * Accepts both the legacy API (`tool`, `resource`, `prompt`) used in SDK 1.x\n * and the newer API (`registerTool`, `registerResource`, `registerPrompt`) introduced\n * alongside the legacy API in SDK 1.x and made the only option in SDK 2.x.\n * @param instance - Object to validate as MCP server instance\n * @returns True if instance has required MCP server methods\n */\nexport function validateMcpServerInstance(instance: unknown): boolean {\n if (\n typeof instance === 'object' &&\n instance !== null &&\n 'connect' in instance &&\n (('tool' in instance && 'resource' in instance && 'prompt' in instance) ||\n ('registerTool' in instance && 'registerResource' in instance && 'registerPrompt' in instance))\n ) {\n return true;\n }\n DEBUG_BUILD && debug.warn('Did not patch MCP server. Interface is incompatible.');\n return false;\n}\n\n/**\n * Check if the item is a valid content item\n * @param item - The item to check\n * @returns True if the item is a valid content item, false otherwise\n */\nexport function isValidContentItem(item: unknown): item is Record<string, unknown> {\n return item != null && typeof item === 'object';\n}\n"],"names":[],"mappings":";;;AAeO,SAAS,iBAAiB,OAAA,EAA6C;AAC5E,EAAA,OACE,OAAO,OAAA,KAAY,QAAA,IACnB,OAAA,KAAY,IAAA,IACZ,SAAA,IAAa,OAAA,IACZ,OAAA,CAA2B,OAAA,KAAY,KAAA,IACxC,QAAA,IAAY,OAAA,IACZ,IAAA,IAAQ,OAAA;AAEZ;AAOO,SAAS,sBAAsB,OAAA,EAAkD;AACtF,EAAA,OACE,OAAO,OAAA,KAAY,QAAA,IACnB,OAAA,KAAY,IAAA,IACZ,SAAA,IAAa,OAAA,IACZ,OAAA,CAAgC,OAAA,KAAY,KAAA,IAC7C,QAAA,IAAY,OAAA,IACZ,EAAE,IAAA,IAAQ,OAAA,CAAA;AAEd;AAOO,SAAS,kBAAkB,OAAA,EAA8C;AAC9E,EAAA,OACE,OAAO,OAAA,KAAY,QAAA,IACnB,OAAA,KAAY,QACZ,SAAA,IAAa,OAAA,IACZ,OAAA,CAAgC,OAAA,KAAY,KAAA,IAC7C,IAAA,IAAQ,OAAA,KACP,QAAA,IAAY,WAAW,OAAA,IAAW,OAAA,CAAA;AAEvC;AAUO,SAAS,0BAA0B,QAAA,EAA4B;AACpE,EAAA,IACE,OAAO,QAAA,KAAa,QAAA,IACpB,aAAa,IAAA,IACb,SAAA,IAAa,aACX,MAAA,IAAU,QAAA,IAAY,UAAA,IAAc,QAAA,IAAY,YAAY,QAAA,IAC3D,cAAA,IAAkB,YAAY,kBAAA,IAAsB,QAAA,IAAY,oBAAoB,QAAA,CAAA,EACvF;AACA,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,WAAA,IAAe,KAAA,CAAM,KAAK,sDAAsD,CAAA;AAChF,EAAA,OAAO,KAAA;AACT;AAOO,SAAS,mBAAmB,IAAA,EAAgD;AACjF,EAAA,OAAO,IAAA,IAAQ,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA;AACzC;;;;"}
|
|
@@ -2,25 +2,14 @@ import { defineIntegration } from '../integration.js';
|
|
|
2
2
|
import { stripMetadataFromStackFrames, addMetadataToStackFrames } from '../metadata.js';
|
|
3
3
|
import { forEachEnvelopeItem } from '../utils/envelope.js';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Adds module metadata to stack frames.
|
|
7
|
-
*
|
|
8
|
-
* Metadata can be injected by the Sentry bundler plugins using the `moduleMetadata` config option.
|
|
9
|
-
*
|
|
10
|
-
* When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events
|
|
11
|
-
* under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams
|
|
12
|
-
* our sources
|
|
13
|
-
*/
|
|
14
5
|
const moduleMetadataIntegration = defineIntegration(() => {
|
|
15
6
|
return {
|
|
16
|
-
name:
|
|
7
|
+
name: "ModuleMetadata",
|
|
17
8
|
setup(client) {
|
|
18
|
-
|
|
19
|
-
client.on('beforeEnvelope', envelope => {
|
|
9
|
+
client.on("beforeEnvelope", (envelope) => {
|
|
20
10
|
forEachEnvelopeItem(envelope, (item, type) => {
|
|
21
|
-
if (type ===
|
|
22
|
-
const event = Array.isArray(item) ?
|
|
23
|
-
|
|
11
|
+
if (type === "event") {
|
|
12
|
+
const event = Array.isArray(item) ? item[1] : void 0;
|
|
24
13
|
if (event) {
|
|
25
14
|
stripMetadataFromStackFrames(event);
|
|
26
15
|
item[1] = event;
|
|
@@ -28,17 +17,14 @@ const moduleMetadataIntegration = defineIntegration(() => {
|
|
|
28
17
|
}
|
|
29
18
|
});
|
|
30
19
|
});
|
|
31
|
-
|
|
32
|
-
client.on('applyFrameMetadata', event => {
|
|
33
|
-
// Only apply stack frame metadata to error events
|
|
20
|
+
client.on("applyFrameMetadata", (event) => {
|
|
34
21
|
if (event.type) {
|
|
35
22
|
return;
|
|
36
23
|
}
|
|
37
|
-
|
|
38
24
|
const stackParser = client.getOptions().stackParser;
|
|
39
25
|
addMetadataToStackFrames(stackParser, event);
|
|
40
26
|
});
|
|
41
|
-
}
|
|
27
|
+
}
|
|
42
28
|
};
|
|
43
29
|
});
|
|
44
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moduleMetadata.js","sources":["../../../src/integrations/moduleMetadata.ts"],"sourcesContent":["import { defineIntegration } from '../integration';\nimport { addMetadataToStackFrames, stripMetadataFromStackFrames } from '../metadata';\nimport type { EventItem } from '../types
|
|
1
|
+
{"version":3,"file":"moduleMetadata.js","sources":["../../../src/integrations/moduleMetadata.ts"],"sourcesContent":["import { defineIntegration } from '../integration';\nimport { addMetadataToStackFrames, stripMetadataFromStackFrames } from '../metadata';\nimport type { EventItem } from '../types/envelope';\nimport { forEachEnvelopeItem } from '../utils/envelope';\n\n/**\n * Adds module metadata to stack frames.\n *\n * Metadata can be injected by the Sentry bundler plugins using the `moduleMetadata` config option.\n *\n * When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events\n * under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams\n * our sources\n */\nexport const moduleMetadataIntegration = defineIntegration(() => {\n return {\n name: 'ModuleMetadata',\n setup(client) {\n // We need to strip metadata from stack frames before sending them to Sentry since these are client side only.\n client.on('beforeEnvelope', envelope => {\n forEachEnvelopeItem(envelope, (item, type) => {\n if (type === 'event') {\n const event = Array.isArray(item) ? (item as EventItem)[1] : undefined;\n\n if (event) {\n stripMetadataFromStackFrames(event);\n item[1] = event;\n }\n }\n });\n });\n\n client.on('applyFrameMetadata', event => {\n // Only apply stack frame metadata to error events\n if (event.type) {\n return;\n }\n\n const stackParser = client.getOptions().stackParser;\n addMetadataToStackFrames(stackParser, event);\n });\n },\n };\n});\n"],"names":[],"mappings":";;;;AAcO,MAAM,yBAAA,GAA4B,kBAAkB,MAAM;AAC/D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,MAAM,MAAA,EAAQ;AAEZ,MAAA,MAAA,CAAO,EAAA,CAAG,kBAAkB,CAAA,QAAA,KAAY;AACtC,QAAA,mBAAA,CAAoB,QAAA,EAAU,CAAC,IAAA,EAAM,IAAA,KAAS;AAC5C,UAAA,IAAI,SAAS,OAAA,EAAS;AACpB,YAAA,MAAM,QAAQ,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,GAAK,IAAA,CAAmB,CAAC,CAAA,GAAI,MAAA;AAE7D,YAAA,IAAI,KAAA,EAAO;AACT,cAAA,4BAAA,CAA6B,KAAK,CAAA;AAClC,cAAA,IAAA,CAAK,CAAC,CAAA,GAAI,KAAA;AAAA,YACZ;AAAA,UACF;AAAA,QACF,CAAC,CAAA;AAAA,MACH,CAAC,CAAA;AAED,MAAA,MAAA,CAAO,EAAA,CAAG,sBAAsB,CAAA,KAAA,KAAS;AAEvC,QAAA,IAAI,MAAM,IAAA,EAAM;AACd,UAAA;AAAA,QACF;AAEA,QAAA,MAAM,WAAA,GAAc,MAAA,CAAO,UAAA,EAAW,CAAE,WAAA;AACxC,QAAA,wBAAA,CAAyB,aAAa,KAAK,CAAA;AAAA,MAC7C,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAC;;;;"}
|