@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
package/build/esm/fetch.js
CHANGED
|
@@ -11,332 +11,197 @@ import { startInactiveSpan } from './tracing/trace.js';
|
|
|
11
11
|
import { stripDataUrlContent, parseStringToURLObject, getSanitizedUrlStringFromUrlObject, isURLObjectRelative } from './utils/url.js';
|
|
12
12
|
import { getTraceData } from './utils/traceData.js';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
* Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.
|
|
16
|
-
*
|
|
17
|
-
* @returns Span if a span was created, otherwise void.
|
|
18
|
-
*/
|
|
19
|
-
function instrumentFetchRequest(
|
|
20
|
-
handlerData,
|
|
21
|
-
shouldCreateSpan,
|
|
22
|
-
shouldAttachHeaders,
|
|
23
|
-
spans,
|
|
24
|
-
spanOriginOrOptions,
|
|
25
|
-
) {
|
|
14
|
+
function instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeaders, spans, spanOriginOrOptions) {
|
|
26
15
|
if (!handlerData.fetchData) {
|
|
27
|
-
return
|
|
16
|
+
return void 0;
|
|
28
17
|
}
|
|
29
|
-
|
|
30
18
|
const { method, url } = handlerData.fetchData;
|
|
31
|
-
|
|
32
19
|
const shouldCreateSpanResult = hasSpansEnabled() && shouldCreateSpan(url);
|
|
33
|
-
|
|
34
20
|
if (handlerData.endTimestamp) {
|
|
35
21
|
const spanId = handlerData.fetchData.__span;
|
|
36
22
|
if (!spanId) return;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (span) {
|
|
41
|
-
// Only end the span and call hooks if we're actually recording
|
|
23
|
+
const span2 = spans[spanId];
|
|
24
|
+
if (span2) {
|
|
42
25
|
if (shouldCreateSpanResult) {
|
|
43
|
-
endSpan(
|
|
44
|
-
_callOnRequestSpanEnd(
|
|
26
|
+
endSpan(span2, handlerData);
|
|
27
|
+
_callOnRequestSpanEnd(span2, handlerData, spanOriginOrOptions);
|
|
45
28
|
}
|
|
46
|
-
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
48
29
|
delete spans[spanId];
|
|
49
30
|
}
|
|
50
|
-
|
|
51
|
-
return undefined;
|
|
31
|
+
return void 0;
|
|
52
32
|
}
|
|
53
|
-
|
|
54
|
-
// Backwards-compatible with the old signature. Needed to introduce the combined optional parameter
|
|
55
|
-
// to avoid API breakage for anyone calling this function with the optional spanOrigin parameter
|
|
56
|
-
// TODO (v11): remove this backwards-compatible code and only accept the options parameter
|
|
57
|
-
const { spanOrigin = 'auto.http.browser', propagateTraceparent = false } =
|
|
58
|
-
typeof spanOriginOrOptions === 'object' ? spanOriginOrOptions : { spanOrigin: spanOriginOrOptions };
|
|
59
|
-
|
|
33
|
+
const { spanOrigin = "auto.http.browser", propagateTraceparent = false } = typeof spanOriginOrOptions === "object" ? spanOriginOrOptions : { spanOrigin: spanOriginOrOptions };
|
|
60
34
|
const client = getClient();
|
|
61
35
|
const hasParent = !!getActiveSpan();
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const span =
|
|
66
|
-
shouldCreateSpanResult && shouldEmitSpan
|
|
67
|
-
? startInactiveSpan(getSpanStartOptions(url, method, spanOrigin))
|
|
68
|
-
: new SentryNonRecordingSpan();
|
|
69
|
-
|
|
36
|
+
const shouldEmitSpan = hasParent || !!client && hasSpanStreamingEnabled(client);
|
|
37
|
+
const span = shouldCreateSpanResult && shouldEmitSpan ? startInactiveSpan(getSpanStartOptions(url, method, spanOrigin)) : new SentryNonRecordingSpan();
|
|
70
38
|
if (shouldCreateSpanResult && !shouldEmitSpan) {
|
|
71
|
-
client?.recordDroppedEvent(
|
|
39
|
+
client?.recordDroppedEvent("no_parent_span", "span");
|
|
72
40
|
}
|
|
73
|
-
|
|
74
41
|
handlerData.fetchData.__span = span.spanContext().spanId;
|
|
75
42
|
spans[span.spanContext().spanId] = span;
|
|
76
|
-
|
|
77
43
|
if (shouldAttachHeaders(handlerData.fetchData.url)) {
|
|
78
44
|
const request = handlerData.args[0];
|
|
79
|
-
|
|
80
|
-
// Shallow clone the options object to avoid mutating the original user-provided object
|
|
81
|
-
// Examples: users re-using same options object for multiple fetch calls, frozen objects
|
|
82
|
-
const options = { ...(handlerData.args[1] || {}) };
|
|
83
|
-
|
|
45
|
+
const options = { ...handlerData.args[1] || {} };
|
|
84
46
|
const headers = _INTERNAL_getTracingHeadersForFetchRequest(
|
|
85
47
|
request,
|
|
86
48
|
options,
|
|
87
49
|
// If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),
|
|
88
50
|
// we do not want to use the span as base for the trace headers,
|
|
89
51
|
// which means that the headers will be generated from the scope and the sampling decision is deferred
|
|
90
|
-
hasSpansEnabled() && shouldEmitSpan ? span :
|
|
91
|
-
propagateTraceparent
|
|
52
|
+
hasSpansEnabled() && shouldEmitSpan ? span : void 0,
|
|
53
|
+
propagateTraceparent
|
|
92
54
|
);
|
|
93
55
|
if (headers) {
|
|
94
|
-
// Ensure this is actually set, if no options have been passed previously
|
|
95
56
|
handlerData.args[1] = options;
|
|
96
57
|
options.headers = headers;
|
|
97
58
|
}
|
|
98
59
|
}
|
|
99
|
-
|
|
100
60
|
if (client) {
|
|
101
61
|
const fetchHint = {
|
|
102
62
|
input: handlerData.args,
|
|
103
63
|
response: handlerData.response,
|
|
104
64
|
startTimestamp: handlerData.startTimestamp,
|
|
105
|
-
endTimestamp: handlerData.endTimestamp
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
client.emit('beforeOutgoingRequestSpan', span, fetchHint);
|
|
65
|
+
endTimestamp: handlerData.endTimestamp
|
|
66
|
+
};
|
|
67
|
+
client.emit("beforeOutgoingRequestSpan", span, fetchHint);
|
|
109
68
|
}
|
|
110
|
-
|
|
111
69
|
return span;
|
|
112
70
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
* Calls the onRequestSpanEnd callback if it is defined.
|
|
116
|
-
*/
|
|
117
|
-
function _callOnRequestSpanEnd(
|
|
118
|
-
span,
|
|
119
|
-
handlerData,
|
|
120
|
-
spanOriginOrOptions,
|
|
121
|
-
) {
|
|
122
|
-
const onRequestSpanEnd =
|
|
123
|
-
typeof spanOriginOrOptions === 'object' && spanOriginOrOptions !== null
|
|
124
|
-
? spanOriginOrOptions.onRequestSpanEnd
|
|
125
|
-
: undefined;
|
|
126
|
-
|
|
71
|
+
function _callOnRequestSpanEnd(span, handlerData, spanOriginOrOptions) {
|
|
72
|
+
const onRequestSpanEnd = typeof spanOriginOrOptions === "object" && spanOriginOrOptions !== null ? spanOriginOrOptions.onRequestSpanEnd : void 0;
|
|
127
73
|
onRequestSpanEnd?.(span, {
|
|
128
74
|
headers: handlerData.response?.headers,
|
|
129
|
-
error: handlerData.error
|
|
75
|
+
error: handlerData.error
|
|
130
76
|
});
|
|
131
77
|
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Builds merged fetch headers that include `sentry-trace` and `baggage` (and optionally `traceparent`)
|
|
135
|
-
* for the given request and init, without mutating the original request or options.
|
|
136
|
-
* Returns `undefined` when there is no `sentry-trace` value to attach.
|
|
137
|
-
*
|
|
138
|
-
* @internal Exported for cross-package instrumentation (for example Cloudflare Workers fetcher bindings)
|
|
139
|
-
* and unit tests
|
|
140
|
-
*
|
|
141
|
-
* Baggage handling:
|
|
142
|
-
* 1. No previous baggage header → include Sentry baggage
|
|
143
|
-
* 2. Previous baggage has no Sentry entries → merge Sentry baggage in
|
|
144
|
-
* 3. Previous baggage already has Sentry entries → leave as-is (may be user-defined)
|
|
145
|
-
*/
|
|
146
|
-
// eslint-disable-next-line complexity -- yup it's this complicated :(
|
|
147
|
-
function _INTERNAL_getTracingHeadersForFetchRequest(
|
|
148
|
-
request,
|
|
149
|
-
fetchOptionsObj
|
|
150
|
-
|
|
151
|
-
,
|
|
152
|
-
span,
|
|
153
|
-
propagateTraceparent,
|
|
154
|
-
) {
|
|
78
|
+
function _INTERNAL_getTracingHeadersForFetchRequest(request, fetchOptionsObj, span, propagateTraceparent) {
|
|
155
79
|
const traceHeaders = getTraceData({ span, propagateTraceparent });
|
|
156
|
-
const sentryTrace = traceHeaders[
|
|
80
|
+
const sentryTrace = traceHeaders["sentry-trace"];
|
|
157
81
|
const baggage = traceHeaders.baggage;
|
|
158
82
|
const traceparent = traceHeaders.traceparent;
|
|
159
|
-
|
|
160
|
-
// Nothing to do, when we return undefined here, the original headers will be used
|
|
161
83
|
if (!sentryTrace) {
|
|
162
|
-
return
|
|
84
|
+
return void 0;
|
|
163
85
|
}
|
|
164
|
-
|
|
165
|
-
const originalHeaders = fetchOptionsObj.headers || (isRequest(request) ? request.headers : undefined);
|
|
166
|
-
|
|
86
|
+
const originalHeaders = fetchOptionsObj.headers || (isRequest(request) ? request.headers : void 0);
|
|
167
87
|
if (!originalHeaders) {
|
|
168
88
|
return { ...traceHeaders };
|
|
169
89
|
} else if (isHeaders(originalHeaders)) {
|
|
170
90
|
const newHeaders = new Headers(originalHeaders);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (!newHeaders.get('sentry-trace')) {
|
|
174
|
-
newHeaders.set('sentry-trace', sentryTrace);
|
|
91
|
+
if (!newHeaders.get("sentry-trace")) {
|
|
92
|
+
newHeaders.set("sentry-trace", sentryTrace);
|
|
175
93
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
newHeaders.set('traceparent', traceparent);
|
|
94
|
+
if (propagateTraceparent && traceparent && !newHeaders.get("traceparent")) {
|
|
95
|
+
newHeaders.set("traceparent", traceparent);
|
|
179
96
|
}
|
|
180
|
-
|
|
181
97
|
if (baggage) {
|
|
182
|
-
const prevBaggageHeader = newHeaders.get(
|
|
183
|
-
|
|
98
|
+
const prevBaggageHeader = newHeaders.get("baggage");
|
|
184
99
|
if (!prevBaggageHeader) {
|
|
185
|
-
newHeaders.set(
|
|
100
|
+
newHeaders.set("baggage", baggage);
|
|
186
101
|
} else if (!baggageHeaderHasSentryBaggageValues(prevBaggageHeader)) {
|
|
187
|
-
newHeaders.set(
|
|
102
|
+
newHeaders.set("baggage", `${prevBaggageHeader},${baggage}`);
|
|
188
103
|
}
|
|
189
104
|
}
|
|
190
|
-
|
|
191
105
|
return newHeaders;
|
|
192
106
|
} else if (isHeadersInitTupleArray(originalHeaders)) {
|
|
193
107
|
const newHeaders = [...originalHeaders];
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
newHeaders.push(['sentry-trace', sentryTrace]);
|
|
108
|
+
if (!newHeaders.find((header) => header[0] === "sentry-trace")) {
|
|
109
|
+
newHeaders.push(["sentry-trace", sentryTrace]);
|
|
197
110
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
newHeaders.push(['traceparent', traceparent]);
|
|
111
|
+
if (propagateTraceparent && traceparent && !newHeaders.find((header) => header[0] === "traceparent")) {
|
|
112
|
+
newHeaders.push(["traceparent", traceparent]);
|
|
201
113
|
}
|
|
202
|
-
|
|
203
114
|
const prevBaggageHeaderWithSentryValues = originalHeaders.find(
|
|
204
|
-
header =>
|
|
205
|
-
header[0] === 'baggage' && typeof header[1] === 'string' && baggageHeaderHasSentryBaggageValues(header[1]),
|
|
115
|
+
(header) => header[0] === "baggage" && typeof header[1] === "string" && baggageHeaderHasSentryBaggageValues(header[1])
|
|
206
116
|
);
|
|
207
|
-
|
|
208
117
|
if (baggage && !prevBaggageHeaderWithSentryValues) {
|
|
209
|
-
|
|
210
|
-
// Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
|
|
211
|
-
newHeaders.push(['baggage', baggage]);
|
|
118
|
+
newHeaders.push(["baggage", baggage]);
|
|
212
119
|
}
|
|
213
|
-
|
|
214
120
|
return newHeaders;
|
|
215
121
|
} else {
|
|
216
|
-
const existingSentryTraceHeader =
|
|
217
|
-
const existingTraceparentHeader =
|
|
218
|
-
const existingBaggageHeader =
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
? Array.isArray(existingBaggageHeader)
|
|
222
|
-
? [...existingBaggageHeader]
|
|
223
|
-
: [existingBaggageHeader]
|
|
224
|
-
: [];
|
|
225
|
-
|
|
226
|
-
const prevBaggageHeaderWithSentryValues =
|
|
227
|
-
existingBaggageHeader &&
|
|
228
|
-
(Array.isArray(existingBaggageHeader)
|
|
229
|
-
? existingBaggageHeader.find(headerItem => baggageHeaderHasSentryBaggageValues(headerItem))
|
|
230
|
-
: baggageHeaderHasSentryBaggageValues(existingBaggageHeader));
|
|
231
|
-
|
|
122
|
+
const existingSentryTraceHeader = "sentry-trace" in originalHeaders ? originalHeaders["sentry-trace"] : void 0;
|
|
123
|
+
const existingTraceparentHeader = "traceparent" in originalHeaders ? originalHeaders.traceparent : void 0;
|
|
124
|
+
const existingBaggageHeader = "baggage" in originalHeaders ? originalHeaders.baggage : void 0;
|
|
125
|
+
const newBaggageHeaders = existingBaggageHeader ? Array.isArray(existingBaggageHeader) ? [...existingBaggageHeader] : [existingBaggageHeader] : [];
|
|
126
|
+
const prevBaggageHeaderWithSentryValues = existingBaggageHeader && (Array.isArray(existingBaggageHeader) ? existingBaggageHeader.find((headerItem) => baggageHeaderHasSentryBaggageValues(headerItem)) : baggageHeaderHasSentryBaggageValues(existingBaggageHeader));
|
|
232
127
|
if (baggage && !prevBaggageHeaderWithSentryValues) {
|
|
233
128
|
newBaggageHeaders.push(baggage);
|
|
234
129
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
= Object.assign({}, originalHeaders, {
|
|
239
|
-
'sentry-trace': (existingSentryTraceHeader ) ?? sentryTrace,
|
|
240
|
-
baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,
|
|
130
|
+
const newHeaders = Object.assign({}, originalHeaders, {
|
|
131
|
+
"sentry-trace": existingSentryTraceHeader ?? sentryTrace,
|
|
132
|
+
baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(",") : void 0
|
|
241
133
|
});
|
|
242
|
-
|
|
243
134
|
if (propagateTraceparent && traceparent && !existingTraceparentHeader) {
|
|
244
135
|
newHeaders.traceparent = traceparent;
|
|
245
136
|
}
|
|
246
|
-
|
|
247
137
|
return newHeaders;
|
|
248
138
|
}
|
|
249
139
|
}
|
|
250
|
-
|
|
251
140
|
function endSpan(span, handlerData) {
|
|
252
141
|
if (handlerData.response) {
|
|
253
142
|
setHttpStatus(span, handlerData.response.status);
|
|
254
|
-
|
|
255
|
-
const contentLength = handlerData.response?.headers?.get('content-length');
|
|
256
|
-
|
|
143
|
+
const contentLength = handlerData.response?.headers?.get("content-length");
|
|
257
144
|
if (contentLength) {
|
|
258
145
|
const contentLengthNum = parseInt(contentLength);
|
|
259
146
|
if (contentLengthNum > 0) {
|
|
260
|
-
span.setAttribute(
|
|
147
|
+
span.setAttribute("http.response_content_length", contentLengthNum);
|
|
261
148
|
}
|
|
262
149
|
}
|
|
263
150
|
} else if (handlerData.error) {
|
|
264
|
-
span.setStatus({ code: SPAN_STATUS_ERROR, message:
|
|
151
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" });
|
|
265
152
|
}
|
|
266
153
|
span.end();
|
|
267
154
|
}
|
|
268
|
-
|
|
269
155
|
function baggageHeaderHasSentryBaggageValues(baggageHeader) {
|
|
270
|
-
if (typeof baggageHeader !==
|
|
156
|
+
if (typeof baggageHeader !== "string") {
|
|
271
157
|
return false;
|
|
272
158
|
}
|
|
273
|
-
|
|
274
|
-
return baggageHeader.split(',').some(baggageEntry => baggageEntry.trim().startsWith(SENTRY_BAGGAGE_KEY_PREFIX));
|
|
159
|
+
return baggageHeader.split(",").some((baggageEntry) => baggageEntry.trim().startsWith(SENTRY_BAGGAGE_KEY_PREFIX));
|
|
275
160
|
}
|
|
276
|
-
|
|
277
161
|
function isHeaders(headers) {
|
|
278
|
-
return typeof Headers !==
|
|
162
|
+
return typeof Headers !== "undefined" && isInstanceOf(headers, Headers);
|
|
279
163
|
}
|
|
280
|
-
|
|
281
|
-
/** `HeadersInit` array form: each entry is a [name, value] pair of strings. */
|
|
282
164
|
function isHeadersInitTupleArray(headers) {
|
|
283
165
|
if (!Array.isArray(headers)) {
|
|
284
166
|
return false;
|
|
285
167
|
}
|
|
286
|
-
|
|
287
168
|
return headers.every(
|
|
288
|
-
(item) => Array.isArray(item) && item.length === 2 && typeof item[0] ===
|
|
169
|
+
(item) => Array.isArray(item) && item.length === 2 && typeof item[0] === "string"
|
|
289
170
|
);
|
|
290
171
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
method,
|
|
295
|
-
spanOrigin,
|
|
296
|
-
) {
|
|
297
|
-
// Data URLs need special handling because parseStringToURLObject treats them as "relative"
|
|
298
|
-
// (no "://"), causing getSanitizedUrlStringFromUrlObject to return just the pathname
|
|
299
|
-
// without the "data:" prefix, making later stripDataUrlContent calls ineffective.
|
|
300
|
-
// So for data URLs, we strip the content first and use that directly.
|
|
301
|
-
if (url.startsWith('data:')) {
|
|
302
|
-
const sanitizedUrl = stripDataUrlContent(url);
|
|
172
|
+
function getSpanStartOptions(url, method, spanOrigin) {
|
|
173
|
+
if (url.startsWith("data:")) {
|
|
174
|
+
const sanitizedUrl2 = stripDataUrlContent(url);
|
|
303
175
|
return {
|
|
304
|
-
name: `${method} ${
|
|
305
|
-
attributes: getFetchSpanAttributes(url,
|
|
176
|
+
name: `${method} ${sanitizedUrl2}`,
|
|
177
|
+
attributes: getFetchSpanAttributes(url, void 0, method, spanOrigin)
|
|
306
178
|
};
|
|
307
179
|
}
|
|
308
|
-
|
|
309
180
|
const parsedUrl = parseStringToURLObject(url);
|
|
310
181
|
const sanitizedUrl = parsedUrl ? getSanitizedUrlStringFromUrlObject(parsedUrl) : url;
|
|
311
182
|
return {
|
|
312
183
|
name: `${method} ${sanitizedUrl}`,
|
|
313
|
-
attributes: getFetchSpanAttributes(url, parsedUrl, method, spanOrigin)
|
|
184
|
+
attributes: getFetchSpanAttributes(url, parsedUrl, method, spanOrigin)
|
|
314
185
|
};
|
|
315
186
|
}
|
|
316
|
-
|
|
317
|
-
function getFetchSpanAttributes(
|
|
318
|
-
url,
|
|
319
|
-
parsedUrl,
|
|
320
|
-
method,
|
|
321
|
-
spanOrigin,
|
|
322
|
-
) {
|
|
187
|
+
function getFetchSpanAttributes(url, parsedUrl, method, spanOrigin) {
|
|
323
188
|
const attributes = {
|
|
324
189
|
url: stripDataUrlContent(url),
|
|
325
|
-
type:
|
|
326
|
-
|
|
190
|
+
type: "fetch",
|
|
191
|
+
"http.method": method,
|
|
327
192
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,
|
|
328
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]:
|
|
193
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.client"
|
|
329
194
|
};
|
|
330
195
|
if (parsedUrl) {
|
|
331
196
|
if (!isURLObjectRelative(parsedUrl)) {
|
|
332
|
-
attributes[
|
|
333
|
-
attributes[
|
|
197
|
+
attributes["http.url"] = stripDataUrlContent(parsedUrl.href);
|
|
198
|
+
attributes["server.address"] = parsedUrl.host;
|
|
334
199
|
}
|
|
335
200
|
if (parsedUrl.search) {
|
|
336
|
-
attributes[
|
|
201
|
+
attributes["http.query"] = parsedUrl.search;
|
|
337
202
|
}
|
|
338
203
|
if (parsedUrl.hash) {
|
|
339
|
-
attributes[
|
|
204
|
+
attributes["http.fragment"] = parsedUrl.hash;
|
|
340
205
|
}
|
|
341
206
|
}
|
|
342
207
|
return attributes;
|
package/build/esm/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sources":["../../src/fetch.ts"],"sourcesContent":["import { getClient } from './currentScopes';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes';\nimport { setHttpStatus, SPAN_STATUS_ERROR, startInactiveSpan } from './tracing';\nimport { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan';\nimport { hasSpanStreamingEnabled } from './tracing/spans/hasSpanStreamingEnabled';\nimport type { FetchBreadcrumbHint } from './types-hoist/breadcrumb';\nimport type { HandlerDataFetch } from './types-hoist/instrument';\nimport type { ResponseHookInfo } from './types-hoist/request';\nimport type { Span, SpanAttributes, SpanOrigin } from './types-hoist/span';\nimport { SENTRY_BAGGAGE_KEY_PREFIX } from './utils/baggage';\nimport { hasSpansEnabled } from './utils/hasSpansEnabled';\nimport { isInstanceOf, isRequest } from './utils/is';\nimport { getActiveSpan } from './utils/spanUtils';\nimport { getTraceData } from './utils/traceData';\nimport {\n getSanitizedUrlStringFromUrlObject,\n isURLObjectRelative,\n parseStringToURLObject,\n stripDataUrlContent,\n} from './utils/url';\n\ntype PolymorphicRequestHeaders =\n | Record<string, unknown>\n | Array<[string, unknown]>\n | Iterable<Iterable<unknown>>\n // the below is not precisely the Header type used in Request, but it'll pass duck-typing\n | {\n append: (key: string, value: string) => void;\n get: (key: string) => string | null | undefined;\n };\n\ninterface InstrumentFetchRequestOptions {\n spanOrigin?: SpanOrigin;\n propagateTraceparent?: boolean;\n onRequestSpanEnd?: (span: Span, responseInformation: ResponseHookInfo) => void;\n}\n\n/**\n * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.\n *\n * @deprecated pass an options object instead of the spanOrigin parameter\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record<string, Span>,\n spanOrigin: SpanOrigin,\n): Span | undefined;\n/**\n * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record<string, Span>,\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- needed because the other overload is deprecated\n instrumentFetchRequestOptions: InstrumentFetchRequestOptions,\n): Span | undefined;\n\n/**\n * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record<string, Span>,\n spanOriginOrOptions?: SpanOrigin | InstrumentFetchRequestOptions,\n): Span | undefined {\n if (!handlerData.fetchData) {\n return undefined;\n }\n\n const { method, url } = handlerData.fetchData;\n\n const shouldCreateSpanResult = hasSpansEnabled() && shouldCreateSpan(url);\n\n if (handlerData.endTimestamp) {\n const spanId = handlerData.fetchData.__span;\n if (!spanId) return;\n\n const span = spans[spanId];\n\n if (span) {\n // Only end the span and call hooks if we're actually recording\n if (shouldCreateSpanResult) {\n endSpan(span, handlerData);\n _callOnRequestSpanEnd(span, handlerData, spanOriginOrOptions);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n\n return undefined;\n }\n\n // Backwards-compatible with the old signature. Needed to introduce the combined optional parameter\n // to avoid API breakage for anyone calling this function with the optional spanOrigin parameter\n // TODO (v11): remove this backwards-compatible code and only accept the options parameter\n const { spanOrigin = 'auto.http.browser', propagateTraceparent = false } =\n typeof spanOriginOrOptions === 'object' ? spanOriginOrOptions : { spanOrigin: spanOriginOrOptions };\n\n const client = getClient();\n const hasParent = !!getActiveSpan();\n // With span streaming, we always emit http.client spans, even without a parent span\n const shouldEmitSpan = hasParent || (!!client && hasSpanStreamingEnabled(client));\n\n const span =\n shouldCreateSpanResult && shouldEmitSpan\n ? startInactiveSpan(getSpanStartOptions(url, method, spanOrigin))\n : new SentryNonRecordingSpan();\n\n if (shouldCreateSpanResult && !shouldEmitSpan) {\n client?.recordDroppedEvent('no_parent_span', 'span');\n }\n\n handlerData.fetchData.__span = span.spanContext().spanId;\n spans[span.spanContext().spanId] = span;\n\n if (shouldAttachHeaders(handlerData.fetchData.url)) {\n const request: string | Request = handlerData.args[0];\n\n // Shallow clone the options object to avoid mutating the original user-provided object\n // Examples: users re-using same options object for multiple fetch calls, frozen objects\n const options: { [key: string]: unknown } = { ...(handlerData.args[1] || {}) };\n\n const headers = _INTERNAL_getTracingHeadersForFetchRequest(\n request,\n options,\n // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),\n // we do not want to use the span as base for the trace headers,\n // which means that the headers will be generated from the scope and the sampling decision is deferred\n hasSpansEnabled() && shouldEmitSpan ? span : undefined,\n propagateTraceparent,\n );\n if (headers) {\n // Ensure this is actually set, if no options have been passed previously\n handlerData.args[1] = options;\n options.headers = headers;\n }\n }\n\n if (client) {\n const fetchHint = {\n input: handlerData.args,\n response: handlerData.response,\n startTimestamp: handlerData.startTimestamp,\n endTimestamp: handlerData.endTimestamp,\n } satisfies FetchBreadcrumbHint;\n\n client.emit('beforeOutgoingRequestSpan', span, fetchHint);\n }\n\n return span;\n}\n\n/**\n * Calls the onRequestSpanEnd callback if it is defined.\n */\nexport function _callOnRequestSpanEnd(\n span: Span,\n handlerData: HandlerDataFetch,\n spanOriginOrOptions?: SpanOrigin | InstrumentFetchRequestOptions,\n): void {\n const onRequestSpanEnd =\n typeof spanOriginOrOptions === 'object' && spanOriginOrOptions !== null\n ? spanOriginOrOptions.onRequestSpanEnd\n : undefined;\n\n onRequestSpanEnd?.(span, {\n headers: handlerData.response?.headers,\n error: handlerData.error,\n });\n}\n\n/**\n * Builds merged fetch headers that include `sentry-trace` and `baggage` (and optionally `traceparent`)\n * for the given request and init, without mutating the original request or options.\n * Returns `undefined` when there is no `sentry-trace` value to attach.\n *\n * @internal Exported for cross-package instrumentation (for example Cloudflare Workers fetcher bindings)\n * and unit tests\n *\n * Baggage handling:\n * 1. No previous baggage header → include Sentry baggage\n * 2. Previous baggage has no Sentry entries → merge Sentry baggage in\n * 3. Previous baggage already has Sentry entries → leave as-is (may be user-defined)\n */\n// eslint-disable-next-line complexity -- yup it's this complicated :(\nexport function _INTERNAL_getTracingHeadersForFetchRequest(\n request: string | URL | Request,\n fetchOptionsObj: {\n headers?:\n | {\n [key: string]: string[] | string | undefined;\n }\n | PolymorphicRequestHeaders;\n },\n span?: Span,\n propagateTraceparent?: boolean,\n): PolymorphicRequestHeaders | undefined {\n const traceHeaders = getTraceData({ span, propagateTraceparent });\n const sentryTrace = traceHeaders['sentry-trace'];\n const baggage = traceHeaders.baggage;\n const traceparent = traceHeaders.traceparent;\n\n // Nothing to do, when we return undefined here, the original headers will be used\n if (!sentryTrace) {\n return undefined;\n }\n\n const originalHeaders = fetchOptionsObj.headers || (isRequest(request) ? request.headers : undefined);\n\n if (!originalHeaders) {\n return { ...traceHeaders };\n } else if (isHeaders(originalHeaders)) {\n const newHeaders = new Headers(originalHeaders);\n\n // We don't want to override manually added sentry headers\n if (!newHeaders.get('sentry-trace')) {\n newHeaders.set('sentry-trace', sentryTrace);\n }\n\n if (propagateTraceparent && traceparent && !newHeaders.get('traceparent')) {\n newHeaders.set('traceparent', traceparent);\n }\n\n if (baggage) {\n const prevBaggageHeader = newHeaders.get('baggage');\n\n if (!prevBaggageHeader) {\n newHeaders.set('baggage', baggage);\n } else if (!baggageHeaderHasSentryBaggageValues(prevBaggageHeader)) {\n newHeaders.set('baggage', `${prevBaggageHeader},${baggage}`);\n }\n }\n\n return newHeaders;\n } else if (isHeadersInitTupleArray(originalHeaders)) {\n const newHeaders = [...originalHeaders];\n\n if (!newHeaders.find(header => header[0] === 'sentry-trace')) {\n newHeaders.push(['sentry-trace', sentryTrace]);\n }\n\n if (propagateTraceparent && traceparent && !newHeaders.find(header => header[0] === 'traceparent')) {\n newHeaders.push(['traceparent', traceparent]);\n }\n\n const prevBaggageHeaderWithSentryValues = originalHeaders.find(\n header =>\n header[0] === 'baggage' && typeof header[1] === 'string' && baggageHeaderHasSentryBaggageValues(header[1]),\n );\n\n if (baggage && !prevBaggageHeaderWithSentryValues) {\n // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.push(['baggage', baggage]);\n }\n\n return newHeaders;\n } else {\n const existingSentryTraceHeader = 'sentry-trace' in originalHeaders ? originalHeaders['sentry-trace'] : undefined;\n const existingTraceparentHeader = 'traceparent' in originalHeaders ? originalHeaders.traceparent : undefined;\n const existingBaggageHeader = 'baggage' in originalHeaders ? originalHeaders.baggage : undefined;\n\n const newBaggageHeaders: string[] = existingBaggageHeader\n ? Array.isArray(existingBaggageHeader)\n ? [...existingBaggageHeader]\n : [existingBaggageHeader]\n : [];\n\n const prevBaggageHeaderWithSentryValues =\n existingBaggageHeader &&\n (Array.isArray(existingBaggageHeader)\n ? existingBaggageHeader.find(headerItem => baggageHeaderHasSentryBaggageValues(headerItem))\n : baggageHeaderHasSentryBaggageValues(existingBaggageHeader));\n\n if (baggage && !prevBaggageHeaderWithSentryValues) {\n newBaggageHeaders.push(baggage);\n }\n\n const newHeaders: {\n 'sentry-trace': string;\n baggage: string | undefined;\n traceparent?: string;\n } = Object.assign({}, originalHeaders, {\n 'sentry-trace': (existingSentryTraceHeader as string | undefined) ?? sentryTrace,\n baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n });\n\n if (propagateTraceparent && traceparent && !existingTraceparentHeader) {\n newHeaders.traceparent = traceparent;\n }\n\n return newHeaders;\n }\n}\n\nfunction endSpan(span: Span, handlerData: HandlerDataFetch): void {\n if (handlerData.response) {\n setHttpStatus(span, handlerData.response.status);\n\n const contentLength = handlerData.response?.headers?.get('content-length');\n\n if (contentLength) {\n const contentLengthNum = parseInt(contentLength);\n if (contentLengthNum > 0) {\n span.setAttribute('http.response_content_length', contentLengthNum);\n }\n }\n } else if (handlerData.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n }\n span.end();\n}\n\nfunction baggageHeaderHasSentryBaggageValues(baggageHeader: unknown): boolean {\n if (typeof baggageHeader !== 'string') {\n return false;\n }\n\n return baggageHeader.split(',').some(baggageEntry => baggageEntry.trim().startsWith(SENTRY_BAGGAGE_KEY_PREFIX));\n}\n\nfunction isHeaders(headers: unknown): headers is Headers {\n return typeof Headers !== 'undefined' && isInstanceOf(headers, Headers);\n}\n\n/** `HeadersInit` array form: each entry is a [name, value] pair of strings. */\nfunction isHeadersInitTupleArray(headers: unknown): headers is [string, unknown][] {\n if (!Array.isArray(headers)) {\n return false;\n }\n\n return headers.every(\n (item): item is [string, unknown] => Array.isArray(item) && item.length === 2 && typeof item[0] === 'string',\n );\n}\n\nfunction getSpanStartOptions(\n url: string,\n method: string,\n spanOrigin: SpanOrigin,\n): Parameters<typeof startInactiveSpan>[0] {\n // Data URLs need special handling because parseStringToURLObject treats them as \"relative\"\n // (no \"://\"), causing getSanitizedUrlStringFromUrlObject to return just the pathname\n // without the \"data:\" prefix, making later stripDataUrlContent calls ineffective.\n // So for data URLs, we strip the content first and use that directly.\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n return {\n name: `${method} ${sanitizedUrl}`,\n attributes: getFetchSpanAttributes(url, undefined, method, spanOrigin),\n };\n }\n\n const parsedUrl = parseStringToURLObject(url);\n const sanitizedUrl = parsedUrl ? getSanitizedUrlStringFromUrlObject(parsedUrl) : url;\n return {\n name: `${method} ${sanitizedUrl}`,\n attributes: getFetchSpanAttributes(url, parsedUrl, method, spanOrigin),\n };\n}\n\nfunction getFetchSpanAttributes(\n url: string,\n parsedUrl: ReturnType<typeof parseStringToURLObject>,\n method: string,\n spanOrigin: SpanOrigin,\n): SpanAttributes {\n const attributes: SpanAttributes = {\n url: stripDataUrlContent(url),\n type: 'fetch',\n 'http.method': method,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',\n };\n if (parsedUrl) {\n if (!isURLObjectRelative(parsedUrl)) {\n attributes['http.url'] = stripDataUrlContent(parsedUrl.href);\n attributes['server.address'] = parsedUrl.host;\n }\n if (parsedUrl.search) {\n attributes['http.query'] = parsedUrl.search;\n }\n if (parsedUrl.hash) {\n attributes['http.fragment'] = parsedUrl.hash;\n }\n }\n return attributes;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAiEA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB;AACtC,EAAE,WAAW;AACb,EAAE,gBAAgB;AAClB,EAAE,mBAAmB;AACrB,EAAE,KAAK;AACP,EAAE,mBAAmB;AACrB,EAAoB;AACpB,EAAE,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE;AAC9B,IAAI,OAAO,SAAS;AACpB,EAAE;;AAEF,EAAE,MAAM,EAAE,MAAM,EAAE,KAAI,GAAI,WAAW,CAAC,SAAS;;AAE/C,EAAE,MAAM,sBAAA,GAAyB,eAAe,MAAM,gBAAgB,CAAC,GAAG,CAAC;;AAE3E,EAAE,IAAI,WAAW,CAAC,YAAY,EAAE;AAChC,IAAI,MAAM,MAAA,GAAS,WAAW,CAAC,SAAS,CAAC,MAAM;AAC/C,IAAI,IAAI,CAAC,MAAM,EAAE;;AAEjB,IAAI,MAAM,IAAA,G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IAAA,IAAA,CAAA,mBAAA,CAAA,SAAA,CAAA,EAAA;AACA,MAAA,UAAA,CAAA,UAAA,CAAA,GAAA,mBAAA,CAAA,SAAA,CAAA,IAAA,CAAA;AACA,MAAA,UAAA,CAAA,gBAAA,CAAA,GAAA,SAAA,CAAA,IAAA;AACA,IAAA;AACA,IAAA,IAAA,SAAA,CAAA,MAAA,EAAA;AACA,MAAA,UAAA,CAAA,YAAA,CAAA,GAAA,SAAA,CAAA,MAAA;AACA,IAAA;AACA,IAAA,IAAA,SAAA,CAAA,IAAA,EAAA;AACA,MAAA,UAAA,CAAA,eAAA,CAAA,GAAA,SAAA,CAAA,IAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA,OAAA,UAAA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"fetch.js","sources":["../../src/fetch.ts"],"sourcesContent":["import { getClient } from './currentScopes';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes';\nimport { setHttpStatus, SPAN_STATUS_ERROR, startInactiveSpan } from './tracing';\nimport { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan';\nimport { hasSpanStreamingEnabled } from './tracing/spans/hasSpanStreamingEnabled';\nimport type { FetchBreadcrumbHint } from './types/breadcrumb';\nimport type { HandlerDataFetch } from './types/instrument';\nimport type { ResponseHookInfo } from './types/request';\nimport type { Span, SpanAttributes, SpanOrigin } from './types/span';\nimport { SENTRY_BAGGAGE_KEY_PREFIX } from './utils/baggage';\nimport { hasSpansEnabled } from './utils/hasSpansEnabled';\nimport { isInstanceOf, isRequest } from './utils/is';\nimport { getActiveSpan } from './utils/spanUtils';\nimport { getTraceData } from './utils/traceData';\nimport {\n getSanitizedUrlStringFromUrlObject,\n isURLObjectRelative,\n parseStringToURLObject,\n stripDataUrlContent,\n} from './utils/url';\n\ntype PolymorphicRequestHeaders =\n | Record<string, unknown>\n | Array<[string, unknown]>\n | Iterable<Iterable<unknown>>\n // the below is not precisely the Header type used in Request, but it'll pass duck-typing\n | {\n append: (key: string, value: string) => void;\n get: (key: string) => string | null | undefined;\n };\n\ninterface InstrumentFetchRequestOptions {\n spanOrigin?: SpanOrigin;\n propagateTraceparent?: boolean;\n onRequestSpanEnd?: (span: Span, responseInformation: ResponseHookInfo) => void;\n}\n\n/**\n * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.\n *\n * @deprecated pass an options object instead of the spanOrigin parameter\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record<string, Span>,\n spanOrigin: SpanOrigin,\n): Span | undefined;\n/**\n * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record<string, Span>,\n // eslint-disable-next-line @typescript-eslint/unified-signatures -- needed because the other overload is deprecated\n instrumentFetchRequestOptions: InstrumentFetchRequestOptions,\n): Span | undefined;\n\n/**\n * Create and track fetch request spans for usage in combination with `addFetchInstrumentationHandler`.\n *\n * @returns Span if a span was created, otherwise void.\n */\nexport function instrumentFetchRequest(\n handlerData: HandlerDataFetch,\n shouldCreateSpan: (url: string) => boolean,\n shouldAttachHeaders: (url: string) => boolean,\n spans: Record<string, Span>,\n spanOriginOrOptions?: SpanOrigin | InstrumentFetchRequestOptions,\n): Span | undefined {\n if (!handlerData.fetchData) {\n return undefined;\n }\n\n const { method, url } = handlerData.fetchData;\n\n const shouldCreateSpanResult = hasSpansEnabled() && shouldCreateSpan(url);\n\n if (handlerData.endTimestamp) {\n const spanId = handlerData.fetchData.__span;\n if (!spanId) return;\n\n const span = spans[spanId];\n\n if (span) {\n // Only end the span and call hooks if we're actually recording\n if (shouldCreateSpanResult) {\n endSpan(span, handlerData);\n _callOnRequestSpanEnd(span, handlerData, spanOriginOrOptions);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete spans[spanId];\n }\n\n return undefined;\n }\n\n // Backwards-compatible with the old signature. Needed to introduce the combined optional parameter\n // to avoid API breakage for anyone calling this function with the optional spanOrigin parameter\n // TODO (v11): remove this backwards-compatible code and only accept the options parameter\n const { spanOrigin = 'auto.http.browser', propagateTraceparent = false } =\n typeof spanOriginOrOptions === 'object' ? spanOriginOrOptions : { spanOrigin: spanOriginOrOptions };\n\n const client = getClient();\n const hasParent = !!getActiveSpan();\n // With span streaming, we always emit http.client spans, even without a parent span\n const shouldEmitSpan = hasParent || (!!client && hasSpanStreamingEnabled(client));\n\n const span =\n shouldCreateSpanResult && shouldEmitSpan\n ? startInactiveSpan(getSpanStartOptions(url, method, spanOrigin))\n : new SentryNonRecordingSpan();\n\n if (shouldCreateSpanResult && !shouldEmitSpan) {\n client?.recordDroppedEvent('no_parent_span', 'span');\n }\n\n handlerData.fetchData.__span = span.spanContext().spanId;\n spans[span.spanContext().spanId] = span;\n\n if (shouldAttachHeaders(handlerData.fetchData.url)) {\n const request: string | Request = handlerData.args[0];\n\n // Shallow clone the options object to avoid mutating the original user-provided object\n // Examples: users re-using same options object for multiple fetch calls, frozen objects\n const options: { [key: string]: unknown } = { ...(handlerData.args[1] || {}) };\n\n const headers = _INTERNAL_getTracingHeadersForFetchRequest(\n request,\n options,\n // If performance is disabled (TWP) or there's no active root span (pageload/navigation/interaction),\n // we do not want to use the span as base for the trace headers,\n // which means that the headers will be generated from the scope and the sampling decision is deferred\n hasSpansEnabled() && shouldEmitSpan ? span : undefined,\n propagateTraceparent,\n );\n if (headers) {\n // Ensure this is actually set, if no options have been passed previously\n handlerData.args[1] = options;\n options.headers = headers;\n }\n }\n\n if (client) {\n const fetchHint = {\n input: handlerData.args,\n response: handlerData.response,\n startTimestamp: handlerData.startTimestamp,\n endTimestamp: handlerData.endTimestamp,\n } satisfies FetchBreadcrumbHint;\n\n client.emit('beforeOutgoingRequestSpan', span, fetchHint);\n }\n\n return span;\n}\n\n/**\n * Calls the onRequestSpanEnd callback if it is defined.\n */\nexport function _callOnRequestSpanEnd(\n span: Span,\n handlerData: HandlerDataFetch,\n spanOriginOrOptions?: SpanOrigin | InstrumentFetchRequestOptions,\n): void {\n const onRequestSpanEnd =\n typeof spanOriginOrOptions === 'object' && spanOriginOrOptions !== null\n ? spanOriginOrOptions.onRequestSpanEnd\n : undefined;\n\n onRequestSpanEnd?.(span, {\n headers: handlerData.response?.headers,\n error: handlerData.error,\n });\n}\n\n/**\n * Builds merged fetch headers that include `sentry-trace` and `baggage` (and optionally `traceparent`)\n * for the given request and init, without mutating the original request or options.\n * Returns `undefined` when there is no `sentry-trace` value to attach.\n *\n * @internal Exported for cross-package instrumentation (for example Cloudflare Workers fetcher bindings)\n * and unit tests\n *\n * Baggage handling:\n * 1. No previous baggage header → include Sentry baggage\n * 2. Previous baggage has no Sentry entries → merge Sentry baggage in\n * 3. Previous baggage already has Sentry entries → leave as-is (may be user-defined)\n */\n// eslint-disable-next-line complexity -- yup it's this complicated :(\nexport function _INTERNAL_getTracingHeadersForFetchRequest(\n request: string | URL | Request,\n fetchOptionsObj: {\n headers?:\n | {\n [key: string]: string[] | string | undefined;\n }\n | PolymorphicRequestHeaders;\n },\n span?: Span,\n propagateTraceparent?: boolean,\n): PolymorphicRequestHeaders | undefined {\n const traceHeaders = getTraceData({ span, propagateTraceparent });\n const sentryTrace = traceHeaders['sentry-trace'];\n const baggage = traceHeaders.baggage;\n const traceparent = traceHeaders.traceparent;\n\n // Nothing to do, when we return undefined here, the original headers will be used\n if (!sentryTrace) {\n return undefined;\n }\n\n const originalHeaders = fetchOptionsObj.headers || (isRequest(request) ? request.headers : undefined);\n\n if (!originalHeaders) {\n return { ...traceHeaders };\n } else if (isHeaders(originalHeaders)) {\n const newHeaders = new Headers(originalHeaders);\n\n // We don't want to override manually added sentry headers\n if (!newHeaders.get('sentry-trace')) {\n newHeaders.set('sentry-trace', sentryTrace);\n }\n\n if (propagateTraceparent && traceparent && !newHeaders.get('traceparent')) {\n newHeaders.set('traceparent', traceparent);\n }\n\n if (baggage) {\n const prevBaggageHeader = newHeaders.get('baggage');\n\n if (!prevBaggageHeader) {\n newHeaders.set('baggage', baggage);\n } else if (!baggageHeaderHasSentryBaggageValues(prevBaggageHeader)) {\n newHeaders.set('baggage', `${prevBaggageHeader},${baggage}`);\n }\n }\n\n return newHeaders;\n } else if (isHeadersInitTupleArray(originalHeaders)) {\n const newHeaders = [...originalHeaders];\n\n if (!newHeaders.find(header => header[0] === 'sentry-trace')) {\n newHeaders.push(['sentry-trace', sentryTrace]);\n }\n\n if (propagateTraceparent && traceparent && !newHeaders.find(header => header[0] === 'traceparent')) {\n newHeaders.push(['traceparent', traceparent]);\n }\n\n const prevBaggageHeaderWithSentryValues = originalHeaders.find(\n header =>\n header[0] === 'baggage' && typeof header[1] === 'string' && baggageHeaderHasSentryBaggageValues(header[1]),\n );\n\n if (baggage && !prevBaggageHeaderWithSentryValues) {\n // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n newHeaders.push(['baggage', baggage]);\n }\n\n return newHeaders;\n } else {\n const existingSentryTraceHeader = 'sentry-trace' in originalHeaders ? originalHeaders['sentry-trace'] : undefined;\n const existingTraceparentHeader = 'traceparent' in originalHeaders ? originalHeaders.traceparent : undefined;\n const existingBaggageHeader = 'baggage' in originalHeaders ? originalHeaders.baggage : undefined;\n\n const newBaggageHeaders: string[] = existingBaggageHeader\n ? Array.isArray(existingBaggageHeader)\n ? [...existingBaggageHeader]\n : [existingBaggageHeader]\n : [];\n\n const prevBaggageHeaderWithSentryValues =\n existingBaggageHeader &&\n (Array.isArray(existingBaggageHeader)\n ? existingBaggageHeader.find(headerItem => baggageHeaderHasSentryBaggageValues(headerItem))\n : baggageHeaderHasSentryBaggageValues(existingBaggageHeader));\n\n if (baggage && !prevBaggageHeaderWithSentryValues) {\n newBaggageHeaders.push(baggage);\n }\n\n const newHeaders: {\n 'sentry-trace': string;\n baggage: string | undefined;\n traceparent?: string;\n } = Object.assign({}, originalHeaders, {\n 'sentry-trace': (existingSentryTraceHeader as string | undefined) ?? sentryTrace,\n baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n });\n\n if (propagateTraceparent && traceparent && !existingTraceparentHeader) {\n newHeaders.traceparent = traceparent;\n }\n\n return newHeaders;\n }\n}\n\nfunction endSpan(span: Span, handlerData: HandlerDataFetch): void {\n if (handlerData.response) {\n setHttpStatus(span, handlerData.response.status);\n\n const contentLength = handlerData.response?.headers?.get('content-length');\n\n if (contentLength) {\n const contentLengthNum = parseInt(contentLength);\n if (contentLengthNum > 0) {\n span.setAttribute('http.response_content_length', contentLengthNum);\n }\n }\n } else if (handlerData.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n }\n span.end();\n}\n\nfunction baggageHeaderHasSentryBaggageValues(baggageHeader: unknown): boolean {\n if (typeof baggageHeader !== 'string') {\n return false;\n }\n\n return baggageHeader.split(',').some(baggageEntry => baggageEntry.trim().startsWith(SENTRY_BAGGAGE_KEY_PREFIX));\n}\n\nfunction isHeaders(headers: unknown): headers is Headers {\n return typeof Headers !== 'undefined' && isInstanceOf(headers, Headers);\n}\n\n/** `HeadersInit` array form: each entry is a [name, value] pair of strings. */\nfunction isHeadersInitTupleArray(headers: unknown): headers is [string, unknown][] {\n if (!Array.isArray(headers)) {\n return false;\n }\n\n return headers.every(\n (item): item is [string, unknown] => Array.isArray(item) && item.length === 2 && typeof item[0] === 'string',\n );\n}\n\nfunction getSpanStartOptions(\n url: string,\n method: string,\n spanOrigin: SpanOrigin,\n): Parameters<typeof startInactiveSpan>[0] {\n // Data URLs need special handling because parseStringToURLObject treats them as \"relative\"\n // (no \"://\"), causing getSanitizedUrlStringFromUrlObject to return just the pathname\n // without the \"data:\" prefix, making later stripDataUrlContent calls ineffective.\n // So for data URLs, we strip the content first and use that directly.\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n return {\n name: `${method} ${sanitizedUrl}`,\n attributes: getFetchSpanAttributes(url, undefined, method, spanOrigin),\n };\n }\n\n const parsedUrl = parseStringToURLObject(url);\n const sanitizedUrl = parsedUrl ? getSanitizedUrlStringFromUrlObject(parsedUrl) : url;\n return {\n name: `${method} ${sanitizedUrl}`,\n attributes: getFetchSpanAttributes(url, parsedUrl, method, spanOrigin),\n };\n}\n\nfunction getFetchSpanAttributes(\n url: string,\n parsedUrl: ReturnType<typeof parseStringToURLObject>,\n method: string,\n spanOrigin: SpanOrigin,\n): SpanAttributes {\n const attributes: SpanAttributes = {\n url: stripDataUrlContent(url),\n type: 'fetch',\n 'http.method': method,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: spanOrigin,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'http.client',\n };\n if (parsedUrl) {\n if (!isURLObjectRelative(parsedUrl)) {\n attributes['http.url'] = stripDataUrlContent(parsedUrl.href);\n attributes['server.address'] = parsedUrl.host;\n }\n if (parsedUrl.search) {\n attributes['http.query'] = parsedUrl.search;\n }\n if (parsedUrl.hash) {\n attributes['http.fragment'] = parsedUrl.hash;\n }\n }\n return attributes;\n}\n"],"names":["span","sanitizedUrl"],"mappings":";;;;;;;;;;;;;AAsEO,SAAS,sBAAA,CACd,WAAA,EACA,gBAAA,EACA,mBAAA,EACA,OACA,mBAAA,EACkB;AAClB,EAAA,IAAI,CAAC,YAAY,SAAA,EAAW;AAC1B,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,MAAM,EAAE,MAAA,EAAQ,GAAA,EAAI,GAAI,WAAA,CAAY,SAAA;AAEpC,EAAA,MAAM,sBAAA,GAAyB,eAAA,EAAgB,IAAK,gBAAA,CAAiB,GAAG,CAAA;AAExE,EAAA,IAAI,YAAY,YAAA,EAAc;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T;;;;"}
|
package/build/esm/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export { setMeasurement, timedEventsToMeasurements } from './tracing/measurement
|
|
|
10
10
|
export { sampleSpan } from './tracing/sampling.js';
|
|
11
11
|
export { logSpanEnd, logSpanStart } from './tracing/logSpans.js';
|
|
12
12
|
export { captureSpan, safeSetSpanJSONAttributes } from './tracing/spans/captureSpan.js';
|
|
13
|
-
export { GEN_AI_CONVERSATION_ID_ATTRIBUTE, SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_RELEASE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_URL_FULL, SEMANTIC_ATTRIBUTE_USER_EMAIL, SEMANTIC_ATTRIBUTE_USER_ID, SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS, SEMANTIC_ATTRIBUTE_USER_USERNAME, SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE } from './semanticAttributes.js';
|
|
13
|
+
export { GEN_AI_CONVERSATION_ID_ATTRIBUTE, SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD, SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_RELEASE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SDK_INTEGRATIONS, SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_URL_FULL, SEMANTIC_ATTRIBUTE_USER_EMAIL, SEMANTIC_ATTRIBUTE_USER_ID, SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS, SEMANTIC_ATTRIBUTE_USER_USERNAME, SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE } from './semanticAttributes.js';
|
|
14
14
|
export { createEventEnvelope, createSessionEnvelope, createSpanEnvelope } from './envelope.js';
|
|
15
15
|
export { addEventProcessor, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, endSession, flush, isEnabled, isInitialized, lastEventId, setContext, setConversationId, setExtra, setExtras, setTag, setTags, setUser, startSession, withMonitor } from './exports.js';
|
|
16
16
|
export { getClient, getCurrentScope, getExternalPropagationContext, getGlobalScope, getIsolationScope, getTraceContextFromScope, hasExternalPropagationContext, registerExternalPropagationContext, withIsolationScope, withScope } from './currentScopes.js';
|
|
@@ -28,6 +28,9 @@ export { makeOfflineTransport } from './transports/offline.js';
|
|
|
28
28
|
export { MULTIPLEXED_TRANSPORT_EXTRA_KEY, makeMultiplexedTransport } from './transports/multiplexed.js';
|
|
29
29
|
export { addIntegration, defineIntegration, getIntegrationsToSetup, installedIntegrations } from './integration.js';
|
|
30
30
|
export { _INTERNAL_clearAiProviderSkips, _INTERNAL_shouldSkipAiProviderWrapping, _INTERNAL_skipAiProviderWrapping } from './utils/ai/providerSkip.js';
|
|
31
|
+
export { filterKeyValueData as _INTERNAL_filterKeyValueData } from './utils/data-collection/filterKeyValueData.js';
|
|
32
|
+
export { filterCookies as _INTERNAL_filterCookies } from './utils/data-collection/filterCookies.js';
|
|
33
|
+
export { filterQueryParams as _INTERNAL_filterQueryParams } from './utils/data-collection/filterQueryParams.js';
|
|
31
34
|
export { envToBool } from './utils/envToBool.js';
|
|
32
35
|
export { applyScopeDataToEvent, getCombinedScopeData, mergeScopeData } from './utils/scopeData.js';
|
|
33
36
|
export { prepareEvent } from './utils/prepareEvent.js';
|
|
@@ -89,6 +92,7 @@ export { ANTHROPIC_AI_INTEGRATION_NAME } from './tracing/anthropic-ai/constants.
|
|
|
89
92
|
export { instrumentGoogleGenAIClient } from './tracing/google-genai/index.js';
|
|
90
93
|
export { GOOGLE_GENAI_INTEGRATION_NAME } from './tracing/google-genai/constants.js';
|
|
91
94
|
export { createLangChainCallbackHandler } from './tracing/langchain/index.js';
|
|
95
|
+
export { _INTERNAL_mergeLangChainCallbackHandler } from './tracing/langchain/utils.js';
|
|
92
96
|
export { LANGCHAIN_INTEGRATION_NAME } from './tracing/langchain/constants.js';
|
|
93
97
|
export { instrumentCreateReactAgent, instrumentLangGraph, instrumentStateGraphCompile } from './tracing/langgraph/index.js';
|
|
94
98
|
export { LANGGRAPH_INTEGRATION_NAME } from './tracing/langgraph/constants.js';
|
|
@@ -150,6 +154,8 @@ export { expressErrorHandler, patchExpressModule, setupExpressErrorHandler } fro
|
|
|
150
154
|
export { instrumentPostgresJsSql } from './integrations/postgresjs.js';
|
|
151
155
|
export { patchHttpModuleClient } from './integrations/http/client-patch.js';
|
|
152
156
|
export { getHttpClientSubscriptions } from './integrations/http/client-subscriptions.js';
|
|
157
|
+
export { getHttpServerSubscriptions, isStaticAssetRequest } from './integrations/http/server-subscription.js';
|
|
158
|
+
export { recordRequestSession } from './integrations/http/record-request-session.js';
|
|
153
159
|
export { addOutgoingRequestBreadcrumb } from './integrations/http/add-outgoing-request-breadcrumb.js';
|
|
154
160
|
export { getRequestOptions, getRequestUrl, getRequestUrlFromClientRequest, getRequestUrlObject } from './integrations/http/get-request-url.js';
|
|
155
161
|
export { HTTP_ON_CLIENT_REQUEST, HTTP_ON_SERVER_REQUEST } from './integrations/http/constants.js';
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,73 +5,41 @@ import { stringMatchesSomePattern } from '../utils/string.js';
|
|
|
5
5
|
import { GLOBAL_OBJ } from '../utils/worldwide.js';
|
|
6
6
|
import { addHandler, maybeInstrument, triggerHandlers } from './handlers.js';
|
|
7
7
|
|
|
8
|
-
/*
|
|
9
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Filter out console messages that match the given strings or regular expressions.
|
|
13
|
-
* These will neither be passed to the handler, and they will also not be logged to the user, unless they have debug enabled.
|
|
14
|
-
* This is a set to avoid duplicate integration setups to add the same filter multiple times.
|
|
15
|
-
*/
|
|
16
|
-
const _filter = new Set([]);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Add an instrumentation handler for when a console.xxx method is called.
|
|
20
|
-
* Returns a function to remove the handler.
|
|
21
|
-
*
|
|
22
|
-
* Use at your own risk, this might break without changelog notice, only used internally.
|
|
23
|
-
* @hidden
|
|
24
|
-
*/
|
|
8
|
+
const _filter = /* @__PURE__ */ new Set([]);
|
|
25
9
|
function addConsoleInstrumentationHandler(handler) {
|
|
26
|
-
const type =
|
|
10
|
+
const type = "console";
|
|
27
11
|
const removeHandler = addHandler(type, handler);
|
|
28
12
|
maybeInstrument(type, instrumentConsole);
|
|
29
13
|
return removeHandler;
|
|
30
14
|
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Add a filter to the console instrumentation to filter out console messages that match the given strings or regular expressions.
|
|
34
|
-
* Returns a function to remove the filter.
|
|
35
|
-
*/
|
|
36
15
|
function addConsoleInstrumentationFilter(filter) {
|
|
37
16
|
for (const f of filter) {
|
|
38
17
|
_filter.add(f);
|
|
39
18
|
}
|
|
40
|
-
|
|
41
19
|
return () => {
|
|
42
20
|
for (const f of filter) {
|
|
43
21
|
_filter.delete(f);
|
|
44
22
|
}
|
|
45
23
|
};
|
|
46
24
|
}
|
|
47
|
-
|
|
48
25
|
function instrumentConsole() {
|
|
49
|
-
if (!(
|
|
26
|
+
if (!("console" in GLOBAL_OBJ)) {
|
|
50
27
|
return;
|
|
51
28
|
}
|
|
52
|
-
|
|
53
|
-
CONSOLE_LEVELS.forEach(function (level) {
|
|
29
|
+
CONSOLE_LEVELS.forEach(function(level) {
|
|
54
30
|
if (!(level in GLOBAL_OBJ.console)) {
|
|
55
31
|
return;
|
|
56
32
|
}
|
|
57
|
-
|
|
58
|
-
fill(GLOBAL_OBJ.console, level, function (originalConsoleMethod) {
|
|
33
|
+
fill(GLOBAL_OBJ.console, level, function(originalConsoleMethod) {
|
|
59
34
|
originalConsoleMethods[level] = originalConsoleMethod;
|
|
60
|
-
|
|
61
|
-
return function (...args) {
|
|
35
|
+
return function(...args) {
|
|
62
36
|
const firstArg = args[0];
|
|
63
37
|
const log = originalConsoleMethods[level];
|
|
64
|
-
|
|
65
|
-
const isFiltered = _filter.size && typeof firstArg === 'string' && stringMatchesSomePattern(firstArg, _filter);
|
|
66
|
-
|
|
67
|
-
// Only trigger handlers for non-filtered messages
|
|
38
|
+
const isFiltered = _filter.size && typeof firstArg === "string" && stringMatchesSomePattern(firstArg, _filter);
|
|
68
39
|
if (!isFiltered) {
|
|
69
|
-
triggerHandlers(
|
|
40
|
+
triggerHandlers("console", { args, level });
|
|
70
41
|
}
|
|
71
|
-
|
|
72
|
-
// Only log filtered messages in debug mode
|
|
73
|
-
if (!isFiltered || (DEBUG_BUILD && debug.isEnabled())) {
|
|
74
|
-
// Call original console method
|
|
42
|
+
if (!isFiltered || DEBUG_BUILD && debug.isEnabled()) {
|
|
75
43
|
log?.apply(GLOBAL_OBJ.console, args);
|
|
76
44
|
}
|
|
77
45
|
};
|