@sentry/core 10.53.0 → 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/browser.d.ts +4 -0
- 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 +63 -165
- 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 +64 -166
- 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 +6 -4
- 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 +6 -4
- 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 +10 -2
- package/server.d.ts +4 -0
- 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
|
@@ -2,35 +2,14 @@ import { DEBUG_BUILD } from '../debug-build.js';
|
|
|
2
2
|
import { debug } from './debug-logger.js';
|
|
3
3
|
import { isString } from './is.js';
|
|
4
4
|
|
|
5
|
-
const SENTRY_BAGGAGE_KEY_PREFIX =
|
|
6
|
-
|
|
5
|
+
const SENTRY_BAGGAGE_KEY_PREFIX = "sentry-";
|
|
7
6
|
const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Max length of a serialized baggage string
|
|
11
|
-
*
|
|
12
|
-
* https://www.w3.org/TR/baggage/#limits
|
|
13
|
-
*/
|
|
14
7
|
const MAX_BAGGAGE_STRING_LENGTH = 8192;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values
|
|
18
|
-
* from it.
|
|
19
|
-
*
|
|
20
|
-
* @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.
|
|
21
|
-
* @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.
|
|
22
|
-
*/
|
|
23
|
-
function baggageHeaderToDynamicSamplingContext(
|
|
24
|
-
// Very liberal definition of what any incoming header might look like
|
|
25
|
-
baggageHeader,
|
|
26
|
-
) {
|
|
8
|
+
function baggageHeaderToDynamicSamplingContext(baggageHeader) {
|
|
27
9
|
const baggageObject = parseBaggageHeader(baggageHeader);
|
|
28
|
-
|
|
29
10
|
if (!baggageObject) {
|
|
30
|
-
return
|
|
11
|
+
return void 0;
|
|
31
12
|
}
|
|
32
|
-
|
|
33
|
-
// Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object.
|
|
34
13
|
const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => {
|
|
35
14
|
if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {
|
|
36
15
|
const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);
|
|
@@ -38,34 +17,16 @@ function baggageHeaderToDynamicSamplingContext(
|
|
|
38
17
|
}
|
|
39
18
|
return acc;
|
|
40
19
|
}, {});
|
|
41
|
-
|
|
42
|
-
// Only return a dynamic sampling context object if there are keys in it.
|
|
43
|
-
// A keyless object means there were no sentry values on the header, which means that there is no DSC.
|
|
44
20
|
if (Object.keys(dynamicSamplingContext).length > 0) {
|
|
45
|
-
return dynamicSamplingContext
|
|
21
|
+
return dynamicSamplingContext;
|
|
46
22
|
} else {
|
|
47
|
-
return
|
|
23
|
+
return void 0;
|
|
48
24
|
}
|
|
49
25
|
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-".
|
|
53
|
-
*
|
|
54
|
-
* @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility
|
|
55
|
-
* with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is
|
|
56
|
-
* `undefined` the function will return `undefined`.
|
|
57
|
-
* @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`
|
|
58
|
-
* was `undefined`, or if `dynamicSamplingContext` didn't contain any values.
|
|
59
|
-
*/
|
|
60
|
-
function dynamicSamplingContextToSentryBaggageHeader(
|
|
61
|
-
// this also takes undefined for convenience and bundle size in other places
|
|
62
|
-
dynamicSamplingContext,
|
|
63
|
-
) {
|
|
26
|
+
function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) {
|
|
64
27
|
if (!dynamicSamplingContext) {
|
|
65
|
-
return
|
|
28
|
+
return void 0;
|
|
66
29
|
}
|
|
67
|
-
|
|
68
|
-
// Prefix all DSC keys with "sentry-" and put them into a new object
|
|
69
30
|
const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(
|
|
70
31
|
(acc, [dscKey, dscValue]) => {
|
|
71
32
|
if (dscValue) {
|
|
@@ -73,24 +34,15 @@ function dynamicSamplingContextToSentryBaggageHeader(
|
|
|
73
34
|
}
|
|
74
35
|
return acc;
|
|
75
36
|
},
|
|
76
|
-
{}
|
|
37
|
+
{}
|
|
77
38
|
);
|
|
78
|
-
|
|
79
39
|
return objectToBaggageHeader(sentryPrefixedDSC);
|
|
80
40
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*/
|
|
85
|
-
function parseBaggageHeader(
|
|
86
|
-
baggageHeader,
|
|
87
|
-
) {
|
|
88
|
-
if (!baggageHeader || (!isString(baggageHeader) && !Array.isArray(baggageHeader))) {
|
|
89
|
-
return undefined;
|
|
41
|
+
function parseBaggageHeader(baggageHeader) {
|
|
42
|
+
if (!baggageHeader || !isString(baggageHeader) && !Array.isArray(baggageHeader)) {
|
|
43
|
+
return void 0;
|
|
90
44
|
}
|
|
91
|
-
|
|
92
45
|
if (Array.isArray(baggageHeader)) {
|
|
93
|
-
// Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it
|
|
94
46
|
return baggageHeader.reduce((acc, curr) => {
|
|
95
47
|
const currBaggageObject = baggageHeaderToObject(curr);
|
|
96
48
|
Object.entries(currBaggageObject).forEach(([key, value]) => {
|
|
@@ -99,108 +51,57 @@ function parseBaggageHeader(
|
|
|
99
51
|
return acc;
|
|
100
52
|
}, {});
|
|
101
53
|
}
|
|
102
|
-
|
|
103
54
|
return baggageHeaderToObject(baggageHeader);
|
|
104
55
|
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Will parse a baggage header, which is a simple key-value map, into a flat object.
|
|
108
|
-
*
|
|
109
|
-
* @param baggageHeader The baggage header to parse.
|
|
110
|
-
* @returns a flat object containing all the key-value pairs from `baggageHeader`.
|
|
111
|
-
*/
|
|
112
56
|
function baggageHeaderToObject(baggageHeader) {
|
|
113
|
-
return baggageHeader
|
|
114
|
-
.
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return decodeURIComponent(keyOrValue.trim());
|
|
126
|
-
} catch {
|
|
127
|
-
// We ignore errors here, e.g. if the value cannot be URL decoded.
|
|
128
|
-
// This will then be skipped in the next step
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
})
|
|
133
|
-
.reduce((acc, [key, value]) => {
|
|
134
|
-
if (key && value) {
|
|
135
|
-
acc[key] = value;
|
|
57
|
+
return baggageHeader.split(",").map((baggageEntry) => {
|
|
58
|
+
const eqIdx = baggageEntry.indexOf("=");
|
|
59
|
+
if (eqIdx === -1) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
const key = baggageEntry.slice(0, eqIdx);
|
|
63
|
+
const value = baggageEntry.slice(eqIdx + 1);
|
|
64
|
+
return [key, value].map((keyOrValue) => {
|
|
65
|
+
try {
|
|
66
|
+
return decodeURIComponent(keyOrValue.trim());
|
|
67
|
+
} catch {
|
|
68
|
+
return;
|
|
136
69
|
}
|
|
137
|
-
|
|
138
|
-
|
|
70
|
+
});
|
|
71
|
+
}).reduce((acc, [key, value]) => {
|
|
72
|
+
if (key && value) {
|
|
73
|
+
acc[key] = value;
|
|
74
|
+
}
|
|
75
|
+
return acc;
|
|
76
|
+
}, {});
|
|
139
77
|
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.
|
|
143
|
-
*
|
|
144
|
-
* @param object The object to turn into a baggage header.
|
|
145
|
-
* @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header
|
|
146
|
-
* is not spec compliant.
|
|
147
|
-
*/
|
|
148
78
|
function objectToBaggageHeader(object) {
|
|
149
79
|
if (Object.keys(object).length === 0) {
|
|
150
|
-
|
|
151
|
-
return undefined;
|
|
80
|
+
return void 0;
|
|
152
81
|
}
|
|
153
|
-
|
|
154
82
|
return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {
|
|
155
83
|
const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;
|
|
156
84
|
const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;
|
|
157
85
|
if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {
|
|
158
|
-
DEBUG_BUILD &&
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
);
|
|
86
|
+
DEBUG_BUILD && debug.warn(
|
|
87
|
+
`Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`
|
|
88
|
+
);
|
|
162
89
|
return baggageHeader;
|
|
163
90
|
} else {
|
|
164
91
|
return newBaggageHeader;
|
|
165
92
|
}
|
|
166
|
-
},
|
|
93
|
+
}, "");
|
|
167
94
|
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Merge two baggage headers into one.
|
|
171
|
-
* - Sentry-specific entries (keys starting with "sentry-") from the new
|
|
172
|
-
* baggage take precedence
|
|
173
|
-
* - Non-Sentry entries from existing baggage take precedence
|
|
174
|
-
*
|
|
175
|
-
* The order of the existing baggage will be preserved, and new entries will
|
|
176
|
-
* be added to the end.
|
|
177
|
-
*
|
|
178
|
-
* This matches the behavior of OTEL's propagation.inject() which uses
|
|
179
|
-
* `baggage.setEntry()` to overwrite existing entries with the same key.
|
|
180
|
-
*/
|
|
181
|
-
function mergeBaggageHeaders(
|
|
182
|
-
existing,
|
|
183
|
-
incoming,
|
|
184
|
-
) {
|
|
95
|
+
function mergeBaggageHeaders(existing, incoming) {
|
|
185
96
|
if (!existing) {
|
|
186
97
|
return incoming;
|
|
187
98
|
}
|
|
188
|
-
|
|
189
99
|
const existingEntries = parseBaggageHeader(existing);
|
|
190
100
|
const incomingEntries = parseBaggageHeader(incoming);
|
|
191
|
-
|
|
192
101
|
if (!incomingEntries) {
|
|
193
102
|
return existing;
|
|
194
103
|
}
|
|
195
|
-
|
|
196
|
-
// 1. All non-sentry entries from existing are kept
|
|
197
|
-
// 2. All sentry- entries from the new baggage are retained
|
|
198
|
-
// 3. If sentry- entries present in new, ignore from old, else keep from old.
|
|
199
|
-
// 4. Non-sentry entries from new are only kept if not in existing.
|
|
200
|
-
|
|
201
104
|
const merged = {};
|
|
202
|
-
|
|
203
|
-
// partition incoming entries into sentry and non-sentry prefixed
|
|
204
105
|
let hasNewSentryEntries = false;
|
|
205
106
|
const newSentryEntries = {};
|
|
206
107
|
const newNonSentryEntries = {};
|
|
@@ -212,11 +113,6 @@ function mergeBaggageHeaders(
|
|
|
212
113
|
newNonSentryEntries[key] = value;
|
|
213
114
|
}
|
|
214
115
|
}
|
|
215
|
-
|
|
216
|
-
// If new baggage contains at least one sentry- value, we remove all old
|
|
217
|
-
// sentry- values otherwise, we keep old sentry- values. If we don't remove
|
|
218
|
-
// old sentry- values, we end up with an inconsistent dynamic sampling
|
|
219
|
-
// context propagation.
|
|
220
116
|
if (existingEntries) {
|
|
221
117
|
for (const [key, value] of Object.entries(existingEntries)) {
|
|
222
118
|
if (!hasNewSentryEntries || !key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {
|
|
@@ -224,17 +120,12 @@ function mergeBaggageHeaders(
|
|
|
224
120
|
}
|
|
225
121
|
}
|
|
226
122
|
}
|
|
227
|
-
|
|
228
|
-
// Assign new sentry fields.
|
|
229
123
|
if (hasNewSentryEntries) {
|
|
230
124
|
Object.assign(merged, newSentryEntries);
|
|
231
125
|
}
|
|
232
|
-
|
|
233
|
-
// assign new non-sentry fields not found on existing object.
|
|
234
126
|
for (const [key, value] of Object.entries(newNonSentryEntries)) {
|
|
235
|
-
merged[key]
|
|
127
|
+
merged[key] ?? (merged[key] = value);
|
|
236
128
|
}
|
|
237
|
-
|
|
238
129
|
return objectToBaggageHeader(merged);
|
|
239
130
|
}
|
|
240
131
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baggage.js","sources":["../../../src/utils/baggage.ts"],"sourcesContent":["import { DEBUG_BUILD } from '../debug-build';\nimport type { DynamicSamplingContext } from '../types-hoist/envelope';\nimport { debug } from './debug-logger';\nimport { isString } from './is';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nexport const MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nexport function baggageHeaderToDynamicSamplingContext(\n // Very liberal definition of what any incoming header might look like\n baggageHeader: string | string[] | number | null | undefined | boolean,\n): Partial<DynamicSamplingContext> | undefined {\n const baggageObject = parseBaggageHeader(baggageHeader);\n\n if (!baggageObject) {\n return undefined;\n }\n\n // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n const dynamicSamplingContext = Object.entries(baggageObject).reduce<Record<string, string>>((acc, [key, value]) => {\n if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n acc[nonPrefixedKey] = value;\n }\n return acc;\n }, {});\n\n // Only return a dynamic sampling context object if there are keys in it.\n // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n if (Object.keys(dynamicSamplingContext).length > 0) {\n return dynamicSamplingContext as Partial<DynamicSamplingContext>;\n } else {\n return undefined;\n }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nexport function dynamicSamplingContextToSentryBaggageHeader(\n // this also takes undefined for convenience and bundle size in other places\n dynamicSamplingContext?: Partial<DynamicSamplingContext>,\n): string | undefined {\n if (!dynamicSamplingContext) {\n return undefined;\n }\n\n // Prefix all DSC keys with \"sentry-\" and put them into a new object\n const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce<Record<string, string>>(\n (acc, [dscKey, dscValue]) => {\n if (dscValue) {\n acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n }\n return acc;\n },\n {},\n );\n\n return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Take a baggage header and parse it into an object.\n */\nexport function parseBaggageHeader(\n baggageHeader: string | string[] | number | null | undefined | boolean,\n): Record<string, string> | undefined {\n if (!baggageHeader || (!isString(baggageHeader) && !Array.isArray(baggageHeader))) {\n return undefined;\n }\n\n if (Array.isArray(baggageHeader)) {\n // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n return baggageHeader.reduce<Record<string, string>>((acc, curr) => {\n const currBaggageObject = baggageHeaderToObject(curr);\n Object.entries(currBaggageObject).forEach(([key, value]) => {\n acc[key] = value;\n });\n return acc;\n }, {});\n }\n\n return baggageHeaderToObject(baggageHeader);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader: string): Record<string, string> {\n return baggageHeader\n .split(',')\n .map(baggageEntry => {\n const eqIdx = baggageEntry.indexOf('=');\n if (eqIdx === -1) {\n // Likely an invalid entry\n return [];\n }\n const key = baggageEntry.slice(0, eqIdx);\n const value = baggageEntry.slice(eqIdx + 1);\n return [key, value].map(keyOrValue => {\n try {\n return decodeURIComponent(keyOrValue.trim());\n } catch {\n // We ignore errors here, e.g. if the value cannot be URL decoded.\n // This will then be skipped in the next step\n return;\n }\n });\n })\n .reduce<Record<string, string>>((acc, [key, value]) => {\n if (key && value) {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nexport function objectToBaggageHeader(object: Record<string, string>): string | undefined {\n if (Object.keys(object).length === 0) {\n // An empty baggage header is not spec compliant: We return undefined.\n return undefined;\n }\n\n return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n DEBUG_BUILD &&\n debug.warn(\n `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n );\n return baggageHeader;\n } else {\n return newBaggageHeader;\n }\n }, '');\n}\n\n/**\n * Merge two baggage headers into one.\n * - Sentry-specific entries (keys starting with \"sentry-\") from the new\n * baggage take precedence\n * - Non-Sentry entries from existing baggage take precedence\n *\n * The order of the existing baggage will be preserved, and new entries will\n * be added to the end.\n *\n * This matches the behavior of OTEL's propagation.inject() which uses\n * `baggage.setEntry()` to overwrite existing entries with the same key.\n */\nexport function mergeBaggageHeaders<Existing extends string | string[] | number | undefined>(\n existing: Existing,\n incoming: string,\n): string | undefined | Existing {\n if (!existing) {\n return incoming;\n }\n\n const existingEntries = parseBaggageHeader(existing);\n const incomingEntries = parseBaggageHeader(incoming);\n\n if (!incomingEntries) {\n return existing;\n }\n\n // 1. All non-sentry entries from existing are kept\n // 2. All sentry- entries from the new baggage are retained\n // 3. If sentry- entries present in new, ignore from old, else keep from old.\n // 4. Non-sentry entries from new are only kept if not in existing.\n\n const merged: Record<string, string> = {};\n\n // partition incoming entries into sentry and non-sentry prefixed\n let hasNewSentryEntries = false;\n const newSentryEntries: Record<string, string> = {};\n const newNonSentryEntries: Record<string, string> = {};\n for (const [key, value] of Object.entries(incomingEntries)) {\n if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n newSentryEntries[key] = value;\n hasNewSentryEntries = true;\n } else {\n newNonSentryEntries[key] = value;\n }\n }\n\n // If new baggage contains at least one sentry- value, we remove all old\n // sentry- values otherwise, we keep old sentry- values. If we don't remove\n // old sentry- values, we end up with an inconsistent dynamic sampling\n // context propagation.\n if (existingEntries) {\n for (const [key, value] of Object.entries(existingEntries)) {\n if (!hasNewSentryEntries || !key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n merged[key] = value;\n }\n }\n }\n\n // Assign new sentry fields.\n if (hasNewSentryEntries) {\n Object.assign(merged, newSentryEntries);\n }\n\n // assign new non-sentry fields not found on existing object.\n for (const [key, value] of Object.entries(newNonSentryEntries)) {\n merged[key] ??= value;\n }\n\n return objectToBaggageHeader(merged);\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,yBAAA,GAA4B;;AAElC,MAAM,+BAAA,GAAkC;;AAE/C;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAA,GAA4B;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,qCAAqC;AACrD;AACA,EAAE,aAAa;AACf,EAA+C;AAC/C,EAAE,MAAM,aAAA,GAAgB,kBAAkB,CAAC,aAAa,CAAC;;AAEzD,EAAE,IAAI,CAAC,aAAa,EAAE;AACtB,IAAI,OAAO,SAAS;AACpB,EAAE;;AAEF;AACA,EAAE,MAAM,yBAAyB,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,MAAM,CAAyB,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACrH,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,yBAAyB,CAAC,EAAE;AACnD,MAAM,MAAM,cAAA,GAAiB,GAAG,CAAC,KAAK,CAAC,yBAAyB,CAAC,MAAM,CAAC;AACxE,MAAM,GAAG,CAAC,cAAc,CAAA,GAAI,KAAK;AACjC,IAAI;AACJ,IAAI,OAAO,GAAG;AACd,EAAE,CAAC,EAAE,EAAE,CAAC;;AAER;AACA;AACA,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,MAAA,GAAS,CAAC,EAAE;AACtD,IAAI,OAAO,sBAAA;AACX,EAAE,OAAO;AACT,IAAI,OAAO,SAAS;AACpB,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,2CAA2C;AAC3D;AACA,EAAE,sBAAsB;AACxB,EAAsB;AACtB,EAAE,IA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BAAA,CAAA,EAAA;AACA,MAAA,gBAAA,CAAA,GAAA,CAAA,GAAA,KAAA;AACA,MAAA,mBAAA,GAAA,IAAA;AACA,IAAA,CAAA,MAAA;AACA,MAAA,mBAAA,CAAA,GAAA,CAAA,GAAA,KAAA;AACA,IAAA;AACA,EAAA;;AAEA;AACA;AACA;AACA;AACA,EAAA,IAAA,eAAA,EAAA;AACA,IAAA,KAAA,MAAA,CAAA,GAAA,EAAA,KAAA,CAAA,IAAA,MAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA;AACA,MAAA,IAAA,CAAA,mBAAA,IAAA,CAAA,GAAA,CAAA,UAAA,CAAA,yBAAA,CAAA,EAAA;AACA,QAAA,MAAA,CAAA,GAAA,CAAA,GAAA,KAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA;;AAEA;AACA,EAAA,IAAA,mBAAA,EAAA;AACA,IAAA,MAAA,CAAA,MAAA,CAAA,MAAA,EAAA,gBAAA,CAAA;AACA,EAAA;;AAEA;AACA,EAAA,KAAA,MAAA,CAAA,GAAA,EAAA,KAAA,CAAA,IAAA,MAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA;AACA,IAAA,MAAA,CAAA,GAAA,CAAA,KAAA,KAAA;AACA,EAAA;;AAEA,EAAA,OAAA,qBAAA,CAAA,MAAA,CAAA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"baggage.js","sources":["../../../src/utils/baggage.ts"],"sourcesContent":["import { DEBUG_BUILD } from '../debug-build';\nimport type { DynamicSamplingContext } from '../types/envelope';\nimport { debug } from './debug-logger';\nimport { isString } from './is';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nexport const MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nexport function baggageHeaderToDynamicSamplingContext(\n // Very liberal definition of what any incoming header might look like\n baggageHeader: string | string[] | number | null | undefined | boolean,\n): Partial<DynamicSamplingContext> | undefined {\n const baggageObject = parseBaggageHeader(baggageHeader);\n\n if (!baggageObject) {\n return undefined;\n }\n\n // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n const dynamicSamplingContext = Object.entries(baggageObject).reduce<Record<string, string>>((acc, [key, value]) => {\n if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n acc[nonPrefixedKey] = value;\n }\n return acc;\n }, {});\n\n // Only return a dynamic sampling context object if there are keys in it.\n // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n if (Object.keys(dynamicSamplingContext).length > 0) {\n return dynamicSamplingContext as Partial<DynamicSamplingContext>;\n } else {\n return undefined;\n }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nexport function dynamicSamplingContextToSentryBaggageHeader(\n // this also takes undefined for convenience and bundle size in other places\n dynamicSamplingContext?: Partial<DynamicSamplingContext>,\n): string | undefined {\n if (!dynamicSamplingContext) {\n return undefined;\n }\n\n // Prefix all DSC keys with \"sentry-\" and put them into a new object\n const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce<Record<string, string>>(\n (acc, [dscKey, dscValue]) => {\n if (dscValue) {\n acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n }\n return acc;\n },\n {},\n );\n\n return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Take a baggage header and parse it into an object.\n */\nexport function parseBaggageHeader(\n baggageHeader: string | string[] | number | null | undefined | boolean,\n): Record<string, string> | undefined {\n if (!baggageHeader || (!isString(baggageHeader) && !Array.isArray(baggageHeader))) {\n return undefined;\n }\n\n if (Array.isArray(baggageHeader)) {\n // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n return baggageHeader.reduce<Record<string, string>>((acc, curr) => {\n const currBaggageObject = baggageHeaderToObject(curr);\n Object.entries(currBaggageObject).forEach(([key, value]) => {\n acc[key] = value;\n });\n return acc;\n }, {});\n }\n\n return baggageHeaderToObject(baggageHeader);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader: string): Record<string, string> {\n return baggageHeader\n .split(',')\n .map(baggageEntry => {\n const eqIdx = baggageEntry.indexOf('=');\n if (eqIdx === -1) {\n // Likely an invalid entry\n return [];\n }\n const key = baggageEntry.slice(0, eqIdx);\n const value = baggageEntry.slice(eqIdx + 1);\n return [key, value].map(keyOrValue => {\n try {\n return decodeURIComponent(keyOrValue.trim());\n } catch {\n // We ignore errors here, e.g. if the value cannot be URL decoded.\n // This will then be skipped in the next step\n return;\n }\n });\n })\n .reduce<Record<string, string>>((acc, [key, value]) => {\n if (key && value) {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nexport function objectToBaggageHeader(object: Record<string, string>): string | undefined {\n if (Object.keys(object).length === 0) {\n // An empty baggage header is not spec compliant: We return undefined.\n return undefined;\n }\n\n return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n DEBUG_BUILD &&\n debug.warn(\n `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n );\n return baggageHeader;\n } else {\n return newBaggageHeader;\n }\n }, '');\n}\n\n/**\n * Merge two baggage headers into one.\n * - Sentry-specific entries (keys starting with \"sentry-\") from the new\n * baggage take precedence\n * - Non-Sentry entries from existing baggage take precedence\n *\n * The order of the existing baggage will be preserved, and new entries will\n * be added to the end.\n *\n * This matches the behavior of OTEL's propagation.inject() which uses\n * `baggage.setEntry()` to overwrite existing entries with the same key.\n */\nexport function mergeBaggageHeaders<Existing extends string | string[] | number | undefined>(\n existing: Existing,\n incoming: string,\n): string | undefined | Existing {\n if (!existing) {\n return incoming;\n }\n\n const existingEntries = parseBaggageHeader(existing);\n const incomingEntries = parseBaggageHeader(incoming);\n\n if (!incomingEntries) {\n return existing;\n }\n\n // 1. All non-sentry entries from existing are kept\n // 2. All sentry- entries from the new baggage are retained\n // 3. If sentry- entries present in new, ignore from old, else keep from old.\n // 4. Non-sentry entries from new are only kept if not in existing.\n\n const merged: Record<string, string> = {};\n\n // partition incoming entries into sentry and non-sentry prefixed\n let hasNewSentryEntries = false;\n const newSentryEntries: Record<string, string> = {};\n const newNonSentryEntries: Record<string, string> = {};\n for (const [key, value] of Object.entries(incomingEntries)) {\n if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n newSentryEntries[key] = value;\n hasNewSentryEntries = true;\n } else {\n newNonSentryEntries[key] = value;\n }\n }\n\n // If new baggage contains at least one sentry- value, we remove all old\n // sentry- values otherwise, we keep old sentry- values. If we don't remove\n // old sentry- values, we end up with an inconsistent dynamic sampling\n // context propagation.\n if (existingEntries) {\n for (const [key, value] of Object.entries(existingEntries)) {\n if (!hasNewSentryEntries || !key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) {\n merged[key] = value;\n }\n }\n }\n\n // Assign new sentry fields.\n if (hasNewSentryEntries) {\n Object.assign(merged, newSentryEntries);\n }\n\n // assign new non-sentry fields not found on existing object.\n for (const [key, value] of Object.entries(newNonSentryEntries)) {\n merged[key] ??= value;\n }\n\n return objectToBaggageHeader(merged);\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,yBAAA,GAA4B;AAElC,MAAM,+BAAA,GAAkC;AAOxC,MAAM,yBAAA,GAA4B;AASlC,SAAS,sCAEd,aAAA,EAC6C;AAC7C,EAAA,MAAM,aAAA,GAAgB,mBAAmB,aAAa,CAAA;AAEtD,EAAA,IAAI,CAAC,aAAA,EAAe;AAClB,IAAA,OAAO,MAAA;AAAA,EACT;AAGA,EAAA,MAAM,sBAAA,GAAyB,MAAA,CAAO,OAAA,CAAQ,aAAa,CAAA,CAAE,MAAA,CAA+B,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,KAAK,CAAA,KAAM;AACjH,IAAA,IAAI,GAAA,CAAI,UAAA,CAAW,yBAAyB,CAAA,EAAG;AAC7C,MAAA,MAAM,cAAA,GAAiB,GAAA,CAAI,KAAA,CAAM,yBAAA,CAA0B,MAAM,CAAA;AACjE,MAAA,GAAA,CAAI,cAAc,CAAA,GAAI,KAAA;AAAA,IACxB;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA,EAAG,EAAE,CAAA;AAIL,EAAA,IAAI,MAAA,CAAO,IAAA,CAAK,sBAAsB,CAAA,CAAE,SAAS,CAAA,EAAG;AAClD,IAAA,OAAO,sBAAA;AAAA,EACT,CAAA,MAAO;AACL,IAAA,OAAO,MAAA;AAAA,EACT;AACF;AAWO,SAAS,4CA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AK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,eAAe,CAAA,EAAG;AAC1D,MAAA,IAAI,CAAC,mBAAA,IAAuB,CAAC,GAAA,CAAI,UAAA,CAAW,yBAAyB,CAAA,EAAG;AACtE,QAAA,MAAA,CAAO,GAAG,CAAA,GAAI,KAAA;AAAA,MAChB;AAAA,IACF;AAAA,EACF;AAGA,EAAA,IAAI,mBAAA,EAAqB;AACvB,IAAA,MAAA,CAAO,MAAA,CAAO,QAAQ,gBAAgB,CAAA;AAAA,EACxC;AAGA,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,MAAA,CAAO,OAAA,CAAQ,mBAAmB,CAAA,EAAG;AAC9D,IAAA,MAAA,CAAA,GAAA,CAAA,KAAA,MAAA,CAAA,GAAA,CAAA,GAAgB,KAAA,CAAA;AAAA,EAClB;AAEA,EAAA,OAAO,sBAAsB,MAAM,CAAA;AACrC;;;;"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code.
|
|
3
|
-
*/
|
|
4
1
|
function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return undefined;
|
|
2
|
+
if (statusCode === void 0) {
|
|
3
|
+
return void 0;
|
|
8
4
|
} else if (statusCode >= 400 && statusCode < 500) {
|
|
9
|
-
return
|
|
5
|
+
return "warning";
|
|
10
6
|
} else if (statusCode >= 500) {
|
|
11
|
-
return
|
|
7
|
+
return "error";
|
|
12
8
|
} else {
|
|
13
|
-
return
|
|
9
|
+
return void 0;
|
|
14
10
|
}
|
|
15
11
|
}
|
|
16
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb-log-level.js","sources":["../../../src/utils/breadcrumb-log-level.ts"],"sourcesContent":["import type { SeverityLevel } from '../types
|
|
1
|
+
{"version":3,"file":"breadcrumb-log-level.js","sources":["../../../src/utils/breadcrumb-log-level.ts"],"sourcesContent":["import type { SeverityLevel } from '../types/severity';\n\n/**\n * Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code.\n */\nexport function getBreadcrumbLogLevelFromHttpStatusCode(statusCode: number | undefined): SeverityLevel | undefined {\n // NOTE: undefined defaults to 'info' in Sentry\n if (statusCode === undefined) {\n return undefined;\n } else if (statusCode >= 400 && statusCode < 500) {\n return 'warning';\n } else if (statusCode >= 500) {\n return 'error';\n } else {\n return undefined;\n }\n}\n"],"names":[],"mappings":"AAKO,SAAS,wCAAwC,UAAA,EAA2D;AAEjH,EAAA,IAAI,eAAe,MAAA,EAAW;AAC5B,IAAA,OAAO,MAAA;AAAA,EACT,CAAA,MAAA,IAAW,UAAA,IAAc,GAAA,IAAO,UAAA,GAAa,GAAA,EAAK;AAChD,IAAA,OAAO,SAAA;AAAA,EACT,CAAA,MAAA,IAAW,cAAc,GAAA,EAAK;AAC5B,IAAA,OAAO,OAAA;AAAA,EACT,CAAA,MAAO;AACL,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
|
|
@@ -1,107 +1,63 @@
|
|
|
1
1
|
import { isString } from './is.js';
|
|
2
2
|
import { GLOBAL_OBJ } from './worldwide.js';
|
|
3
3
|
|
|
4
|
-
const WINDOW = GLOBAL_OBJ
|
|
5
|
-
|
|
4
|
+
const WINDOW = GLOBAL_OBJ;
|
|
6
5
|
const DEFAULT_MAX_STRING_LENGTH = 80;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Given a child DOM element, returns a query-selector statement describing that
|
|
10
|
-
* and its ancestors
|
|
11
|
-
* e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
|
|
12
|
-
* @returns generated DOM path
|
|
13
|
-
*/
|
|
14
|
-
function htmlTreeAsString(
|
|
15
|
-
elem,
|
|
16
|
-
options = {},
|
|
17
|
-
) {
|
|
6
|
+
function htmlTreeAsString(elem, options = {}) {
|
|
18
7
|
if (!elem) {
|
|
19
|
-
return
|
|
8
|
+
return "<unknown>";
|
|
20
9
|
}
|
|
21
|
-
|
|
22
|
-
// try/catch both:
|
|
23
|
-
// - accessing event.target (see getsentry/raven-js#838, #768)
|
|
24
|
-
// - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
|
|
25
|
-
// - can throw an exception in some circumstances.
|
|
26
10
|
try {
|
|
27
|
-
let currentElem = elem
|
|
11
|
+
let currentElem = elem;
|
|
28
12
|
const MAX_TRAVERSE_HEIGHT = 5;
|
|
29
13
|
const out = [];
|
|
30
14
|
let height = 0;
|
|
31
15
|
let len = 0;
|
|
32
|
-
const separator =
|
|
16
|
+
const separator = " > ";
|
|
33
17
|
const sepLength = separator.length;
|
|
34
18
|
let nextStr;
|
|
35
19
|
const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;
|
|
36
|
-
const maxStringLength =
|
|
37
|
-
|
|
20
|
+
const maxStringLength = !Array.isArray(options) && options.maxStringLength || DEFAULT_MAX_STRING_LENGTH;
|
|
38
21
|
while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
|
|
39
22
|
nextStr = _htmlElementAsString(currentElem, keyAttrs);
|
|
40
|
-
|
|
41
|
-
// - nextStr is the 'html' element
|
|
42
|
-
// - the length of the string that would be created exceeds maxStringLength
|
|
43
|
-
// (ignore this limit if we are on the first iteration)
|
|
44
|
-
if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {
|
|
23
|
+
if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) {
|
|
45
24
|
break;
|
|
46
25
|
}
|
|
47
|
-
|
|
48
26
|
out.push(nextStr);
|
|
49
|
-
|
|
50
27
|
len += nextStr.length;
|
|
51
28
|
currentElem = currentElem.parentNode;
|
|
52
29
|
}
|
|
53
|
-
|
|
54
30
|
return out.reverse().join(separator);
|
|
55
31
|
} catch {
|
|
56
|
-
return
|
|
32
|
+
return "<unknown>";
|
|
57
33
|
}
|
|
58
34
|
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Returns a simple, query-selector representation of a DOM element
|
|
62
|
-
* e.g. [HTMLElement] => input#foo.btn[name=baz]
|
|
63
|
-
* @returns generated DOM path
|
|
64
|
-
*/
|
|
65
35
|
function _htmlElementAsString(el, keyAttrs) {
|
|
66
|
-
const elem = el
|
|
67
|
-
|
|
68
|
-
;
|
|
69
|
-
|
|
36
|
+
const elem = el;
|
|
70
37
|
const out = [];
|
|
71
|
-
|
|
72
38
|
if (!elem?.tagName) {
|
|
73
|
-
return
|
|
39
|
+
return "";
|
|
74
40
|
}
|
|
75
|
-
|
|
76
|
-
// @ts-expect-error WINDOW has HTMLElement
|
|
77
41
|
if (WINDOW.HTMLElement) {
|
|
78
|
-
// If using the component name annotation plugin, this value may be available on the DOM node
|
|
79
42
|
if (elem instanceof HTMLElement && elem.dataset) {
|
|
80
|
-
if (elem.dataset[
|
|
81
|
-
return elem.dataset[
|
|
43
|
+
if (elem.dataset["sentryComponent"]) {
|
|
44
|
+
return elem.dataset["sentryComponent"];
|
|
82
45
|
}
|
|
83
|
-
if (elem.dataset[
|
|
84
|
-
return elem.dataset[
|
|
46
|
+
if (elem.dataset["sentryElement"]) {
|
|
47
|
+
return elem.dataset["sentryElement"];
|
|
85
48
|
}
|
|
86
49
|
}
|
|
87
50
|
}
|
|
88
|
-
|
|
89
51
|
out.push(elem.tagName.toLowerCase());
|
|
90
|
-
|
|
91
|
-
// Pairs of attribute keys defined in `serializeAttribute` and their values on element.
|
|
92
|
-
const keyAttrPairs = keyAttrs?.length
|
|
93
|
-
? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])
|
|
94
|
-
: null;
|
|
95
|
-
|
|
52
|
+
const keyAttrPairs = keyAttrs?.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null;
|
|
96
53
|
if (keyAttrPairs?.length) {
|
|
97
|
-
keyAttrPairs.forEach(keyAttrPair => {
|
|
54
|
+
keyAttrPairs.forEach((keyAttrPair) => {
|
|
98
55
|
out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`);
|
|
99
56
|
});
|
|
100
57
|
} else {
|
|
101
58
|
if (elem.id) {
|
|
102
59
|
out.push(`#${elem.id}`);
|
|
103
60
|
}
|
|
104
|
-
|
|
105
61
|
const className = elem.className;
|
|
106
62
|
if (className && isString(className)) {
|
|
107
63
|
const classes = className.split(/\s+/);
|
|
@@ -110,58 +66,40 @@ function _htmlElementAsString(el, keyAttrs) {
|
|
|
110
66
|
}
|
|
111
67
|
}
|
|
112
68
|
}
|
|
113
|
-
for (const k of [
|
|
69
|
+
for (const k of ["aria-label", "type", "name", "title", "alt"]) {
|
|
114
70
|
const attr = elem.getAttribute(k);
|
|
115
71
|
if (attr) {
|
|
116
72
|
out.push(`[${k}="${attr}"]`);
|
|
117
73
|
}
|
|
118
74
|
}
|
|
119
|
-
|
|
120
|
-
return out.join('');
|
|
75
|
+
return out.join("");
|
|
121
76
|
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* A safe form of location.href
|
|
125
|
-
*/
|
|
126
77
|
function getLocationHref() {
|
|
127
78
|
try {
|
|
128
79
|
return WINDOW.document.location.href;
|
|
129
80
|
} catch {
|
|
130
|
-
return
|
|
81
|
+
return "";
|
|
131
82
|
}
|
|
132
83
|
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Given a DOM element, traverses up the tree until it finds the first ancestor node
|
|
136
|
-
* that has the `data-sentry-component` or `data-sentry-element` attribute with `data-sentry-component` taking
|
|
137
|
-
* precedence. This attribute is added at build-time by projects that have the component name annotation plugin installed.
|
|
138
|
-
*
|
|
139
|
-
* @returns a string representation of the component for the provided DOM element, or `null` if not found
|
|
140
|
-
*/
|
|
141
84
|
function getComponentName(elem, maxTraverseHeight = 5) {
|
|
142
|
-
// @ts-expect-error WINDOW has HTMLElement
|
|
143
85
|
if (!WINDOW.HTMLElement) {
|
|
144
86
|
return null;
|
|
145
87
|
}
|
|
146
|
-
|
|
147
|
-
let currentElem = elem ;
|
|
88
|
+
let currentElem = elem;
|
|
148
89
|
for (let i = 0; i < maxTraverseHeight; i++) {
|
|
149
90
|
if (!currentElem) {
|
|
150
91
|
return null;
|
|
151
92
|
}
|
|
152
|
-
|
|
153
93
|
if (currentElem instanceof HTMLElement) {
|
|
154
|
-
if (currentElem.dataset[
|
|
155
|
-
return currentElem.dataset[
|
|
94
|
+
if (currentElem.dataset["sentryComponent"]) {
|
|
95
|
+
return currentElem.dataset["sentryComponent"];
|
|
156
96
|
}
|
|
157
|
-
if (currentElem.dataset[
|
|
158
|
-
return currentElem.dataset[
|
|
97
|
+
if (currentElem.dataset["sentryElement"]) {
|
|
98
|
+
return currentElem.dataset["sentryElement"];
|
|
159
99
|
}
|
|
160
100
|
}
|
|
161
|
-
|
|
162
101
|
currentElem = currentElem.parentNode;
|
|
163
102
|
}
|
|
164
|
-
|
|
165
103
|
return null;
|
|
166
104
|
}
|
|
167
105
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sources":["../../../src/utils/browser.ts"],"sourcesContent":["import { isString } from './is';\nimport { GLOBAL_OBJ } from './worldwide';\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\ntype SimpleNode = {\n parentNode: SimpleNode;\n} | null;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(\n elem: unknown,\n options: string[] | { keyAttrs?: string[]; maxStringLength?: number } = {},\n): string {\n if (!elem) {\n return '<unknown>';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch {\n return '<unknown>';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {\n const elem = el as {\n tagName?: string;\n id?: string;\n className?: string;\n getAttribute(key: string): string;\n };\n\n const out = [];\n\n if (!elem?.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset) {\n if (elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n if (elem.dataset['sentryElement']) {\n return elem.dataset['sentryElement'];\n }\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs = keyAttrs?.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs?.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n const className = elem.className;\n if (className && isString(className)) {\n const classes = className.split(/\\s+/);\n for (const c of classes) {\n out.push(`.${c}`);\n }\n }\n }\n for (const k of ['aria-label', 'type', 'name', 'title', 'alt']) {\n const attr = elem.getAttribute(k);\n if (attr) {\n out.push(`[${k}=\"${attr}\"]`);\n }\n }\n\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n try {\n return WINDOW.document.location.href;\n } catch {\n return '';\n }\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` or `data-sentry-element` attribute with `data-sentry-component` taking\n * precedence. This attribute is added at build-time by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nexport function getComponentName(elem: unknown, maxTraverseHeight: number = 5): string | null {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem as SimpleNode;\n for (let i = 0; i < maxTraverseHeight; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement) {\n if (currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n if (currentElem.dataset['sentryElement']) {\n return currentElem.dataset['sentryElement'];\n }\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,MAAA,GAAS,UAAA
|
|
1
|
+
{"version":3,"file":"browser.js","sources":["../../../src/utils/browser.ts"],"sourcesContent":["import { isString } from './is';\nimport { GLOBAL_OBJ } from './worldwide';\n\nconst WINDOW = GLOBAL_OBJ as unknown as Window;\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\ntype SimpleNode = {\n parentNode: SimpleNode;\n} | null;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(\n elem: unknown,\n options: string[] | { keyAttrs?: string[]; maxStringLength?: number } = {},\n): string {\n if (!elem) {\n return '<unknown>';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem as SimpleNode;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch {\n return '<unknown>';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {\n const elem = el as {\n tagName?: string;\n id?: string;\n className?: string;\n getAttribute(key: string): string;\n };\n\n const out = [];\n\n if (!elem?.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset) {\n if (elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n if (elem.dataset['sentryElement']) {\n return elem.dataset['sentryElement'];\n }\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs = keyAttrs?.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs?.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n const className = elem.className;\n if (className && isString(className)) {\n const classes = className.split(/\\s+/);\n for (const c of classes) {\n out.push(`.${c}`);\n }\n }\n }\n for (const k of ['aria-label', 'type', 'name', 'title', 'alt']) {\n const attr = elem.getAttribute(k);\n if (attr) {\n out.push(`[${k}=\"${attr}\"]`);\n }\n }\n\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n try {\n return WINDOW.document.location.href;\n } catch {\n return '';\n }\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` or `data-sentry-element` attribute with `data-sentry-component` taking\n * precedence. This attribute is added at build-time by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nexport function getComponentName(elem: unknown, maxTraverseHeight: number = 5): string | null {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem as SimpleNode;\n for (let i = 0; i < maxTraverseHeight; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement) {\n if (currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n if (currentElem.dataset['sentryElement']) {\n return currentElem.dataset['sentryElement'];\n }\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n"],"names":[],"mappings":";;;AAGA,MAAM,MAAA,GAAS,UAAA;AAEf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