@sentry/core 10.53.1 → 10.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/api.js +10 -34
- package/build/cjs/api.js.map +1 -1
- package/build/cjs/asyncContext/index.js +0 -14
- package/build/cjs/asyncContext/index.js.map +1 -1
- package/build/cjs/asyncContext/stackStrategy.js +16 -47
- package/build/cjs/asyncContext/stackStrategy.js.map +1 -1
- package/build/cjs/attributes.js +17 -95
- package/build/cjs/attributes.js.map +1 -1
- package/build/cjs/breadcrumbs.js +2 -22
- package/build/cjs/breadcrumbs.js.map +1 -1
- package/build/cjs/browser.js +12 -3
- package/build/cjs/browser.js.map +1 -1
- package/build/cjs/carrier.js +5 -42
- package/build/cjs/carrier.js.map +1 -1
- package/build/cjs/checkin.js +5 -19
- package/build/cjs/checkin.js.map +1 -1
- package/build/cjs/client.js +216 -585
- package/build/cjs/client.js.map +1 -1
- package/build/cjs/constants.js +2 -2
- package/build/cjs/currentScopes.js +5 -86
- package/build/cjs/currentScopes.js.map +1 -1
- package/build/cjs/debug-build.js +0 -5
- package/build/cjs/debug-build.js.map +1 -1
- package/build/cjs/defaultScopes.js +2 -5
- package/build/cjs/defaultScopes.js.map +1 -1
- package/build/cjs/envelope.js +32 -103
- package/build/cjs/envelope.js.map +1 -1
- package/build/cjs/eventProcessors.js +4 -23
- package/build/cjs/eventProcessors.js.map +1 -1
- package/build/cjs/exports.js +21 -197
- package/build/cjs/exports.js.map +1 -1
- package/build/cjs/feedback.js +7 -19
- package/build/cjs/feedback.js.map +1 -1
- package/build/cjs/fetch.js +66 -201
- package/build/cjs/fetch.js.map +1 -1
- package/build/cjs/index.js +17 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/instrument/console.js +9 -41
- package/build/cjs/instrument/console.js.map +1 -1
- package/build/cjs/instrument/fetch.js +47 -156
- package/build/cjs/instrument/fetch.js.map +1 -1
- package/build/cjs/instrument/globalError.js +4 -25
- package/build/cjs/instrument/globalError.js.map +1 -1
- package/build/cjs/instrument/globalUnhandledRejection.js +4 -21
- package/build/cjs/instrument/globalUnhandledRejection.js.map +1 -1
- package/build/cjs/instrument/handlers.js +9 -21
- package/build/cjs/instrument/handlers.js.map +1 -1
- package/build/cjs/integration.js +13 -77
- package/build/cjs/integration.js.map +1 -1
- package/build/cjs/integrations/captureconsole.js +16 -40
- package/build/cjs/integrations/captureconsole.js.map +1 -1
- package/build/cjs/integrations/consola.js +57 -163
- package/build/cjs/integrations/consola.js.map +1 -1
- package/build/cjs/integrations/console.js +11 -43
- package/build/cjs/integrations/console.js.map +1 -1
- package/build/cjs/integrations/conversationId.js +5 -22
- package/build/cjs/integrations/conversationId.js.map +1 -1
- package/build/cjs/integrations/dedupe.js +16 -74
- package/build/cjs/integrations/dedupe.js.map +1 -1
- package/build/cjs/integrations/eventFilters.js +63 -114
- package/build/cjs/integrations/eventFilters.js.map +1 -1
- package/build/cjs/integrations/express/index.js +30 -145
- package/build/cjs/integrations/express/index.js.map +1 -1
- package/build/cjs/integrations/express/patch-layer.js +20 -130
- package/build/cjs/integrations/express/patch-layer.js.map +1 -1
- package/build/cjs/integrations/express/request-layer-store.js +1 -3
- package/build/cjs/integrations/express/request-layer-store.js.map +1 -1
- package/build/cjs/integrations/express/set-sdk-processing-metadata.js +0 -2
- package/build/cjs/integrations/express/set-sdk-processing-metadata.js.map +1 -1
- package/build/cjs/integrations/express/types.js +6 -7
- package/build/cjs/integrations/express/types.js.map +1 -1
- package/build/cjs/integrations/express/utils.js +37 -145
- package/build/cjs/integrations/express/utils.js.map +1 -1
- package/build/cjs/integrations/extraerrordata.js +24 -69
- package/build/cjs/integrations/extraerrordata.js.map +1 -1
- package/build/cjs/integrations/featureFlags/featureFlagsIntegration.js +3 -29
- package/build/cjs/integrations/featureFlags/featureFlagsIntegration.js.map +1 -1
- package/build/cjs/integrations/featureFlags/growthbook.js +11 -40
- package/build/cjs/integrations/featureFlags/growthbook.js.map +1 -1
- package/build/cjs/integrations/functiontostring.js +6 -27
- package/build/cjs/integrations/functiontostring.js.map +1 -1
- package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js +10 -18
- package/build/cjs/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -1
- package/build/cjs/integrations/http/client-patch.js +8 -70
- package/build/cjs/integrations/http/client-patch.js.map +1 -1
- package/build/cjs/integrations/http/client-subscriptions.js +22 -59
- package/build/cjs/integrations/http/client-subscriptions.js.map +1 -1
- package/build/cjs/integrations/http/constants.js +3 -3
- package/build/cjs/integrations/http/double-wrap-warning.js +10 -18
- package/build/cjs/integrations/http/double-wrap-warning.js.map +1 -1
- package/build/cjs/integrations/http/get-outgoing-span-data.js +30 -47
- package/build/cjs/integrations/http/get-outgoing-span-data.js.map +1 -1
- package/build/cjs/integrations/http/get-request-url.js +7 -24
- package/build/cjs/integrations/http/get-request-url.js.map +1 -1
- package/build/cjs/integrations/http/inject-trace-propagation-headers.js +14 -38
- package/build/cjs/integrations/http/inject-trace-propagation-headers.js.map +1 -1
- package/build/cjs/integrations/http/patch-request-to-capture-body.js +80 -0
- package/build/cjs/integrations/http/patch-request-to-capture-body.js.map +1 -0
- package/build/cjs/integrations/http/record-request-session.js +61 -0
- package/build/cjs/integrations/http/record-request-session.js.map +1 -0
- package/build/cjs/integrations/http/server-subscription.js +289 -0
- package/build/cjs/integrations/http/server-subscription.js.map +1 -0
- package/build/cjs/integrations/linkederrors.js +6 -11
- package/build/cjs/integrations/linkederrors.js.map +1 -1
- package/build/cjs/integrations/mcp-server/attributeExtraction.js +26 -69
- package/build/cjs/integrations/mcp-server/attributeExtraction.js.map +1 -1
- package/build/cjs/integrations/mcp-server/attributes.js +30 -138
- package/build/cjs/integrations/mcp-server/attributes.js.map +1 -1
- package/build/cjs/integrations/mcp-server/correlation.js +20 -91
- package/build/cjs/integrations/mcp-server/correlation.js.map +1 -1
- package/build/cjs/integrations/mcp-server/errorCapture.js +6 -25
- package/build/cjs/integrations/mcp-server/errorCapture.js.map +1 -1
- package/build/cjs/integrations/mcp-server/handlers.js +55 -169
- package/build/cjs/integrations/mcp-server/handlers.js.map +1 -1
- package/build/cjs/integrations/mcp-server/index.js +7 -60
- package/build/cjs/integrations/mcp-server/index.js.map +1 -1
- package/build/cjs/integrations/mcp-server/methodConfig.js +21 -59
- package/build/cjs/integrations/mcp-server/methodConfig.js.map +1 -1
- package/build/cjs/integrations/mcp-server/piiFiltering.js +5 -33
- package/build/cjs/integrations/mcp-server/piiFiltering.js.map +1 -1
- package/build/cjs/integrations/mcp-server/resultExtraction.js +20 -76
- package/build/cjs/integrations/mcp-server/resultExtraction.js.map +1 -1
- package/build/cjs/integrations/mcp-server/sessionExtraction.js +30 -121
- package/build/cjs/integrations/mcp-server/sessionExtraction.js.map +1 -1
- package/build/cjs/integrations/mcp-server/sessionManagement.js +2 -60
- package/build/cjs/integrations/mcp-server/sessionManagement.js.map +1 -1
- package/build/cjs/integrations/mcp-server/spans.js +20 -107
- package/build/cjs/integrations/mcp-server/spans.js.map +1 -1
- package/build/cjs/integrations/mcp-server/transport.js +26 -94
- package/build/cjs/integrations/mcp-server/transport.js.map +1 -1
- package/build/cjs/integrations/mcp-server/validation.js +6 -72
- package/build/cjs/integrations/mcp-server/validation.js.map +1 -1
- package/build/cjs/integrations/moduleMetadata.js +6 -20
- package/build/cjs/integrations/moduleMetadata.js.map +1 -1
- package/build/cjs/integrations/postgresjs.js +78 -287
- package/build/cjs/integrations/postgresjs.js.map +1 -1
- package/build/cjs/integrations/requestdata.js +30 -93
- package/build/cjs/integrations/requestdata.js.map +1 -1
- package/build/cjs/integrations/rewriteframes.js +14 -45
- package/build/cjs/integrations/rewriteframes.js.map +1 -1
- package/build/cjs/integrations/spanStreaming.js +9 -15
- package/build/cjs/integrations/spanStreaming.js.map +1 -1
- package/build/cjs/integrations/supabase.js +224 -333
- package/build/cjs/integrations/supabase.js.map +1 -1
- package/build/cjs/integrations/third-party-errors-filter.js +60 -85
- package/build/cjs/integrations/third-party-errors-filter.js.map +1 -1
- package/build/cjs/integrations/zoderrors.js +35 -111
- package/build/cjs/integrations/zoderrors.js.map +1 -1
- package/build/cjs/logs/console-integration.js +15 -50
- package/build/cjs/logs/console-integration.js.map +1 -1
- package/build/cjs/logs/constants.js +1 -6
- package/build/cjs/logs/constants.js.map +1 -1
- package/build/cjs/logs/envelope.js +10 -40
- package/build/cjs/logs/envelope.js.map +1 -1
- package/build/cjs/logs/internal.js +53 -125
- package/build/cjs/logs/internal.js.map +1 -1
- package/build/cjs/logs/public-api.js +13 -228
- package/build/cjs/logs/public-api.js.map +1 -1
- package/build/cjs/logs/utils.js +6 -47
- package/build/cjs/logs/utils.js.map +1 -1
- package/build/cjs/metadata.js +6 -51
- package/build/cjs/metadata.js.map +1 -1
- package/build/cjs/metrics/envelope.js +12 -45
- package/build/cjs/metrics/envelope.js.map +1 -1
- package/build/cjs/metrics/internal.js +31 -144
- package/build/cjs/metrics/internal.js.map +1 -1
- package/build/cjs/metrics/public-api.js +4 -109
- package/build/cjs/metrics/public-api.js.map +1 -1
- package/build/cjs/profiling.js +11 -41
- package/build/cjs/profiling.js.map +1 -1
- package/build/cjs/scope.js +73 -224
- package/build/cjs/scope.js.map +1 -1
- package/build/cjs/sdk.js +2 -21
- package/build/cjs/sdk.js.map +1 -1
- package/build/cjs/semanticAttributes.js +30 -116
- package/build/cjs/semanticAttributes.js.map +1 -1
- package/build/cjs/server-runtime-client.js +32 -87
- package/build/cjs/server-runtime-client.js.map +1 -1
- package/build/cjs/server.js +17 -3
- package/build/cjs/server.js.map +1 -1
- package/build/cjs/session.js +14 -67
- package/build/cjs/session.js.map +1 -1
- package/build/cjs/tracing/ai/gen-ai-attributes.js +45 -249
- package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/cjs/tracing/ai/mediaStripping.js +21 -116
- package/build/cjs/tracing/ai/mediaStripping.js.map +1 -1
- package/build/cjs/tracing/ai/messageTruncation.js +26 -212
- package/build/cjs/tracing/ai/messageTruncation.js.map +1 -1
- package/build/cjs/tracing/ai/utils.js +40 -180
- package/build/cjs/tracing/ai/utils.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/constants.js +9 -12
- package/build/cjs/tracing/anthropic-ai/constants.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/index.js +67 -172
- package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/streaming.js +45 -149
- package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/utils.js +17 -47
- package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
- package/build/cjs/tracing/dynamicSamplingContext.js +18 -85
- package/build/cjs/tracing/dynamicSamplingContext.js.map +1 -1
- package/build/cjs/tracing/errors.js +2 -14
- package/build/cjs/tracing/errors.js.map +1 -1
- package/build/cjs/tracing/google-genai/constants.js +9 -16
- package/build/cjs/tracing/google-genai/constants.js.map +1 -1
- package/build/cjs/tracing/google-genai/index.js +79 -223
- package/build/cjs/tracing/google-genai/index.js.map +1 -1
- package/build/cjs/tracing/google-genai/streaming.js +11 -56
- package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
- package/build/cjs/tracing/google-genai/utils.js +8 -13
- package/build/cjs/tracing/google-genai/utils.js.map +1 -1
- package/build/cjs/tracing/idleSpan.js +48 -174
- package/build/cjs/tracing/idleSpan.js.map +1 -1
- package/build/cjs/tracing/langchain/constants.js +8 -9
- package/build/cjs/tracing/langchain/constants.js.map +1 -1
- package/build/cjs/tracing/langchain/embeddings.js +31 -75
- package/build/cjs/tracing/langchain/embeddings.js.map +1 -1
- package/build/cjs/tracing/langchain/index.js +64 -161
- package/build/cjs/tracing/langchain/index.js.map +1 -1
- package/build/cjs/tracing/langchain/utils.js +101 -311
- package/build/cjs/tracing/langchain/utils.js.map +1 -1
- package/build/cjs/tracing/langgraph/constants.js +2 -2
- package/build/cjs/tracing/langgraph/index.js +57 -160
- package/build/cjs/tracing/langgraph/index.js.map +1 -1
- package/build/cjs/tracing/langgraph/utils.js +53 -170
- package/build/cjs/tracing/langgraph/utils.js.map +1 -1
- package/build/cjs/tracing/logSpans.js +10 -26
- package/build/cjs/tracing/logSpans.js.map +1 -1
- package/build/cjs/tracing/measurement.js +6 -18
- package/build/cjs/tracing/measurement.js.map +1 -1
- package/build/cjs/tracing/openai/constants.js +20 -24
- package/build/cjs/tracing/openai/constants.js.map +1 -1
- package/build/cjs/tracing/openai/index.js +52 -132
- package/build/cjs/tracing/openai/index.js.map +1 -1
- package/build/cjs/tracing/openai/streaming.js +24 -102
- package/build/cjs/tracing/openai/streaming.js.map +1 -1
- package/build/cjs/tracing/openai/utils.js +36 -107
- package/build/cjs/tracing/openai/utils.js.map +1 -1
- package/build/cjs/tracing/sampling.js +23 -63
- package/build/cjs/tracing/sampling.js.map +1 -1
- package/build/cjs/tracing/sentryNonRecordingSpan.js +15 -40
- package/build/cjs/tracing/sentryNonRecordingSpan.js.map +1 -1
- package/build/cjs/tracing/sentrySpan.js +66 -172
- package/build/cjs/tracing/sentrySpan.js.map +1 -1
- package/build/cjs/tracing/spans/beforeSendSpan.js +4 -32
- package/build/cjs/tracing/spans/beforeSendSpan.js.map +1 -1
- package/build/cjs/tracing/spans/captureSpan.js +58 -156
- package/build/cjs/tracing/spans/captureSpan.js.map +1 -1
- package/build/cjs/tracing/spans/envelope.js +12 -24
- package/build/cjs/tracing/spans/envelope.js.map +1 -1
- package/build/cjs/tracing/spans/estimateSize.js +0 -22
- package/build/cjs/tracing/spans/estimateSize.js.map +1 -1
- package/build/cjs/tracing/spans/extractGenAiSpans.js +11 -33
- package/build/cjs/tracing/spans/extractGenAiSpans.js.map +1 -1
- package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js +1 -4
- package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js.map +1 -1
- package/build/cjs/tracing/spans/scopeContextAttributes.js +58 -0
- package/build/cjs/tracing/spans/scopeContextAttributes.js.map +1 -0
- package/build/cjs/tracing/spans/spanBuffer.js +21 -71
- package/build/cjs/tracing/spans/spanBuffer.js.map +1 -1
- package/build/cjs/tracing/spans/spanJsonToStreamedSpan.js +4 -8
- package/build/cjs/tracing/spans/spanJsonToStreamedSpan.js.map +1 -1
- package/build/cjs/tracing/spanstatus.js +15 -32
- package/build/cjs/tracing/spanstatus.js.map +1 -1
- package/build/cjs/tracing/trace.js +95 -311
- package/build/cjs/tracing/trace.js.map +1 -1
- package/build/cjs/tracing/utils.js +4 -14
- package/build/cjs/tracing/utils.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/constants.js +15 -26
- package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/index.js +84 -288
- package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/utils.js +30 -128
- package/build/cjs/tracing/vercel-ai/utils.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js +22 -229
- package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
- package/build/cjs/transports/base.js +32 -67
- package/build/cjs/transports/base.js.map +1 -1
- package/build/cjs/transports/multiplexed.js +38 -103
- package/build/cjs/transports/multiplexed.js.map +1 -1
- package/build/cjs/transports/offline.js +31 -72
- package/build/cjs/transports/offline.js.map +1 -1
- package/build/cjs/transports/userAgent.js +4 -13
- package/build/cjs/transports/userAgent.js.map +1 -1
- package/build/cjs/trpc.js +19 -39
- package/build/cjs/trpc.js.map +1 -1
- package/build/cjs/utils/aggregate-errors.js +18 -62
- package/build/cjs/utils/aggregate-errors.js.map +1 -1
- package/build/cjs/utils/ai/providerSkip.js +3 -50
- package/build/cjs/utils/ai/providerSkip.js.map +1 -1
- package/build/cjs/utils/anr.js +7 -36
- package/build/cjs/utils/anr.js.map +1 -1
- package/build/cjs/utils/baggage.js +37 -146
- package/build/cjs/utils/baggage.js.map +1 -1
- package/build/cjs/utils/breadcrumb-log-level.js +5 -9
- package/build/cjs/utils/breadcrumb-log-level.js.map +1 -1
- package/build/cjs/utils/browser.js +24 -86
- package/build/cjs/utils/browser.js.map +1 -1
- package/build/cjs/utils/chain-and-copy-promiselike.js +10 -27
- package/build/cjs/utils/chain-and-copy-promiselike.js.map +1 -1
- package/build/cjs/utils/clientreport.js +4 -13
- package/build/cjs/utils/clientreport.js.map +1 -1
- package/build/cjs/utils/cookie.js +6 -53
- package/build/cjs/utils/cookie.js.map +1 -1
- package/build/cjs/utils/data-collection/defaultPiiToCollectionOptions.js +28 -0
- package/build/cjs/utils/data-collection/defaultPiiToCollectionOptions.js.map +1 -0
- package/build/cjs/utils/data-collection/filterCookies.js +23 -0
- package/build/cjs/utils/data-collection/filterCookies.js.map +1 -0
- package/build/cjs/utils/data-collection/filterKeyValueData.js +43 -0
- package/build/cjs/utils/data-collection/filterKeyValueData.js.map +1 -0
- package/build/cjs/utils/data-collection/filterQueryParams.js +26 -0
- package/build/cjs/utils/data-collection/filterQueryParams.js.map +1 -0
- package/build/cjs/utils/data-collection/filtering-snippets.js +61 -0
- package/build/cjs/utils/data-collection/filtering-snippets.js.map +1 -0
- package/build/cjs/utils/data-collection/resolveDataCollectionOptions.js +37 -0
- package/build/cjs/utils/data-collection/resolveDataCollectionOptions.js.map +1 -0
- package/build/cjs/utils/debounce.js +5 -32
- package/build/cjs/utils/debounce.js.map +1 -1
- package/build/cjs/utils/debug-ids.js +4 -42
- package/build/cjs/utils/debug-ids.js.map +1 -1
- package/build/cjs/utils/debug-logger.js +23 -56
- package/build/cjs/utils/debug-logger.js.map +1 -1
- package/build/cjs/utils/dsn.js +18 -81
- package/build/cjs/utils/dsn.js.map +1 -1
- package/build/cjs/utils/env.js +3 -27
- package/build/cjs/utils/env.js.map +1 -1
- package/build/cjs/utils/envToBool.js +2 -15
- package/build/cjs/utils/envToBool.js.map +1 -1
- package/build/cjs/utils/envelope.js +39 -133
- package/build/cjs/utils/envelope.js.map +1 -1
- package/build/cjs/utils/error.js +3 -10
- package/build/cjs/utils/error.js.map +1 -1
- package/build/cjs/utils/eventUtils.js +0 -8
- package/build/cjs/utils/eventUtils.js.map +1 -1
- package/build/cjs/utils/eventbuilder.js +30 -114
- package/build/cjs/utils/eventbuilder.js.map +1 -1
- package/build/cjs/utils/exports.js +5 -24
- package/build/cjs/utils/exports.js.map +1 -1
- package/build/cjs/utils/featureFlags.js +10 -96
- package/build/cjs/utils/featureFlags.js.map +1 -1
- package/build/cjs/utils/flushIfServerless.js +14 -48
- package/build/cjs/utils/flushIfServerless.js.map +1 -1
- package/build/cjs/utils/get-default-export.js +1 -25
- package/build/cjs/utils/get-default-export.js.map +1 -1
- package/build/cjs/utils/handleCallbackErrors.js +10 -48
- package/build/cjs/utils/handleCallbackErrors.js.map +1 -1
- package/build/cjs/utils/hasSpansEnabled.js +4 -28
- package/build/cjs/utils/hasSpansEnabled.js.map +1 -1
- package/build/cjs/utils/ipAddress.js +7 -19
- package/build/cjs/utils/ipAddress.js.map +1 -1
- package/build/cjs/utils/is.js +18 -163
- package/build/cjs/utils/is.js.map +1 -1
- package/build/cjs/utils/isBrowser.js +3 -9
- package/build/cjs/utils/isBrowser.js.map +1 -1
- package/build/cjs/utils/isSentryRequestUrl.js +2 -19
- package/build/cjs/utils/isSentryRequestUrl.js.map +1 -1
- package/build/cjs/utils/lru.js +13 -24
- package/build/cjs/utils/lru.js.map +1 -1
- package/build/cjs/utils/merge.js +1 -17
- package/build/cjs/utils/merge.js.map +1 -1
- package/build/cjs/utils/meta.js +1 -24
- package/build/cjs/utils/meta.js.map +1 -1
- package/build/cjs/utils/misc.js +31 -134
- package/build/cjs/utils/misc.js.map +1 -1
- package/build/cjs/utils/node-stack-trace.js +22 -61
- package/build/cjs/utils/node-stack-trace.js.map +1 -1
- package/build/cjs/utils/node.js +3 -48
- package/build/cjs/utils/node.js.map +1 -1
- package/build/cjs/utils/normalizationHints.js +5 -18
- package/build/cjs/utils/normalizationHints.js.map +1 -1
- package/build/cjs/utils/normalize.js +39 -205
- package/build/cjs/utils/normalize.js.map +1 -1
- package/build/cjs/utils/object.js +33 -168
- package/build/cjs/utils/object.js.map +1 -1
- package/build/cjs/utils/parameterize.js +2 -21
- package/build/cjs/utils/parameterize.js.map +1 -1
- package/build/cjs/utils/parseSampleRate.js +4 -13
- package/build/cjs/utils/parseSampleRate.js.map +1 -1
- package/build/cjs/utils/path.js +28 -115
- package/build/cjs/utils/path.js.map +1 -1
- package/build/cjs/utils/prepareEvent.js +53 -191
- package/build/cjs/utils/prepareEvent.js.map +1 -1
- package/build/cjs/utils/promisebuffer.js +5 -47
- package/build/cjs/utils/promisebuffer.js.map +1 -1
- package/build/cjs/utils/propagationContext.js +0 -7
- package/build/cjs/utils/propagationContext.js.map +1 -1
- package/build/cjs/utils/randomSafeContext.js +3 -22
- package/build/cjs/utils/randomSafeContext.js.map +1 -1
- package/build/cjs/utils/ratelimit.js +13 -66
- package/build/cjs/utils/ratelimit.js.map +1 -1
- package/build/cjs/utils/request.js +62 -269
- package/build/cjs/utils/request.js.map +1 -1
- package/build/cjs/utils/scopeData.js +15 -79
- package/build/cjs/utils/scopeData.js.map +1 -1
- package/build/cjs/utils/sdkMetadata.js +5 -19
- package/build/cjs/utils/sdkMetadata.js.map +1 -1
- package/build/cjs/utils/severity.js +1 -9
- package/build/cjs/utils/severity.js.map +1 -1
- package/build/cjs/utils/should-ignore-span.js +6 -38
- package/build/cjs/utils/should-ignore-span.js.map +1 -1
- package/build/cjs/utils/spanOnScope.js +3 -14
- package/build/cjs/utils/spanOnScope.js.map +1 -1
- package/build/cjs/utils/spanUtils.js +42 -222
- package/build/cjs/utils/spanUtils.js.map +1 -1
- package/build/cjs/utils/stacktrace.js +19 -106
- package/build/cjs/utils/stacktrace.js.map +1 -1
- package/build/cjs/utils/string.js +7 -75
- package/build/cjs/utils/string.js.map +1 -1
- package/build/cjs/utils/supports.js +14 -99
- package/build/cjs/utils/supports.js.map +1 -1
- package/build/cjs/utils/syncpromise.js +19 -68
- package/build/cjs/utils/syncpromise.js.map +1 -1
- package/build/cjs/utils/time.js +7 -84
- package/build/cjs/utils/time.js.map +1 -1
- package/build/cjs/utils/timer.js +1 -10
- package/build/cjs/utils/timer.js.map +1 -1
- package/build/cjs/utils/timestampSequence.js +5 -21
- package/build/cjs/utils/timestampSequence.js.map +1 -1
- package/build/cjs/utils/trace-info.js +3 -10
- package/build/cjs/utils/trace-info.js.map +1 -1
- package/build/cjs/utils/traceData.js +4 -39
- package/build/cjs/utils/traceData.js.map +1 -1
- package/build/cjs/utils/tracePropagationTargets.js +4 -18
- package/build/cjs/utils/tracePropagationTargets.js.map +1 -1
- package/build/cjs/utils/tracing.js +32 -106
- package/build/cjs/utils/tracing.js.map +1 -1
- package/build/cjs/utils/transactionEvent.js +11 -19
- package/build/cjs/utils/transactionEvent.js.map +1 -1
- package/build/cjs/utils/tunnel.js +12 -33
- package/build/cjs/utils/tunnel.js.map +1 -1
- package/build/cjs/utils/url.js +42 -176
- package/build/cjs/utils/url.js.map +1 -1
- package/build/cjs/utils/vercelWaitUntil.js +4 -12
- package/build/cjs/utils/vercelWaitUntil.js.map +1 -1
- package/build/cjs/utils/version.js +1 -3
- package/build/cjs/utils/version.js.map +1 -1
- package/build/cjs/utils/weakRef.js +5 -36
- package/build/cjs/utils/weakRef.js.map +1 -1
- package/build/cjs/utils/worldwide.js +1 -4
- package/build/cjs/utils/worldwide.js.map +1 -1
- package/build/cjs/vendor/escapeStringForRegex.js +1 -32
- package/build/cjs/vendor/escapeStringForRegex.js.map +1 -1
- package/build/cjs/vendor/getIpAddress.js +19 -99
- package/build/cjs/vendor/getIpAddress.js.map +1 -1
- package/build/esm/api.js +10 -34
- package/build/esm/api.js.map +1 -1
- package/build/esm/asyncContext/index.js +0 -14
- package/build/esm/asyncContext/index.js.map +1 -1
- package/build/esm/asyncContext/stackStrategy.js +16 -47
- package/build/esm/asyncContext/stackStrategy.js.map +1 -1
- package/build/esm/attributes.js +17 -95
- package/build/esm/attributes.js.map +1 -1
- package/build/esm/breadcrumbs.js +2 -22
- package/build/esm/breadcrumbs.js.map +1 -1
- package/build/esm/browser.js +5 -1
- package/build/esm/browser.js.map +1 -1
- package/build/esm/carrier.js +5 -42
- package/build/esm/carrier.js.map +1 -1
- package/build/esm/checkin.js +5 -19
- package/build/esm/checkin.js.map +1 -1
- package/build/esm/client.js +216 -585
- package/build/esm/client.js.map +1 -1
- package/build/esm/constants.js +2 -2
- package/build/esm/currentScopes.js +5 -86
- package/build/esm/currentScopes.js.map +1 -1
- package/build/esm/debug-build.js +0 -5
- package/build/esm/debug-build.js.map +1 -1
- package/build/esm/defaultScopes.js +2 -5
- package/build/esm/defaultScopes.js.map +1 -1
- package/build/esm/envelope.js +32 -103
- package/build/esm/envelope.js.map +1 -1
- package/build/esm/eventProcessors.js +4 -23
- package/build/esm/eventProcessors.js.map +1 -1
- package/build/esm/exports.js +21 -197
- package/build/esm/exports.js.map +1 -1
- package/build/esm/feedback.js +7 -19
- package/build/esm/feedback.js.map +1 -1
- package/build/esm/fetch.js +66 -201
- package/build/esm/fetch.js.map +1 -1
- package/build/esm/index.js +7 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/instrument/console.js +9 -41
- package/build/esm/instrument/console.js.map +1 -1
- package/build/esm/instrument/fetch.js +47 -156
- package/build/esm/instrument/fetch.js.map +1 -1
- package/build/esm/instrument/globalError.js +4 -25
- package/build/esm/instrument/globalError.js.map +1 -1
- package/build/esm/instrument/globalUnhandledRejection.js +4 -21
- package/build/esm/instrument/globalUnhandledRejection.js.map +1 -1
- package/build/esm/instrument/handlers.js +9 -21
- package/build/esm/instrument/handlers.js.map +1 -1
- package/build/esm/integration.js +13 -77
- package/build/esm/integration.js.map +1 -1
- package/build/esm/integrations/captureconsole.js +16 -40
- package/build/esm/integrations/captureconsole.js.map +1 -1
- package/build/esm/integrations/consola.js +57 -163
- package/build/esm/integrations/consola.js.map +1 -1
- package/build/esm/integrations/console.js +11 -43
- package/build/esm/integrations/console.js.map +1 -1
- package/build/esm/integrations/conversationId.js +5 -22
- package/build/esm/integrations/conversationId.js.map +1 -1
- package/build/esm/integrations/dedupe.js +16 -74
- package/build/esm/integrations/dedupe.js.map +1 -1
- package/build/esm/integrations/eventFilters.js +63 -114
- package/build/esm/integrations/eventFilters.js.map +1 -1
- package/build/esm/integrations/express/index.js +30 -145
- package/build/esm/integrations/express/index.js.map +1 -1
- package/build/esm/integrations/express/patch-layer.js +20 -130
- package/build/esm/integrations/express/patch-layer.js.map +1 -1
- package/build/esm/integrations/express/request-layer-store.js +1 -3
- package/build/esm/integrations/express/request-layer-store.js.map +1 -1
- package/build/esm/integrations/express/set-sdk-processing-metadata.js +0 -2
- package/build/esm/integrations/express/set-sdk-processing-metadata.js.map +1 -1
- package/build/esm/integrations/express/types.js +6 -7
- package/build/esm/integrations/express/types.js.map +1 -1
- package/build/esm/integrations/express/utils.js +37 -145
- package/build/esm/integrations/express/utils.js.map +1 -1
- package/build/esm/integrations/extraerrordata.js +24 -69
- package/build/esm/integrations/extraerrordata.js.map +1 -1
- package/build/esm/integrations/featureFlags/featureFlagsIntegration.js +3 -29
- package/build/esm/integrations/featureFlags/featureFlagsIntegration.js.map +1 -1
- package/build/esm/integrations/featureFlags/growthbook.js +11 -40
- package/build/esm/integrations/featureFlags/growthbook.js.map +1 -1
- package/build/esm/integrations/functiontostring.js +6 -27
- package/build/esm/integrations/functiontostring.js.map +1 -1
- package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js +10 -18
- package/build/esm/integrations/http/add-outgoing-request-breadcrumb.js.map +1 -1
- package/build/esm/integrations/http/client-patch.js +8 -70
- package/build/esm/integrations/http/client-patch.js.map +1 -1
- package/build/esm/integrations/http/client-subscriptions.js +22 -59
- package/build/esm/integrations/http/client-subscriptions.js.map +1 -1
- package/build/esm/integrations/http/constants.js +3 -3
- package/build/esm/integrations/http/double-wrap-warning.js +10 -18
- package/build/esm/integrations/http/double-wrap-warning.js.map +1 -1
- package/build/esm/integrations/http/get-outgoing-span-data.js +30 -47
- package/build/esm/integrations/http/get-outgoing-span-data.js.map +1 -1
- package/build/esm/integrations/http/get-request-url.js +7 -24
- package/build/esm/integrations/http/get-request-url.js.map +1 -1
- package/build/esm/integrations/http/inject-trace-propagation-headers.js +14 -38
- package/build/esm/integrations/http/inject-trace-propagation-headers.js.map +1 -1
- package/build/esm/integrations/http/patch-request-to-capture-body.js +78 -0
- package/build/esm/integrations/http/patch-request-to-capture-body.js.map +1 -0
- package/build/esm/integrations/http/record-request-session.js +59 -0
- package/build/esm/integrations/http/record-request-session.js.map +1 -0
- package/build/esm/integrations/http/server-subscription.js +285 -0
- package/build/esm/integrations/http/server-subscription.js.map +1 -0
- package/build/esm/integrations/linkederrors.js +6 -11
- package/build/esm/integrations/linkederrors.js.map +1 -1
- package/build/esm/integrations/mcp-server/attributeExtraction.js +26 -69
- package/build/esm/integrations/mcp-server/attributeExtraction.js.map +1 -1
- package/build/esm/integrations/mcp-server/attributes.js +30 -138
- package/build/esm/integrations/mcp-server/attributes.js.map +1 -1
- package/build/esm/integrations/mcp-server/correlation.js +20 -91
- package/build/esm/integrations/mcp-server/correlation.js.map +1 -1
- package/build/esm/integrations/mcp-server/errorCapture.js +6 -25
- package/build/esm/integrations/mcp-server/errorCapture.js.map +1 -1
- package/build/esm/integrations/mcp-server/handlers.js +55 -169
- package/build/esm/integrations/mcp-server/handlers.js.map +1 -1
- package/build/esm/integrations/mcp-server/index.js +7 -60
- package/build/esm/integrations/mcp-server/index.js.map +1 -1
- package/build/esm/integrations/mcp-server/methodConfig.js +21 -59
- package/build/esm/integrations/mcp-server/methodConfig.js.map +1 -1
- package/build/esm/integrations/mcp-server/piiFiltering.js +5 -33
- package/build/esm/integrations/mcp-server/piiFiltering.js.map +1 -1
- package/build/esm/integrations/mcp-server/resultExtraction.js +20 -76
- package/build/esm/integrations/mcp-server/resultExtraction.js.map +1 -1
- package/build/esm/integrations/mcp-server/sessionExtraction.js +30 -121
- package/build/esm/integrations/mcp-server/sessionExtraction.js.map +1 -1
- package/build/esm/integrations/mcp-server/sessionManagement.js +2 -60
- package/build/esm/integrations/mcp-server/sessionManagement.js.map +1 -1
- package/build/esm/integrations/mcp-server/spans.js +20 -107
- package/build/esm/integrations/mcp-server/spans.js.map +1 -1
- package/build/esm/integrations/mcp-server/transport.js +26 -94
- package/build/esm/integrations/mcp-server/transport.js.map +1 -1
- package/build/esm/integrations/mcp-server/validation.js +6 -72
- package/build/esm/integrations/mcp-server/validation.js.map +1 -1
- package/build/esm/integrations/moduleMetadata.js +6 -20
- package/build/esm/integrations/moduleMetadata.js.map +1 -1
- package/build/esm/integrations/postgresjs.js +78 -287
- package/build/esm/integrations/postgresjs.js.map +1 -1
- package/build/esm/integrations/requestdata.js +30 -93
- package/build/esm/integrations/requestdata.js.map +1 -1
- package/build/esm/integrations/rewriteframes.js +14 -45
- package/build/esm/integrations/rewriteframes.js.map +1 -1
- package/build/esm/integrations/spanStreaming.js +9 -15
- package/build/esm/integrations/spanStreaming.js.map +1 -1
- package/build/esm/integrations/supabase.js +224 -333
- package/build/esm/integrations/supabase.js.map +1 -1
- package/build/esm/integrations/third-party-errors-filter.js +60 -85
- package/build/esm/integrations/third-party-errors-filter.js.map +1 -1
- package/build/esm/integrations/zoderrors.js +35 -111
- package/build/esm/integrations/zoderrors.js.map +1 -1
- package/build/esm/logs/console-integration.js +15 -50
- package/build/esm/logs/console-integration.js.map +1 -1
- package/build/esm/logs/constants.js +1 -6
- package/build/esm/logs/constants.js.map +1 -1
- package/build/esm/logs/envelope.js +10 -40
- package/build/esm/logs/envelope.js.map +1 -1
- package/build/esm/logs/internal.js +53 -126
- package/build/esm/logs/internal.js.map +1 -1
- package/build/esm/logs/public-api.js +13 -228
- package/build/esm/logs/public-api.js.map +1 -1
- package/build/esm/logs/utils.js +6 -47
- package/build/esm/logs/utils.js.map +1 -1
- package/build/esm/metadata.js +6 -51
- package/build/esm/metadata.js.map +1 -1
- package/build/esm/metrics/envelope.js +12 -45
- package/build/esm/metrics/envelope.js.map +1 -1
- package/build/esm/metrics/internal.js +31 -144
- package/build/esm/metrics/internal.js.map +1 -1
- package/build/esm/metrics/public-api.js +4 -109
- package/build/esm/metrics/public-api.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/profiling.js +11 -41
- package/build/esm/profiling.js.map +1 -1
- package/build/esm/scope.js +73 -224
- package/build/esm/scope.js.map +1 -1
- package/build/esm/sdk.js +2 -21
- package/build/esm/sdk.js.map +1 -1
- package/build/esm/semanticAttributes.js +31 -118
- package/build/esm/semanticAttributes.js.map +1 -1
- package/build/esm/server-runtime-client.js +32 -87
- package/build/esm/server-runtime-client.js.map +1 -1
- package/build/esm/server.js +7 -1
- package/build/esm/server.js.map +1 -1
- package/build/esm/session.js +14 -67
- package/build/esm/session.js.map +1 -1
- package/build/esm/tracing/ai/gen-ai-attributes.js +45 -249
- package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/esm/tracing/ai/mediaStripping.js +21 -116
- package/build/esm/tracing/ai/mediaStripping.js.map +1 -1
- package/build/esm/tracing/ai/messageTruncation.js +26 -212
- package/build/esm/tracing/ai/messageTruncation.js.map +1 -1
- package/build/esm/tracing/ai/utils.js +40 -180
- package/build/esm/tracing/ai/utils.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/constants.js +9 -12
- package/build/esm/tracing/anthropic-ai/constants.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/index.js +67 -172
- package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/streaming.js +45 -149
- package/build/esm/tracing/anthropic-ai/streaming.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/utils.js +17 -47
- package/build/esm/tracing/anthropic-ai/utils.js.map +1 -1
- package/build/esm/tracing/dynamicSamplingContext.js +18 -85
- package/build/esm/tracing/dynamicSamplingContext.js.map +1 -1
- package/build/esm/tracing/errors.js +2 -14
- package/build/esm/tracing/errors.js.map +1 -1
- package/build/esm/tracing/google-genai/constants.js +9 -16
- package/build/esm/tracing/google-genai/constants.js.map +1 -1
- package/build/esm/tracing/google-genai/index.js +79 -223
- package/build/esm/tracing/google-genai/index.js.map +1 -1
- package/build/esm/tracing/google-genai/streaming.js +11 -56
- package/build/esm/tracing/google-genai/streaming.js.map +1 -1
- package/build/esm/tracing/google-genai/utils.js +8 -13
- package/build/esm/tracing/google-genai/utils.js.map +1 -1
- package/build/esm/tracing/idleSpan.js +48 -174
- package/build/esm/tracing/idleSpan.js.map +1 -1
- package/build/esm/tracing/langchain/constants.js +8 -9
- package/build/esm/tracing/langchain/constants.js.map +1 -1
- package/build/esm/tracing/langchain/embeddings.js +31 -75
- package/build/esm/tracing/langchain/embeddings.js.map +1 -1
- package/build/esm/tracing/langchain/index.js +64 -161
- package/build/esm/tracing/langchain/index.js.map +1 -1
- package/build/esm/tracing/langchain/utils.js +101 -312
- package/build/esm/tracing/langchain/utils.js.map +1 -1
- package/build/esm/tracing/langgraph/constants.js +2 -2
- package/build/esm/tracing/langgraph/index.js +59 -162
- package/build/esm/tracing/langgraph/index.js.map +1 -1
- package/build/esm/tracing/langgraph/utils.js +54 -170
- package/build/esm/tracing/langgraph/utils.js.map +1 -1
- package/build/esm/tracing/logSpans.js +10 -26
- package/build/esm/tracing/logSpans.js.map +1 -1
- package/build/esm/tracing/measurement.js +6 -18
- package/build/esm/tracing/measurement.js.map +1 -1
- package/build/esm/tracing/openai/constants.js +20 -24
- package/build/esm/tracing/openai/constants.js.map +1 -1
- package/build/esm/tracing/openai/index.js +52 -132
- package/build/esm/tracing/openai/index.js.map +1 -1
- package/build/esm/tracing/openai/streaming.js +24 -102
- package/build/esm/tracing/openai/streaming.js.map +1 -1
- package/build/esm/tracing/openai/utils.js +36 -107
- package/build/esm/tracing/openai/utils.js.map +1 -1
- package/build/esm/tracing/sampling.js +23 -63
- package/build/esm/tracing/sampling.js.map +1 -1
- package/build/esm/tracing/sentryNonRecordingSpan.js +15 -40
- package/build/esm/tracing/sentryNonRecordingSpan.js.map +1 -1
- package/build/esm/tracing/sentrySpan.js +66 -172
- package/build/esm/tracing/sentrySpan.js.map +1 -1
- package/build/esm/tracing/spans/beforeSendSpan.js +4 -32
- package/build/esm/tracing/spans/beforeSendSpan.js.map +1 -1
- package/build/esm/tracing/spans/captureSpan.js +59 -157
- package/build/esm/tracing/spans/captureSpan.js.map +1 -1
- package/build/esm/tracing/spans/envelope.js +12 -24
- package/build/esm/tracing/spans/envelope.js.map +1 -1
- package/build/esm/tracing/spans/estimateSize.js +0 -22
- package/build/esm/tracing/spans/estimateSize.js.map +1 -1
- package/build/esm/tracing/spans/extractGenAiSpans.js +11 -33
- package/build/esm/tracing/spans/extractGenAiSpans.js.map +1 -1
- package/build/esm/tracing/spans/hasSpanStreamingEnabled.js +1 -4
- package/build/esm/tracing/spans/hasSpanStreamingEnabled.js.map +1 -1
- package/build/esm/tracing/spans/scopeContextAttributes.js +56 -0
- package/build/esm/tracing/spans/scopeContextAttributes.js.map +1 -0
- package/build/esm/tracing/spans/spanBuffer.js +21 -71
- package/build/esm/tracing/spans/spanBuffer.js.map +1 -1
- package/build/esm/tracing/spans/spanJsonToStreamedSpan.js +4 -8
- package/build/esm/tracing/spans/spanJsonToStreamedSpan.js.map +1 -1
- package/build/esm/tracing/spanstatus.js +15 -32
- package/build/esm/tracing/spanstatus.js.map +1 -1
- package/build/esm/tracing/trace.js +95 -311
- package/build/esm/tracing/trace.js.map +1 -1
- package/build/esm/tracing/utils.js +4 -14
- package/build/esm/tracing/utils.js.map +1 -1
- package/build/esm/tracing/vercel-ai/constants.js +15 -26
- package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
- package/build/esm/tracing/vercel-ai/index.js +84 -288
- package/build/esm/tracing/vercel-ai/index.js.map +1 -1
- package/build/esm/tracing/vercel-ai/utils.js +30 -128
- package/build/esm/tracing/vercel-ai/utils.js.map +1 -1
- package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js +22 -229
- package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
- package/build/esm/transports/base.js +32 -67
- package/build/esm/transports/base.js.map +1 -1
- package/build/esm/transports/multiplexed.js +38 -103
- package/build/esm/transports/multiplexed.js.map +1 -1
- package/build/esm/transports/offline.js +31 -72
- package/build/esm/transports/offline.js.map +1 -1
- package/build/esm/transports/userAgent.js +4 -13
- package/build/esm/transports/userAgent.js.map +1 -1
- package/build/esm/trpc.js +19 -39
- package/build/esm/trpc.js.map +1 -1
- package/build/esm/utils/aggregate-errors.js +18 -62
- package/build/esm/utils/aggregate-errors.js.map +1 -1
- package/build/esm/utils/ai/providerSkip.js +3 -50
- package/build/esm/utils/ai/providerSkip.js.map +1 -1
- package/build/esm/utils/anr.js +7 -36
- package/build/esm/utils/anr.js.map +1 -1
- package/build/esm/utils/baggage.js +37 -146
- package/build/esm/utils/baggage.js.map +1 -1
- package/build/esm/utils/breadcrumb-log-level.js +5 -9
- package/build/esm/utils/breadcrumb-log-level.js.map +1 -1
- package/build/esm/utils/browser.js +24 -86
- package/build/esm/utils/browser.js.map +1 -1
- package/build/esm/utils/chain-and-copy-promiselike.js +10 -27
- package/build/esm/utils/chain-and-copy-promiselike.js.map +1 -1
- package/build/esm/utils/clientreport.js +4 -13
- package/build/esm/utils/clientreport.js.map +1 -1
- package/build/esm/utils/cookie.js +6 -53
- package/build/esm/utils/cookie.js.map +1 -1
- package/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js +26 -0
- package/build/esm/utils/data-collection/defaultPiiToCollectionOptions.js.map +1 -0
- package/build/esm/utils/data-collection/filterCookies.js +21 -0
- package/build/esm/utils/data-collection/filterCookies.js.map +1 -0
- package/build/esm/utils/data-collection/filterKeyValueData.js +41 -0
- package/build/esm/utils/data-collection/filterKeyValueData.js.map +1 -0
- package/build/esm/utils/data-collection/filterQueryParams.js +24 -0
- package/build/esm/utils/data-collection/filterQueryParams.js.map +1 -0
- package/build/esm/utils/data-collection/filtering-snippets.js +56 -0
- package/build/esm/utils/data-collection/filtering-snippets.js.map +1 -0
- package/build/esm/utils/data-collection/resolveDataCollectionOptions.js +35 -0
- package/build/esm/utils/data-collection/resolveDataCollectionOptions.js.map +1 -0
- package/build/esm/utils/debounce.js +5 -32
- package/build/esm/utils/debounce.js.map +1 -1
- package/build/esm/utils/debug-ids.js +4 -42
- package/build/esm/utils/debug-ids.js.map +1 -1
- package/build/esm/utils/debug-logger.js +23 -56
- package/build/esm/utils/debug-logger.js.map +1 -1
- package/build/esm/utils/dsn.js +18 -81
- package/build/esm/utils/dsn.js.map +1 -1
- package/build/esm/utils/env.js +3 -27
- package/build/esm/utils/env.js.map +1 -1
- package/build/esm/utils/envToBool.js +2 -15
- package/build/esm/utils/envToBool.js.map +1 -1
- package/build/esm/utils/envelope.js +39 -133
- package/build/esm/utils/envelope.js.map +1 -1
- package/build/esm/utils/error.js +3 -10
- package/build/esm/utils/error.js.map +1 -1
- package/build/esm/utils/eventUtils.js +0 -8
- package/build/esm/utils/eventUtils.js.map +1 -1
- package/build/esm/utils/eventbuilder.js +30 -114
- package/build/esm/utils/eventbuilder.js.map +1 -1
- package/build/esm/utils/exports.js +5 -24
- package/build/esm/utils/exports.js.map +1 -1
- package/build/esm/utils/featureFlags.js +10 -96
- package/build/esm/utils/featureFlags.js.map +1 -1
- package/build/esm/utils/flushIfServerless.js +14 -48
- package/build/esm/utils/flushIfServerless.js.map +1 -1
- package/build/esm/utils/get-default-export.js +1 -25
- package/build/esm/utils/get-default-export.js.map +1 -1
- package/build/esm/utils/handleCallbackErrors.js +10 -48
- package/build/esm/utils/handleCallbackErrors.js.map +1 -1
- package/build/esm/utils/hasSpansEnabled.js +4 -28
- package/build/esm/utils/hasSpansEnabled.js.map +1 -1
- package/build/esm/utils/ipAddress.js +7 -19
- package/build/esm/utils/ipAddress.js.map +1 -1
- package/build/esm/utils/is.js +18 -163
- package/build/esm/utils/is.js.map +1 -1
- package/build/esm/utils/isBrowser.js +3 -9
- package/build/esm/utils/isBrowser.js.map +1 -1
- package/build/esm/utils/isSentryRequestUrl.js +2 -19
- package/build/esm/utils/isSentryRequestUrl.js.map +1 -1
- package/build/esm/utils/lru.js +13 -24
- package/build/esm/utils/lru.js.map +1 -1
- package/build/esm/utils/merge.js +1 -17
- package/build/esm/utils/merge.js.map +1 -1
- package/build/esm/utils/meta.js +1 -24
- package/build/esm/utils/meta.js.map +1 -1
- package/build/esm/utils/misc.js +31 -134
- package/build/esm/utils/misc.js.map +1 -1
- package/build/esm/utils/node-stack-trace.js +22 -61
- package/build/esm/utils/node-stack-trace.js.map +1 -1
- package/build/esm/utils/node.js +3 -48
- package/build/esm/utils/node.js.map +1 -1
- package/build/esm/utils/normalizationHints.js +5 -18
- package/build/esm/utils/normalizationHints.js.map +1 -1
- package/build/esm/utils/normalize.js +39 -205
- package/build/esm/utils/normalize.js.map +1 -1
- package/build/esm/utils/object.js +33 -168
- package/build/esm/utils/object.js.map +1 -1
- package/build/esm/utils/parameterize.js +2 -21
- package/build/esm/utils/parameterize.js.map +1 -1
- package/build/esm/utils/parseSampleRate.js +4 -13
- package/build/esm/utils/parseSampleRate.js.map +1 -1
- package/build/esm/utils/path.js +28 -115
- package/build/esm/utils/path.js.map +1 -1
- package/build/esm/utils/prepareEvent.js +53 -191
- package/build/esm/utils/prepareEvent.js.map +1 -1
- package/build/esm/utils/promisebuffer.js +5 -47
- package/build/esm/utils/promisebuffer.js.map +1 -1
- package/build/esm/utils/propagationContext.js +0 -7
- package/build/esm/utils/propagationContext.js.map +1 -1
- package/build/esm/utils/randomSafeContext.js +3 -22
- package/build/esm/utils/randomSafeContext.js.map +1 -1
- package/build/esm/utils/ratelimit.js +13 -66
- package/build/esm/utils/ratelimit.js.map +1 -1
- package/build/esm/utils/request.js +62 -269
- package/build/esm/utils/request.js.map +1 -1
- package/build/esm/utils/scopeData.js +15 -79
- package/build/esm/utils/scopeData.js.map +1 -1
- package/build/esm/utils/sdkMetadata.js +5 -19
- package/build/esm/utils/sdkMetadata.js.map +1 -1
- package/build/esm/utils/severity.js +1 -9
- package/build/esm/utils/severity.js.map +1 -1
- package/build/esm/utils/should-ignore-span.js +6 -38
- package/build/esm/utils/should-ignore-span.js.map +1 -1
- package/build/esm/utils/spanOnScope.js +3 -14
- package/build/esm/utils/spanOnScope.js.map +1 -1
- package/build/esm/utils/spanUtils.js +42 -222
- package/build/esm/utils/spanUtils.js.map +1 -1
- package/build/esm/utils/stacktrace.js +19 -106
- package/build/esm/utils/stacktrace.js.map +1 -1
- package/build/esm/utils/string.js +7 -75
- package/build/esm/utils/string.js.map +1 -1
- package/build/esm/utils/supports.js +14 -99
- package/build/esm/utils/supports.js.map +1 -1
- package/build/esm/utils/syncpromise.js +19 -68
- package/build/esm/utils/syncpromise.js.map +1 -1
- package/build/esm/utils/time.js +7 -84
- package/build/esm/utils/time.js.map +1 -1
- package/build/esm/utils/timer.js +1 -10
- package/build/esm/utils/timer.js.map +1 -1
- package/build/esm/utils/timestampSequence.js +5 -21
- package/build/esm/utils/timestampSequence.js.map +1 -1
- package/build/esm/utils/trace-info.js +3 -10
- package/build/esm/utils/trace-info.js.map +1 -1
- package/build/esm/utils/traceData.js +4 -39
- package/build/esm/utils/traceData.js.map +1 -1
- package/build/esm/utils/tracePropagationTargets.js +4 -18
- package/build/esm/utils/tracePropagationTargets.js.map +1 -1
- package/build/esm/utils/tracing.js +32 -106
- package/build/esm/utils/tracing.js.map +1 -1
- package/build/esm/utils/transactionEvent.js +11 -19
- package/build/esm/utils/transactionEvent.js.map +1 -1
- package/build/esm/utils/tunnel.js +12 -33
- package/build/esm/utils/tunnel.js.map +1 -1
- package/build/esm/utils/url.js +42 -176
- package/build/esm/utils/url.js.map +1 -1
- package/build/esm/utils/vercelWaitUntil.js +4 -12
- package/build/esm/utils/vercelWaitUntil.js.map +1 -1
- package/build/esm/utils/version.js +1 -3
- package/build/esm/utils/version.js.map +1 -1
- package/build/esm/utils/weakRef.js +5 -36
- package/build/esm/utils/weakRef.js.map +1 -1
- package/build/esm/utils/worldwide.js +1 -4
- package/build/esm/utils/worldwide.js.map +1 -1
- package/build/esm/vendor/escapeStringForRegex.js +1 -32
- package/build/esm/vendor/escapeStringForRegex.js.map +1 -1
- package/build/esm/vendor/getIpAddress.js +19 -99
- package/build/esm/vendor/getIpAddress.js.map +1 -1
- package/build/types/api.d.ts +2 -2
- package/build/types/api.d.ts.map +1 -1
- package/build/types/attributes.d.ts +5 -8
- package/build/types/attributes.d.ts.map +1 -1
- package/build/types/breadcrumbs.d.ts +1 -1
- package/build/types/breadcrumbs.d.ts.map +1 -1
- package/build/types/browser-exports.d.ts +3 -3
- package/build/types/browser-exports.d.ts.map +1 -1
- package/build/types/carrier.d.ts +2 -2
- package/build/types/carrier.d.ts.map +1 -1
- package/build/types/checkin.d.ts +4 -4
- package/build/types/checkin.d.ts.map +1 -1
- package/build/types/client.d.ts +32 -22
- package/build/types/client.d.ts.map +1 -1
- package/build/types/currentScopes.d.ts +1 -1
- package/build/types/currentScopes.d.ts.map +1 -1
- package/build/types/envelope.d.ts +7 -7
- package/build/types/envelope.d.ts.map +1 -1
- package/build/types/eventProcessors.d.ts +2 -2
- package/build/types/eventProcessors.d.ts.map +1 -1
- package/build/types/exports.d.ts +8 -8
- package/build/types/exports.d.ts.map +1 -1
- package/build/types/feedback.d.ts +2 -2
- package/build/types/feedback.d.ts.map +1 -1
- package/build/types/fetch.d.ts +3 -3
- package/build/types/fetch.d.ts.map +1 -1
- package/build/types/instrument/console.d.ts +1 -1
- package/build/types/instrument/console.d.ts.map +1 -1
- package/build/types/instrument/fetch.d.ts +1 -1
- package/build/types/instrument/fetch.d.ts.map +1 -1
- package/build/types/instrument/globalError.d.ts +1 -1
- package/build/types/instrument/globalError.d.ts.map +1 -1
- package/build/types/instrument/globalUnhandledRejection.d.ts +1 -1
- package/build/types/instrument/globalUnhandledRejection.d.ts.map +1 -1
- package/build/types/integration.d.ts +2 -2
- package/build/types/integration.d.ts.map +1 -1
- package/build/types/integrations/consola.d.ts +1 -1
- package/build/types/integrations/consola.d.ts.map +1 -1
- package/build/types/integrations/console.d.ts +1 -1
- package/build/types/integrations/console.d.ts.map +1 -1
- package/build/types/integrations/dedupe.d.ts +1 -1
- package/build/types/integrations/dedupe.d.ts.map +1 -1
- package/build/types/integrations/express/types.d.ts +2 -2
- package/build/types/integrations/express/types.d.ts.map +1 -1
- package/build/types/integrations/express/utils.d.ts +1 -1
- package/build/types/integrations/express/utils.d.ts.map +1 -1
- package/build/types/integrations/featureFlags/featureFlagsIntegration.d.ts +1 -1
- package/build/types/integrations/featureFlags/featureFlagsIntegration.d.ts.map +1 -1
- package/build/types/integrations/featureFlags/growthbook.d.ts +1 -1
- package/build/types/integrations/featureFlags/growthbook.d.ts.map +1 -1
- package/build/types/integrations/http/double-wrap-warning.d.ts +1 -1
- package/build/types/integrations/http/double-wrap-warning.d.ts.map +1 -1
- package/build/types/integrations/http/get-outgoing-span-data.d.ts +2 -2
- package/build/types/integrations/http/get-outgoing-span-data.d.ts.map +1 -1
- package/build/types/integrations/http/patch-request-to-capture-body.d.ts +12 -0
- package/build/types/integrations/http/patch-request-to-capture-body.d.ts.map +1 -0
- package/build/types/integrations/http/record-request-session.d.ts +18 -0
- package/build/types/integrations/http/record-request-session.d.ts.map +1 -0
- package/build/types/integrations/http/server-subscription.d.ts +26 -0
- package/build/types/integrations/http/server-subscription.d.ts.map +1 -0
- package/build/types/integrations/http/types.d.ts +12 -6
- package/build/types/integrations/http/types.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/correlation.d.ts +1 -1
- package/build/types/integrations/mcp-server/correlation.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/piiFiltering.d.ts +1 -1
- package/build/types/integrations/mcp-server/piiFiltering.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/types.d.ts +1 -1
- package/build/types/integrations/mcp-server/types.d.ts.map +1 -1
- package/build/types/integrations/postgresjs.d.ts +1 -1
- package/build/types/integrations/postgresjs.d.ts.map +1 -1
- package/build/types/integrations/rewriteframes.d.ts +1 -1
- package/build/types/integrations/rewriteframes.d.ts.map +1 -1
- package/build/types/integrations/supabase.d.ts +14 -3
- package/build/types/integrations/supabase.d.ts.map +1 -1
- package/build/types/integrations/third-party-errors-filter.d.ts.map +1 -1
- package/build/types/integrations/zoderrors.d.ts +1 -1
- package/build/types/integrations/zoderrors.d.ts.map +1 -1
- package/build/types/logs/console-integration.d.ts +1 -1
- package/build/types/logs/console-integration.d.ts.map +1 -1
- package/build/types/logs/constants.d.ts +1 -1
- package/build/types/logs/constants.d.ts.map +1 -1
- package/build/types/logs/envelope.d.ts +4 -4
- package/build/types/logs/envelope.d.ts.map +1 -1
- package/build/types/logs/internal.d.ts +16 -1
- package/build/types/logs/internal.d.ts.map +1 -1
- package/build/types/logs/public-api.d.ts +2 -2
- package/build/types/logs/public-api.d.ts.map +1 -1
- package/build/types/metadata.d.ts +2 -2
- package/build/types/metadata.d.ts.map +1 -1
- package/build/types/metrics/envelope.d.ts +4 -4
- package/build/types/metrics/envelope.d.ts.map +1 -1
- package/build/types/metrics/internal.d.ts +1 -1
- package/build/types/metrics/internal.d.ts.map +1 -1
- package/build/types/metrics/public-api.d.ts +1 -1
- package/build/types/metrics/public-api.d.ts.map +1 -1
- package/build/types/profiling.d.ts +1 -1
- package/build/types/profiling.d.ts.map +1 -1
- package/build/types/report-dialog.d.ts +1 -1
- package/build/types/report-dialog.d.ts.map +1 -1
- package/build/types/scope.d.ts +14 -14
- package/build/types/scope.d.ts.map +1 -1
- package/build/types/sdk.d.ts +1 -1
- package/build/types/sdk.d.ts.map +1 -1
- package/build/types/semanticAttributes.d.ts +2 -0
- package/build/types/semanticAttributes.d.ts.map +1 -1
- package/build/types/server-exports.d.ts +3 -1
- package/build/types/server-exports.d.ts.map +1 -1
- package/build/types/server-runtime-client.d.ts +6 -6
- package/build/types/server-runtime-client.d.ts.map +1 -1
- package/build/types/session.d.ts +1 -1
- package/build/types/session.d.ts.map +1 -1
- package/build/types/shared-exports.d.ts +58 -53
- package/build/types/shared-exports.d.ts.map +1 -1
- package/build/types/tracing/ai/utils.d.ts +1 -1
- package/build/types/tracing/ai/utils.d.ts.map +1 -1
- package/build/types/tracing/anthropic-ai/streaming.d.ts +1 -1
- package/build/types/tracing/anthropic-ai/streaming.d.ts.map +1 -1
- package/build/types/tracing/anthropic-ai/utils.d.ts +2 -2
- package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
- package/build/types/tracing/dynamicSamplingContext.d.ts +2 -2
- package/build/types/tracing/dynamicSamplingContext.d.ts.map +1 -1
- package/build/types/tracing/google-genai/streaming.d.ts +1 -1
- package/build/types/tracing/google-genai/streaming.d.ts.map +1 -1
- package/build/types/tracing/idleSpan.d.ts +2 -2
- package/build/types/tracing/idleSpan.d.ts.map +1 -1
- package/build/types/tracing/langchain/utils.d.ts +6 -1
- package/build/types/tracing/langchain/utils.d.ts.map +1 -1
- package/build/types/tracing/langgraph/index.d.ts.map +1 -1
- package/build/types/tracing/langgraph/utils.d.ts +1 -3
- package/build/types/tracing/langgraph/utils.d.ts.map +1 -1
- package/build/types/tracing/logSpans.d.ts +1 -1
- package/build/types/tracing/logSpans.d.ts.map +1 -1
- package/build/types/tracing/measurement.d.ts +2 -2
- package/build/types/tracing/measurement.d.ts.map +1 -1
- package/build/types/tracing/openai/streaming.d.ts +1 -1
- package/build/types/tracing/openai/streaming.d.ts.map +1 -1
- package/build/types/tracing/openai/utils.d.ts +1 -1
- package/build/types/tracing/openai/utils.d.ts.map +1 -1
- package/build/types/tracing/sampling.d.ts +2 -2
- package/build/types/tracing/sampling.d.ts.map +1 -1
- package/build/types/tracing/sentryNonRecordingSpan.d.ts +3 -3
- package/build/types/tracing/sentryNonRecordingSpan.d.ts.map +1 -1
- package/build/types/tracing/sentrySpan.d.ts +4 -4
- package/build/types/tracing/sentrySpan.d.ts.map +1 -1
- package/build/types/tracing/spans/beforeSendSpan.d.ts +3 -3
- package/build/types/tracing/spans/beforeSendSpan.d.ts.map +1 -1
- package/build/types/tracing/spans/captureSpan.d.ts +1 -1
- package/build/types/tracing/spans/captureSpan.d.ts.map +1 -1
- package/build/types/tracing/spans/envelope.d.ts +2 -2
- package/build/types/tracing/spans/envelope.d.ts.map +1 -1
- package/build/types/tracing/spans/estimateSize.d.ts +1 -1
- package/build/types/tracing/spans/estimateSize.d.ts.map +1 -1
- package/build/types/tracing/spans/extractGenAiSpans.d.ts +2 -2
- package/build/types/tracing/spans/extractGenAiSpans.d.ts.map +1 -1
- package/build/types/tracing/spans/scopeContextAttributes.d.ts +9 -0
- package/build/types/tracing/spans/scopeContextAttributes.d.ts.map +1 -0
- package/build/types/tracing/spans/spanJsonToStreamedSpan.d.ts +1 -1
- package/build/types/tracing/spans/spanJsonToStreamedSpan.d.ts.map +1 -1
- package/build/types/tracing/spanstatus.d.ts +2 -2
- package/build/types/tracing/spanstatus.d.ts.map +1 -1
- package/build/types/tracing/trace.d.ts +2 -2
- package/build/types/tracing/trace.d.ts.map +1 -1
- package/build/types/tracing/utils.d.ts +1 -1
- package/build/types/tracing/utils.d.ts.map +1 -1
- package/build/types/tracing/vercel-ai/utils.d.ts +2 -2
- package/build/types/tracing/vercel-ai/utils.d.ts.map +1 -1
- package/build/types/transports/base.d.ts +1 -1
- package/build/types/transports/base.d.ts.map +1 -1
- package/build/types/transports/multiplexed.d.ts +3 -3
- package/build/types/transports/multiplexed.d.ts.map +1 -1
- package/build/types/transports/offline.d.ts +2 -2
- package/build/types/transports/offline.d.ts.map +1 -1
- package/build/types/transports/userAgent.d.ts +1 -1
- package/build/types/transports/userAgent.d.ts.map +1 -1
- package/build/types/trpc.d.ts.map +1 -1
- package/build/types/types/attachment.d.ts.map +1 -0
- package/build/types/types/breadcrumb.d.ts.map +1 -0
- package/build/types/types/browseroptions.d.ts.map +1 -0
- package/build/types/types/checkin.d.ts.map +1 -0
- package/build/types/types/clientreport.d.ts.map +1 -0
- package/build/types/types/context.d.ts.map +1 -0
- package/build/types/types/csp.d.ts.map +1 -0
- package/build/types/types/datacategory.d.ts.map +1 -0
- package/build/types/types/datacollection.d.ts +75 -0
- package/build/types/types/datacollection.d.ts.map +1 -0
- package/build/types/types/debugMeta.d.ts.map +1 -0
- package/build/types/types/dsn.d.ts.map +1 -0
- package/build/types/types/envelope.d.ts.map +1 -0
- package/build/types/types/error.d.ts.map +1 -0
- package/build/types/types/event.d.ts.map +1 -0
- package/build/types/types/eventprocessor.d.ts.map +1 -0
- package/build/types/types/exception.d.ts.map +1 -0
- package/build/types/types/extra.d.ts.map +1 -0
- package/build/types/types/feedback/config.d.ts.map +1 -0
- package/build/types/types/feedback/form.d.ts.map +1 -0
- package/build/types/types/feedback/index.d.ts.map +1 -0
- package/build/types/types/feedback/sendFeedback.d.ts.map +1 -0
- package/build/types/types/feedback/theme.d.ts.map +1 -0
- package/build/types/types/instrument.d.ts.map +1 -0
- package/build/types/types/integration.d.ts.map +1 -0
- package/build/types/types/link.d.ts.map +1 -0
- package/build/types/types/log.d.ts.map +1 -0
- package/build/types/types/measurement.d.ts.map +1 -0
- package/build/types/types/mechanism.d.ts.map +1 -0
- package/build/types/types/metric.d.ts.map +1 -0
- package/build/types/types/misc.d.ts.map +1 -0
- package/build/types/types/opentelemetry.d.ts.map +1 -0
- package/build/types/{types-hoist → types}/options.d.ts +17 -0
- package/build/types/types/options.d.ts.map +1 -0
- package/build/types/types/package.d.ts.map +1 -0
- package/build/types/types/parameterize.d.ts.map +1 -0
- package/build/types/types/polymorphics.d.ts.map +1 -0
- package/build/types/types/profiling.d.ts.map +1 -0
- package/build/types/types/replay.d.ts.map +1 -0
- package/build/types/types/request.d.ts.map +1 -0
- package/build/types/types/runtime.d.ts.map +1 -0
- package/build/types/{types-hoist → types}/samplingcontext.d.ts +1 -1
- package/build/types/types/samplingcontext.d.ts.map +1 -0
- package/build/types/types/sdkinfo.d.ts.map +1 -0
- package/build/types/types/sdkmetadata.d.ts.map +1 -0
- package/build/types/types/session.d.ts.map +1 -0
- package/build/types/types/severity.d.ts.map +1 -0
- package/build/types/types/span.d.ts.map +1 -0
- package/build/types/types/spanStatus.d.ts.map +1 -0
- package/build/types/types/stackframe.d.ts.map +1 -0
- package/build/types/types/stacktrace.d.ts.map +1 -0
- package/build/types/{types-hoist → types}/startSpanOptions.d.ts +13 -0
- package/build/types/types/startSpanOptions.d.ts.map +1 -0
- package/build/types/types/thread.d.ts.map +1 -0
- package/build/types/types/timedEvent.d.ts.map +1 -0
- package/build/types/types/tracing.d.ts.map +1 -0
- package/build/types/types/transaction.d.ts.map +1 -0
- package/build/types/types/transport.d.ts.map +1 -0
- package/build/types/types/user.d.ts.map +1 -0
- package/build/types/types/view-hierarchy.d.ts.map +1 -0
- package/build/types/types/vue.d.ts.map +1 -0
- package/build/types/types/webfetchapi.d.ts.map +1 -0
- package/build/types/types/wrappedfunction.d.ts.map +1 -0
- package/build/types/utils/aggregate-errors.d.ts +3 -3
- package/build/types/utils/aggregate-errors.d.ts.map +1 -1
- package/build/types/utils/anr.d.ts +1 -1
- package/build/types/utils/anr.d.ts.map +1 -1
- package/build/types/utils/baggage.d.ts +1 -1
- package/build/types/utils/baggage.d.ts.map +1 -1
- package/build/types/utils/breadcrumb-log-level.d.ts +1 -1
- package/build/types/utils/breadcrumb-log-level.d.ts.map +1 -1
- package/build/types/utils/clientreport.d.ts +2 -2
- package/build/types/utils/clientreport.d.ts.map +1 -1
- package/build/types/utils/data-collection/defaultPiiToCollectionOptions.d.ts +6 -0
- package/build/types/utils/data-collection/defaultPiiToCollectionOptions.d.ts.map +1 -0
- package/build/types/utils/data-collection/filterCookies.d.ts +9 -0
- package/build/types/utils/data-collection/filterCookies.d.ts.map +1 -0
- package/build/types/utils/data-collection/filterKeyValueData.d.ts +11 -0
- package/build/types/utils/data-collection/filterKeyValueData.d.ts.map +1 -0
- package/build/types/utils/data-collection/filterQueryParams.d.ts +9 -0
- package/build/types/utils/data-collection/filterQueryParams.d.ts.map +1 -0
- package/build/types/utils/data-collection/filtering-snippets.d.ts +14 -0
- package/build/types/utils/data-collection/filtering-snippets.d.ts.map +1 -0
- package/build/types/utils/data-collection/resolveDataCollectionOptions.d.ts +14 -0
- package/build/types/utils/data-collection/resolveDataCollectionOptions.d.ts.map +1 -0
- package/build/types/utils/debug-ids.d.ts +2 -2
- package/build/types/utils/debug-ids.d.ts.map +1 -1
- package/build/types/utils/debug-logger.d.ts +1 -1
- package/build/types/utils/debug-logger.d.ts.map +1 -1
- package/build/types/utils/dsn.d.ts +1 -1
- package/build/types/utils/dsn.d.ts.map +1 -1
- package/build/types/utils/env.d.ts.map +1 -1
- package/build/types/utils/envelope.d.ts +8 -8
- package/build/types/utils/envelope.d.ts.map +1 -1
- package/build/types/utils/error.d.ts +1 -1
- package/build/types/utils/error.d.ts.map +1 -1
- package/build/types/utils/eventUtils.d.ts +1 -1
- package/build/types/utils/eventUtils.d.ts.map +1 -1
- package/build/types/utils/eventbuilder.d.ts +6 -6
- package/build/types/utils/eventbuilder.d.ts.map +1 -1
- package/build/types/utils/featureFlags.d.ts +1 -1
- package/build/types/utils/featureFlags.d.ts.map +1 -1
- package/build/types/utils/hasSpansEnabled.d.ts +1 -1
- package/build/types/utils/hasSpansEnabled.d.ts.map +1 -1
- package/build/types/utils/ipAddress.d.ts +2 -2
- package/build/types/utils/ipAddress.d.ts.map +1 -1
- package/build/types/utils/is.d.ts +4 -4
- package/build/types/utils/is.d.ts.map +1 -1
- package/build/types/utils/meta.d.ts +1 -1
- package/build/types/utils/meta.d.ts.map +1 -1
- package/build/types/utils/misc.d.ts +3 -3
- package/build/types/utils/misc.d.ts.map +1 -1
- package/build/types/utils/node-stack-trace.d.ts +1 -1
- package/build/types/utils/node-stack-trace.d.ts.map +1 -1
- package/build/types/utils/object.d.ts +1 -1
- package/build/types/utils/object.d.ts.map +1 -1
- package/build/types/utils/parameterize.d.ts +1 -1
- package/build/types/utils/parameterize.d.ts.map +1 -1
- package/build/types/utils/prepareEvent.d.ts +3 -3
- package/build/types/utils/prepareEvent.d.ts.map +1 -1
- package/build/types/utils/ratelimit.d.ts +2 -2
- package/build/types/utils/ratelimit.d.ts.map +1 -1
- package/build/types/utils/request.d.ts +3 -3
- package/build/types/utils/request.d.ts.map +1 -1
- package/build/types/utils/scopeData.d.ts +1 -1
- package/build/types/utils/scopeData.d.ts.map +1 -1
- package/build/types/utils/sdkMetadata.d.ts +1 -1
- package/build/types/utils/sdkMetadata.d.ts.map +1 -1
- package/build/types/utils/severity.d.ts +1 -1
- package/build/types/utils/severity.d.ts.map +1 -1
- package/build/types/utils/should-ignore-span.d.ts +2 -2
- package/build/types/utils/should-ignore-span.d.ts.map +1 -1
- package/build/types/utils/spanOnScope.d.ts +1 -1
- package/build/types/utils/spanOnScope.d.ts.map +1 -1
- package/build/types/utils/spanUtils.d.ts +4 -4
- package/build/types/utils/spanUtils.d.ts.map +1 -1
- package/build/types/utils/stacktrace.d.ts +4 -4
- package/build/types/utils/stacktrace.d.ts.map +1 -1
- package/build/types/utils/trace-info.d.ts +2 -2
- package/build/types/utils/trace-info.d.ts.map +1 -1
- package/build/types/utils/traceData.d.ts +2 -2
- package/build/types/utils/traceData.d.ts.map +1 -1
- package/build/types/utils/tracePropagationTargets.d.ts +1 -1
- package/build/types/utils/tracePropagationTargets.d.ts.map +1 -1
- package/build/types/utils/tracing.d.ts +2 -2
- package/build/types/utils/tracing.d.ts.map +1 -1
- package/build/types/utils/transactionEvent.d.ts +2 -2
- package/build/types/utils/transactionEvent.d.ts.map +1 -1
- package/build/types/utils/url.d.ts +1 -1
- package/build/types/utils/url.d.ts.map +1 -1
- package/build/types/utils/worldwide.d.ts +1 -0
- package/build/types/utils/worldwide.d.ts.map +1 -1
- package/build/types-ts3.8/api.d.ts +2 -2
- package/build/types-ts3.8/attributes.d.ts +5 -8
- package/build/types-ts3.8/breadcrumbs.d.ts +1 -1
- package/build/types-ts3.8/browser-exports.d.ts +3 -3
- package/build/types-ts3.8/carrier.d.ts +2 -2
- package/build/types-ts3.8/checkin.d.ts +4 -4
- package/build/types-ts3.8/client.d.ts +32 -22
- package/build/types-ts3.8/currentScopes.d.ts +1 -1
- package/build/types-ts3.8/envelope.d.ts +7 -7
- package/build/types-ts3.8/eventProcessors.d.ts +2 -2
- package/build/types-ts3.8/exports.d.ts +8 -8
- package/build/types-ts3.8/feedback.d.ts +2 -2
- package/build/types-ts3.8/fetch.d.ts +3 -3
- package/build/types-ts3.8/instrument/console.d.ts +1 -1
- package/build/types-ts3.8/instrument/fetch.d.ts +1 -1
- package/build/types-ts3.8/instrument/globalError.d.ts +1 -1
- package/build/types-ts3.8/instrument/globalUnhandledRejection.d.ts +1 -1
- package/build/types-ts3.8/integration.d.ts +2 -2
- package/build/types-ts3.8/integrations/consola.d.ts +1 -1
- package/build/types-ts3.8/integrations/console.d.ts +1 -1
- package/build/types-ts3.8/integrations/dedupe.d.ts +1 -1
- package/build/types-ts3.8/integrations/express/types.d.ts +2 -2
- package/build/types-ts3.8/integrations/express/utils.d.ts +1 -1
- package/build/types-ts3.8/integrations/featureFlags/featureFlagsIntegration.d.ts +1 -1
- package/build/types-ts3.8/integrations/featureFlags/growthbook.d.ts +1 -1
- package/build/types-ts3.8/integrations/http/double-wrap-warning.d.ts +1 -1
- package/build/types-ts3.8/integrations/http/get-outgoing-span-data.d.ts +2 -2
- package/build/types-ts3.8/integrations/http/patch-request-to-capture-body.d.ts +12 -0
- package/build/types-ts3.8/integrations/http/record-request-session.d.ts +18 -0
- package/build/types-ts3.8/integrations/http/server-subscription.d.ts +26 -0
- package/build/types-ts3.8/integrations/http/types.d.ts +12 -6
- package/build/types-ts3.8/integrations/mcp-server/correlation.d.ts +1 -1
- package/build/types-ts3.8/integrations/mcp-server/piiFiltering.d.ts +1 -1
- package/build/types-ts3.8/integrations/mcp-server/types.d.ts +1 -1
- package/build/types-ts3.8/integrations/postgresjs.d.ts +1 -1
- package/build/types-ts3.8/integrations/rewriteframes.d.ts +1 -1
- package/build/types-ts3.8/integrations/supabase.d.ts +14 -3
- package/build/types-ts3.8/integrations/zoderrors.d.ts +1 -1
- package/build/types-ts3.8/logs/console-integration.d.ts +1 -1
- package/build/types-ts3.8/logs/constants.d.ts +1 -1
- package/build/types-ts3.8/logs/envelope.d.ts +4 -4
- package/build/types-ts3.8/logs/internal.d.ts +16 -1
- package/build/types-ts3.8/logs/public-api.d.ts +2 -2
- package/build/types-ts3.8/metadata.d.ts +2 -2
- package/build/types-ts3.8/metrics/envelope.d.ts +4 -4
- package/build/types-ts3.8/metrics/internal.d.ts +1 -1
- package/build/types-ts3.8/metrics/public-api.d.ts +1 -1
- package/build/types-ts3.8/profiling.d.ts +1 -1
- package/build/types-ts3.8/report-dialog.d.ts +1 -1
- package/build/types-ts3.8/scope.d.ts +14 -14
- package/build/types-ts3.8/sdk.d.ts +1 -1
- package/build/types-ts3.8/semanticAttributes.d.ts +2 -0
- package/build/types-ts3.8/server-exports.d.ts +3 -1
- package/build/types-ts3.8/server-runtime-client.d.ts +6 -6
- package/build/types-ts3.8/session.d.ts +1 -1
- package/build/types-ts3.8/shared-exports.d.ts +58 -53
- package/build/types-ts3.8/tracing/ai/utils.d.ts +1 -1
- package/build/types-ts3.8/tracing/anthropic-ai/streaming.d.ts +1 -1
- package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +2 -2
- package/build/types-ts3.8/tracing/dynamicSamplingContext.d.ts +2 -2
- package/build/types-ts3.8/tracing/google-genai/streaming.d.ts +1 -1
- package/build/types-ts3.8/tracing/idleSpan.d.ts +2 -2
- package/build/types-ts3.8/tracing/langchain/utils.d.ts +6 -1
- package/build/types-ts3.8/tracing/langgraph/utils.d.ts +1 -3
- package/build/types-ts3.8/tracing/logSpans.d.ts +1 -1
- package/build/types-ts3.8/tracing/measurement.d.ts +2 -2
- package/build/types-ts3.8/tracing/openai/streaming.d.ts +1 -1
- package/build/types-ts3.8/tracing/openai/utils.d.ts +1 -1
- package/build/types-ts3.8/tracing/sampling.d.ts +2 -2
- package/build/types-ts3.8/tracing/sentryNonRecordingSpan.d.ts +3 -3
- package/build/types-ts3.8/tracing/sentrySpan.d.ts +4 -4
- package/build/types-ts3.8/tracing/spans/beforeSendSpan.d.ts +3 -3
- package/build/types-ts3.8/tracing/spans/captureSpan.d.ts +1 -1
- package/build/types-ts3.8/tracing/spans/envelope.d.ts +2 -2
- package/build/types-ts3.8/tracing/spans/estimateSize.d.ts +1 -1
- package/build/types-ts3.8/tracing/spans/extractGenAiSpans.d.ts +2 -2
- package/build/types-ts3.8/tracing/spans/scopeContextAttributes.d.ts +9 -0
- package/build/types-ts3.8/tracing/spans/spanJsonToStreamedSpan.d.ts +1 -1
- package/build/types-ts3.8/tracing/spanstatus.d.ts +2 -2
- package/build/types-ts3.8/tracing/trace.d.ts +2 -2
- package/build/types-ts3.8/tracing/utils.d.ts +1 -1
- package/build/types-ts3.8/tracing/vercel-ai/utils.d.ts +2 -2
- package/build/types-ts3.8/transports/base.d.ts +1 -1
- package/build/types-ts3.8/transports/multiplexed.d.ts +3 -3
- package/build/types-ts3.8/transports/offline.d.ts +2 -2
- package/build/types-ts3.8/transports/userAgent.d.ts +1 -1
- package/build/types-ts3.8/types/datacollection.d.ts +75 -0
- package/build/types-ts3.8/{types-hoist → types}/options.d.ts +17 -0
- package/build/types-ts3.8/{types-hoist → types}/samplingcontext.d.ts +1 -1
- package/build/types-ts3.8/{types-hoist → types}/startSpanOptions.d.ts +13 -0
- package/build/types-ts3.8/utils/aggregate-errors.d.ts +3 -3
- package/build/types-ts3.8/utils/anr.d.ts +1 -1
- package/build/types-ts3.8/utils/baggage.d.ts +1 -1
- package/build/types-ts3.8/utils/breadcrumb-log-level.d.ts +1 -1
- package/build/types-ts3.8/utils/clientreport.d.ts +2 -2
- package/build/types-ts3.8/utils/data-collection/defaultPiiToCollectionOptions.d.ts +6 -0
- package/build/types-ts3.8/utils/data-collection/filterCookies.d.ts +9 -0
- package/build/types-ts3.8/utils/data-collection/filterKeyValueData.d.ts +11 -0
- package/build/types-ts3.8/utils/data-collection/filterQueryParams.d.ts +9 -0
- package/build/types-ts3.8/utils/data-collection/filtering-snippets.d.ts +14 -0
- package/build/types-ts3.8/utils/data-collection/resolveDataCollectionOptions.d.ts +14 -0
- package/build/types-ts3.8/utils/debug-ids.d.ts +2 -2
- package/build/types-ts3.8/utils/debug-logger.d.ts +1 -1
- package/build/types-ts3.8/utils/dsn.d.ts +1 -1
- package/build/types-ts3.8/utils/envelope.d.ts +8 -8
- package/build/types-ts3.8/utils/error.d.ts +1 -1
- package/build/types-ts3.8/utils/eventUtils.d.ts +1 -1
- package/build/types-ts3.8/utils/eventbuilder.d.ts +6 -6
- package/build/types-ts3.8/utils/featureFlags.d.ts +1 -1
- package/build/types-ts3.8/utils/hasSpansEnabled.d.ts +1 -1
- package/build/types-ts3.8/utils/ipAddress.d.ts +2 -2
- package/build/types-ts3.8/utils/is.d.ts +4 -4
- package/build/types-ts3.8/utils/meta.d.ts +1 -1
- package/build/types-ts3.8/utils/misc.d.ts +3 -3
- package/build/types-ts3.8/utils/node-stack-trace.d.ts +1 -1
- package/build/types-ts3.8/utils/object.d.ts +1 -1
- package/build/types-ts3.8/utils/parameterize.d.ts +1 -1
- package/build/types-ts3.8/utils/prepareEvent.d.ts +3 -3
- package/build/types-ts3.8/utils/ratelimit.d.ts +2 -2
- package/build/types-ts3.8/utils/request.d.ts +3 -3
- package/build/types-ts3.8/utils/scopeData.d.ts +1 -1
- package/build/types-ts3.8/utils/sdkMetadata.d.ts +1 -1
- package/build/types-ts3.8/utils/severity.d.ts +1 -1
- package/build/types-ts3.8/utils/should-ignore-span.d.ts +2 -2
- package/build/types-ts3.8/utils/spanOnScope.d.ts +1 -1
- package/build/types-ts3.8/utils/spanUtils.d.ts +4 -4
- package/build/types-ts3.8/utils/stacktrace.d.ts +4 -4
- package/build/types-ts3.8/utils/trace-info.d.ts +2 -2
- package/build/types-ts3.8/utils/traceData.d.ts +2 -2
- package/build/types-ts3.8/utils/tracePropagationTargets.d.ts +1 -1
- package/build/types-ts3.8/utils/tracing.d.ts +2 -2
- package/build/types-ts3.8/utils/transactionEvent.d.ts +2 -2
- package/build/types-ts3.8/utils/url.d.ts +1 -1
- package/build/types-ts3.8/utils/worldwide.d.ts +1 -0
- package/package.json +1 -1
- package/build/types/types-hoist/attachment.d.ts.map +0 -1
- package/build/types/types-hoist/breadcrumb.d.ts.map +0 -1
- package/build/types/types-hoist/browseroptions.d.ts.map +0 -1
- package/build/types/types-hoist/checkin.d.ts.map +0 -1
- package/build/types/types-hoist/clientreport.d.ts.map +0 -1
- package/build/types/types-hoist/context.d.ts.map +0 -1
- package/build/types/types-hoist/csp.d.ts.map +0 -1
- package/build/types/types-hoist/datacategory.d.ts.map +0 -1
- package/build/types/types-hoist/debugMeta.d.ts.map +0 -1
- package/build/types/types-hoist/dsn.d.ts.map +0 -1
- package/build/types/types-hoist/envelope.d.ts.map +0 -1
- package/build/types/types-hoist/error.d.ts.map +0 -1
- package/build/types/types-hoist/event.d.ts.map +0 -1
- package/build/types/types-hoist/eventprocessor.d.ts.map +0 -1
- package/build/types/types-hoist/exception.d.ts.map +0 -1
- package/build/types/types-hoist/extra.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/config.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/form.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/index.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/sendFeedback.d.ts.map +0 -1
- package/build/types/types-hoist/feedback/theme.d.ts.map +0 -1
- package/build/types/types-hoist/instrument.d.ts.map +0 -1
- package/build/types/types-hoist/integration.d.ts.map +0 -1
- package/build/types/types-hoist/link.d.ts.map +0 -1
- package/build/types/types-hoist/log.d.ts.map +0 -1
- package/build/types/types-hoist/measurement.d.ts.map +0 -1
- package/build/types/types-hoist/mechanism.d.ts.map +0 -1
- package/build/types/types-hoist/metric.d.ts.map +0 -1
- package/build/types/types-hoist/misc.d.ts.map +0 -1
- package/build/types/types-hoist/opentelemetry.d.ts.map +0 -1
- package/build/types/types-hoist/options.d.ts.map +0 -1
- package/build/types/types-hoist/package.d.ts.map +0 -1
- package/build/types/types-hoist/parameterize.d.ts.map +0 -1
- package/build/types/types-hoist/polymorphics.d.ts.map +0 -1
- package/build/types/types-hoist/profiling.d.ts.map +0 -1
- package/build/types/types-hoist/replay.d.ts.map +0 -1
- package/build/types/types-hoist/request.d.ts.map +0 -1
- package/build/types/types-hoist/runtime.d.ts.map +0 -1
- package/build/types/types-hoist/samplingcontext.d.ts.map +0 -1
- package/build/types/types-hoist/sdkinfo.d.ts.map +0 -1
- package/build/types/types-hoist/sdkmetadata.d.ts.map +0 -1
- package/build/types/types-hoist/session.d.ts.map +0 -1
- package/build/types/types-hoist/severity.d.ts.map +0 -1
- package/build/types/types-hoist/span.d.ts.map +0 -1
- package/build/types/types-hoist/spanStatus.d.ts.map +0 -1
- package/build/types/types-hoist/stackframe.d.ts.map +0 -1
- package/build/types/types-hoist/stacktrace.d.ts.map +0 -1
- package/build/types/types-hoist/startSpanOptions.d.ts.map +0 -1
- package/build/types/types-hoist/thread.d.ts.map +0 -1
- package/build/types/types-hoist/timedEvent.d.ts.map +0 -1
- package/build/types/types-hoist/tracing.d.ts.map +0 -1
- package/build/types/types-hoist/transaction.d.ts.map +0 -1
- package/build/types/types-hoist/transport.d.ts.map +0 -1
- package/build/types/types-hoist/user.d.ts.map +0 -1
- package/build/types/types-hoist/view-hierarchy.d.ts.map +0 -1
- package/build/types/types-hoist/vue.d.ts.map +0 -1
- package/build/types/types-hoist/webfetchapi.d.ts.map +0 -1
- package/build/types/types-hoist/wrappedfunction.d.ts.map +0 -1
- /package/build/types/{types-hoist → types}/attachment.d.ts +0 -0
- /package/build/types/{types-hoist → types}/breadcrumb.d.ts +0 -0
- /package/build/types/{types-hoist → types}/browseroptions.d.ts +0 -0
- /package/build/types/{types-hoist → types}/checkin.d.ts +0 -0
- /package/build/types/{types-hoist → types}/clientreport.d.ts +0 -0
- /package/build/types/{types-hoist → types}/context.d.ts +0 -0
- /package/build/types/{types-hoist → types}/csp.d.ts +0 -0
- /package/build/types/{types-hoist → types}/datacategory.d.ts +0 -0
- /package/build/types/{types-hoist → types}/debugMeta.d.ts +0 -0
- /package/build/types/{types-hoist → types}/dsn.d.ts +0 -0
- /package/build/types/{types-hoist → types}/envelope.d.ts +0 -0
- /package/build/types/{types-hoist → types}/error.d.ts +0 -0
- /package/build/types/{types-hoist → types}/event.d.ts +0 -0
- /package/build/types/{types-hoist → types}/eventprocessor.d.ts +0 -0
- /package/build/types/{types-hoist → types}/exception.d.ts +0 -0
- /package/build/types/{types-hoist → types}/extra.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/config.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/form.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/index.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/sendFeedback.d.ts +0 -0
- /package/build/types/{types-hoist → types}/feedback/theme.d.ts +0 -0
- /package/build/types/{types-hoist → types}/instrument.d.ts +0 -0
- /package/build/types/{types-hoist → types}/integration.d.ts +0 -0
- /package/build/types/{types-hoist → types}/link.d.ts +0 -0
- /package/build/types/{types-hoist → types}/log.d.ts +0 -0
- /package/build/types/{types-hoist → types}/measurement.d.ts +0 -0
- /package/build/types/{types-hoist → types}/mechanism.d.ts +0 -0
- /package/build/types/{types-hoist → types}/metric.d.ts +0 -0
- /package/build/types/{types-hoist → types}/misc.d.ts +0 -0
- /package/build/types/{types-hoist → types}/opentelemetry.d.ts +0 -0
- /package/build/types/{types-hoist → types}/package.d.ts +0 -0
- /package/build/types/{types-hoist → types}/parameterize.d.ts +0 -0
- /package/build/types/{types-hoist → types}/polymorphics.d.ts +0 -0
- /package/build/types/{types-hoist → types}/profiling.d.ts +0 -0
- /package/build/types/{types-hoist → types}/replay.d.ts +0 -0
- /package/build/types/{types-hoist → types}/request.d.ts +0 -0
- /package/build/types/{types-hoist → types}/runtime.d.ts +0 -0
- /package/build/types/{types-hoist → types}/sdkinfo.d.ts +0 -0
- /package/build/types/{types-hoist → types}/sdkmetadata.d.ts +0 -0
- /package/build/types/{types-hoist → types}/session.d.ts +0 -0
- /package/build/types/{types-hoist → types}/severity.d.ts +0 -0
- /package/build/types/{types-hoist → types}/span.d.ts +0 -0
- /package/build/types/{types-hoist → types}/spanStatus.d.ts +0 -0
- /package/build/types/{types-hoist → types}/stackframe.d.ts +0 -0
- /package/build/types/{types-hoist → types}/stacktrace.d.ts +0 -0
- /package/build/types/{types-hoist → types}/thread.d.ts +0 -0
- /package/build/types/{types-hoist → types}/timedEvent.d.ts +0 -0
- /package/build/types/{types-hoist → types}/tracing.d.ts +0 -0
- /package/build/types/{types-hoist → types}/transaction.d.ts +0 -0
- /package/build/types/{types-hoist → types}/transport.d.ts +0 -0
- /package/build/types/{types-hoist → types}/user.d.ts +0 -0
- /package/build/types/{types-hoist → types}/view-hierarchy.d.ts +0 -0
- /package/build/types/{types-hoist → types}/vue.d.ts +0 -0
- /package/build/types/{types-hoist → types}/webfetchapi.d.ts +0 -0
- /package/build/types/{types-hoist → types}/wrappedfunction.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/attachment.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/breadcrumb.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/browseroptions.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/checkin.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/clientreport.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/context.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/csp.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/datacategory.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/debugMeta.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/dsn.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/envelope.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/error.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/event.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/eventprocessor.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/exception.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/extra.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/config.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/form.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/index.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/sendFeedback.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/feedback/theme.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/instrument.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/integration.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/link.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/log.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/measurement.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/mechanism.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/metric.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/misc.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/opentelemetry.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/package.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/parameterize.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/polymorphics.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/profiling.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/replay.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/request.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/runtime.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/sdkinfo.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/sdkmetadata.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/session.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/severity.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/span.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/spanStatus.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/stackframe.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/stacktrace.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/thread.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/timedEvent.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/tracing.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/transaction.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/transport.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/user.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/view-hierarchy.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/vue.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/webfetchapi.d.ts +0 -0
- /package/build/types-ts3.8/{types-hoist → types}/wrappedfunction.d.ts +0 -0
package/build/cjs/api.js
CHANGED
|
@@ -2,68 +2,45 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const dsn = require('./utils/dsn.js');
|
|
4
4
|
|
|
5
|
-
const SENTRY_API_VERSION =
|
|
6
|
-
|
|
7
|
-
/** Returns the prefix to construct Sentry ingestion API endpoints. */
|
|
5
|
+
const SENTRY_API_VERSION = "7";
|
|
8
6
|
function getBaseApiEndpoint(dsn) {
|
|
9
|
-
const protocol = dsn.protocol ? `${dsn.protocol}:` :
|
|
10
|
-
const port = dsn.port ? `:${dsn.port}` :
|
|
11
|
-
return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` :
|
|
7
|
+
const protocol = dsn.protocol ? `${dsn.protocol}:` : "";
|
|
8
|
+
const port = dsn.port ? `:${dsn.port}` : "";
|
|
9
|
+
return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ""}/api/`;
|
|
12
10
|
}
|
|
13
|
-
|
|
14
|
-
/** Returns the ingest API endpoint for target. */
|
|
15
11
|
function _getIngestEndpoint(dsn) {
|
|
16
12
|
return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
/** Returns a URL-encoded string with auth config suitable for a query string. */
|
|
20
14
|
function _encodedAuth(dsn, sdkInfo) {
|
|
21
15
|
const params = {
|
|
22
|
-
sentry_version: SENTRY_API_VERSION
|
|
16
|
+
sentry_version: SENTRY_API_VERSION
|
|
23
17
|
};
|
|
24
|
-
|
|
25
18
|
if (dsn.publicKey) {
|
|
26
|
-
// We send only the minimum set of required information. See
|
|
27
|
-
// https://github.com/getsentry/sentry-javascript/issues/2572.
|
|
28
19
|
params.sentry_key = dsn.publicKey;
|
|
29
20
|
}
|
|
30
|
-
|
|
31
21
|
if (sdkInfo) {
|
|
32
22
|
params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`;
|
|
33
23
|
}
|
|
34
|
-
|
|
35
24
|
return new URLSearchParams(params).toString();
|
|
36
25
|
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Returns the envelope endpoint URL with auth in the query string.
|
|
40
|
-
*
|
|
41
|
-
* Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
|
|
42
|
-
*/
|
|
43
26
|
function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) {
|
|
44
27
|
return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;
|
|
45
28
|
}
|
|
46
|
-
|
|
47
|
-
/** Returns the url to the report dialog endpoint. */
|
|
48
29
|
function getReportDialogEndpoint(dsnLike, dialogOptions) {
|
|
49
30
|
const dsn$1 = dsn.makeDsn(dsnLike);
|
|
50
31
|
if (!dsn$1) {
|
|
51
|
-
return
|
|
32
|
+
return "";
|
|
52
33
|
}
|
|
53
|
-
|
|
54
34
|
const endpoint = `${getBaseApiEndpoint(dsn$1)}embed/error-page/`;
|
|
55
|
-
|
|
56
35
|
let encodedOptions = `dsn=${dsn.dsnToString(dsn$1)}`;
|
|
57
36
|
for (const key in dialogOptions) {
|
|
58
|
-
if (key ===
|
|
37
|
+
if (key === "dsn") {
|
|
59
38
|
continue;
|
|
60
39
|
}
|
|
61
|
-
|
|
62
|
-
if (key === 'onClose') {
|
|
40
|
+
if (key === "onClose") {
|
|
63
41
|
continue;
|
|
64
42
|
}
|
|
65
|
-
|
|
66
|
-
if (key === 'user') {
|
|
43
|
+
if (key === "user") {
|
|
67
44
|
const user = dialogOptions.user;
|
|
68
45
|
if (!user) {
|
|
69
46
|
continue;
|
|
@@ -75,10 +52,9 @@ function getReportDialogEndpoint(dsnLike, dialogOptions) {
|
|
|
75
52
|
encodedOptions += `&email=${encodeURIComponent(user.email)}`;
|
|
76
53
|
}
|
|
77
54
|
} else {
|
|
78
|
-
encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key]
|
|
55
|
+
encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key])}`;
|
|
79
56
|
}
|
|
80
57
|
}
|
|
81
|
-
|
|
82
58
|
return `${endpoint}?${encodedOptions}`;
|
|
83
59
|
}
|
|
84
60
|
|
package/build/cjs/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sources":["../../src/api.ts"],"sourcesContent":["import type { ReportDialogOptions } from './report-dialog';\nimport type { DsnComponents, DsnLike } from './types
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../../src/api.ts"],"sourcesContent":["import type { ReportDialogOptions } from './report-dialog';\nimport type { DsnComponents, DsnLike } from './types/dsn';\nimport type { SdkInfo } from './types/sdkinfo';\nimport { dsnToString, makeDsn } from './utils/dsn';\n\nexport const SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn: DsnComponents): string {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn: DsnComponents): string {\n return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn: DsnComponents, sdkInfo: SdkInfo | undefined): string {\n const params: Record<string, string> = {\n sentry_version: SENTRY_API_VERSION,\n };\n\n if (dsn.publicKey) {\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n params.sentry_key = dsn.publicKey;\n }\n\n if (sdkInfo) {\n params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`;\n }\n\n return new URLSearchParams(params).toString();\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nexport function getEnvelopeEndpointWithUrlEncodedAuth(dsn: DsnComponents, tunnel?: string, sdkInfo?: SdkInfo): string {\n return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nexport function getReportDialogEndpoint(dsnLike: DsnLike, dialogOptions: ReportDialogOptions): string {\n const dsn = makeDsn(dsnLike);\n if (!dsn) {\n return '';\n }\n\n const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n let encodedOptions = `dsn=${dsnToString(dsn)}`;\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'onClose') {\n continue;\n }\n\n if (key === 'user') {\n const user = dialogOptions.user;\n if (!user) {\n continue;\n }\n if (user.name) {\n encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n }\n if (user.email) {\n encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n }\n } else {\n encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`;\n }\n }\n\n return `${endpoint}?${encodedOptions}`;\n}\n"],"names":["dsn","makeDsn","dsnToString"],"mappings":";;;;AAKO,MAAM,kBAAA,GAAqB;AAGlC,SAAS,mBAAmB,GAAA,EAA4B;AACtD,EAAA,MAAM,WAAW,GAAA,CAAI,QAAA,GAAW,CAAA,EAAG,GAAA,CAAI,QAAQ,CAAA,CAAA,CAAA,GAAM,EAAA;AACrD,EAAA,MAAM,OAAO,GAAA,CAAI,IAAA,GAAO,CAAA,CAAA,EAAI,GAAA,CAAI,IAAI,CAAA,CAAA,GAAK,EAAA;AACzC,EAAA,OAAO,CAAA,EAAG,QAAQ,CAAA,EAAA,EAAK,GAAA,CAAI,IAAI,CAAA,EAAG,IAAI,CAAA,EAAG,GAAA,CAAI,IAAA,GAAO,CAAA,CAAA,EAAI,GAAA,CAAI,IAAI,KAAK,EAAE,CAAA,KAAA,CAAA;AACzE;AAGA,SAAS,mBAAmB,GAAA,EAA4B;AACtD,EAAA,OAAO,GAAG,kBAAA,CAAmB,GAAG,CAAC,CAAA,EAAG,IAAI,SAAS,CAAA,UAAA,CAAA;AACnD;AAGA,SAAS,YAAA,CAAa,KAAoB,OAAA,EAAsC;AAC9E,EAAA,MAAM,MAAA,GAAiC;AAAA,IACrC,cAAA,EAAgB;AAAA,GAClB;AAEA,EAAA,IAAI,IAAI,SAAA,EAAW;AAGjB,IAAA,MAAA,CAAO,aAAa,GAAA,CAAI,SAAA;AAAA,EAC1B;AAEA,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,MAAA,CAAO,gBAAgB,CAAA,EAAG,OAAA,CAAQ,IAAI,CAAA,CAAA,EAAI,QAAQ,OAAO,CAAA,CAAA;AAAA,EAC3D;AAEA,EAAA,OAAO,IAAI,eAAA,CAAgB,MAAM,CAAA,CAAE,QAAA,EAAS;AAC9C;AAOO,SAAS,qCAAA,CAAsC,GAAA,EAAoB,MAAA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CAAW,CAAC,CAAA,CAAA;AAAA,IACnG;AAAA,EACF;AAEA,EAAA,OAAO,CAAA,EAAG,QAAQ,CAAA,CAAA,EAAI,cAAc,CAAA,CAAA;AACtC;;;;;;"}
|
|
@@ -3,30 +3,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const carrier = require('../carrier.js');
|
|
4
4
|
const stackStrategy = require('./stackStrategy.js');
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* @private Private API with no semver guarantees!
|
|
8
|
-
*
|
|
9
|
-
* Sets the global async context strategy
|
|
10
|
-
*/
|
|
11
6
|
function setAsyncContextStrategy(strategy) {
|
|
12
|
-
// Get main carrier (global for every environment)
|
|
13
7
|
const registry = carrier.getMainCarrier();
|
|
14
8
|
const sentry = carrier.getSentryCarrier(registry);
|
|
15
9
|
sentry.acs = strategy;
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Get the current async context strategy.
|
|
20
|
-
* If none has been setup, the default will be used.
|
|
21
|
-
*/
|
|
22
11
|
function getAsyncContextStrategy(carrier$1) {
|
|
23
12
|
const sentry = carrier.getSentryCarrier(carrier$1);
|
|
24
|
-
|
|
25
13
|
if (sentry.acs) {
|
|
26
14
|
return sentry.acs;
|
|
27
15
|
}
|
|
28
|
-
|
|
29
|
-
// Otherwise, use the default one (stack)
|
|
30
16
|
return stackStrategy.getStackAsyncContextStrategy();
|
|
31
17
|
}
|
|
32
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/asyncContext/index.ts"],"sourcesContent":["import type { Carrier } from './../carrier';\nimport { getMainCarrier, getSentryCarrier } from './../carrier';\nimport { getStackAsyncContextStrategy } from './stackStrategy';\nimport type { AsyncContextStrategy } from './types';\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n sentry.acs = strategy;\n}\n\n/**\n * Get the current async context strategy.\n * If none has been setup, the default will be used.\n */\nexport function getAsyncContextStrategy(carrier: Carrier): AsyncContextStrategy {\n const sentry = getSentryCarrier(carrier);\n\n if (sentry.acs) {\n return sentry.acs;\n }\n\n // Otherwise, use the default one (stack)\n return getStackAsyncContextStrategy();\n}\n"],"names":["getMainCarrier","getSentryCarrier","carrier","getStackAsyncContextStrategy"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/asyncContext/index.ts"],"sourcesContent":["import type { Carrier } from './../carrier';\nimport { getMainCarrier, getSentryCarrier } from './../carrier';\nimport { getStackAsyncContextStrategy } from './stackStrategy';\nimport type { AsyncContextStrategy } from './types';\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n sentry.acs = strategy;\n}\n\n/**\n * Get the current async context strategy.\n * If none has been setup, the default will be used.\n */\nexport function getAsyncContextStrategy(carrier: Carrier): AsyncContextStrategy {\n const sentry = getSentryCarrier(carrier);\n\n if (sentry.acs) {\n return sentry.acs;\n }\n\n // Otherwise, use the default one (stack)\n return getStackAsyncContextStrategy();\n}\n"],"names":["getMainCarrier","getSentryCarrier","carrier","getStackAsyncContextStrategy"],"mappings":";;;;;AAUO,SAAS,wBAAwB,QAAA,EAAkD;AAExF,EAAA,MAAM,WAAWA,sBAAA,EAAe;AAChC,EAAA,MAAM,MAAA,GAASC,yBAAiB,QAAQ,CAAA;AACxC,EAAA,MAAA,CAAO,GAAA,GAAM,QAAA;AACf;AAMO,SAAS,wBAAwBC,SAAA,EAAwC;AAC9E,EAAA,MAAM,MAAA,GAASD,yBAAiBC,SAAO,CAAA;AAEvC,EAAA,IAAI,OAAO,GAAA,EAAK;AACd,IAAA,OAAO,MAAA,CAAO,GAAA;AAAA,EAChB;AAGA,EAAA,OAAOC,0CAAA,EAA6B;AACtC;;;;;"}
|
|
@@ -6,37 +6,28 @@ const chainAndCopyPromiselike = require('../utils/chain-and-copy-promiselike.js'
|
|
|
6
6
|
const is = require('../utils/is.js');
|
|
7
7
|
const carrier = require('../carrier.js');
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* This is an object that holds a stack of scopes.
|
|
11
|
-
*/
|
|
12
9
|
class AsyncContextStack {
|
|
13
|
-
|
|
14
|
-
constructor(scope$1, isolationScope) {
|
|
10
|
+
constructor(scope$1, isolationScope) {
|
|
15
11
|
let assignedScope;
|
|
16
12
|
if (!scope$1) {
|
|
17
13
|
assignedScope = new scope.Scope();
|
|
18
14
|
} else {
|
|
19
15
|
assignedScope = scope$1;
|
|
20
16
|
}
|
|
21
|
-
|
|
22
17
|
let assignedIsolationScope;
|
|
23
18
|
if (!isolationScope) {
|
|
24
19
|
assignedIsolationScope = new scope.Scope();
|
|
25
20
|
} else {
|
|
26
21
|
assignedIsolationScope = isolationScope;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
|
-
// scope stack for domains or the process
|
|
30
23
|
this._stack = [{ scope: assignedScope }];
|
|
31
24
|
this._isolationScope = assignedIsolationScope;
|
|
32
25
|
}
|
|
33
|
-
|
|
34
26
|
/**
|
|
35
27
|
* Fork a scope for the stack.
|
|
36
28
|
*/
|
|
37
|
-
|
|
29
|
+
withScope(callback) {
|
|
38
30
|
const scope = this._pushScope();
|
|
39
|
-
|
|
40
31
|
let maybePromiseResult;
|
|
41
32
|
try {
|
|
42
33
|
maybePromiseResult = callback(scope);
|
|
@@ -44,84 +35,67 @@ class AsyncContextStack {
|
|
|
44
35
|
this._popScope();
|
|
45
36
|
throw e;
|
|
46
37
|
}
|
|
47
|
-
|
|
48
38
|
if (is.isThenable(maybePromiseResult)) {
|
|
49
39
|
return chainAndCopyPromiselike.chainAndCopyPromiseLike(
|
|
50
|
-
maybePromiseResult
|
|
51
|
-
() => this._popScope(),
|
|
40
|
+
maybePromiseResult,
|
|
52
41
|
() => this._popScope(),
|
|
53
|
-
|
|
42
|
+
() => this._popScope()
|
|
43
|
+
);
|
|
54
44
|
}
|
|
55
|
-
|
|
56
45
|
this._popScope();
|
|
57
46
|
return maybePromiseResult;
|
|
58
47
|
}
|
|
59
|
-
|
|
60
48
|
/**
|
|
61
49
|
* Get the client of the stack.
|
|
62
50
|
*/
|
|
63
|
-
|
|
64
|
-
return this.getStackTop().client
|
|
51
|
+
getClient() {
|
|
52
|
+
return this.getStackTop().client;
|
|
65
53
|
}
|
|
66
|
-
|
|
67
54
|
/**
|
|
68
55
|
* Returns the scope of the top stack.
|
|
69
56
|
*/
|
|
70
|
-
|
|
57
|
+
getScope() {
|
|
71
58
|
return this.getStackTop().scope;
|
|
72
59
|
}
|
|
73
|
-
|
|
74
60
|
/**
|
|
75
61
|
* Get the isolation scope for the stack.
|
|
76
62
|
*/
|
|
77
|
-
|
|
63
|
+
getIsolationScope() {
|
|
78
64
|
return this._isolationScope;
|
|
79
65
|
}
|
|
80
|
-
|
|
81
66
|
/**
|
|
82
67
|
* Returns the topmost scope layer in the order domain > local > process.
|
|
83
68
|
*/
|
|
84
|
-
|
|
85
|
-
return this._stack[this._stack.length - 1]
|
|
69
|
+
getStackTop() {
|
|
70
|
+
return this._stack[this._stack.length - 1];
|
|
86
71
|
}
|
|
87
|
-
|
|
88
72
|
/**
|
|
89
73
|
* Push a scope to the stack.
|
|
90
74
|
*/
|
|
91
|
-
|
|
92
|
-
// We want to clone the content of prev scope
|
|
75
|
+
_pushScope() {
|
|
93
76
|
const scope = this.getScope().clone();
|
|
94
77
|
this._stack.push({
|
|
95
78
|
client: this.getClient(),
|
|
96
|
-
scope
|
|
79
|
+
scope
|
|
97
80
|
});
|
|
98
81
|
return scope;
|
|
99
82
|
}
|
|
100
|
-
|
|
101
83
|
/**
|
|
102
84
|
* Pop a scope from the stack.
|
|
103
85
|
*/
|
|
104
|
-
|
|
86
|
+
_popScope() {
|
|
105
87
|
if (this._stack.length <= 1) return false;
|
|
106
88
|
return !!this._stack.pop();
|
|
107
89
|
}
|
|
108
90
|
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Get the global async context stack.
|
|
112
|
-
* This will be removed during the v8 cycle and is only here to make migration easier.
|
|
113
|
-
*/
|
|
114
91
|
function getAsyncContextStack() {
|
|
115
92
|
const registry = carrier.getMainCarrier();
|
|
116
93
|
const sentry = carrier.getSentryCarrier(registry);
|
|
117
|
-
|
|
118
|
-
return (sentry.stack = sentry.stack || new AsyncContextStack(defaultScopes.getDefaultCurrentScope(), defaultScopes.getDefaultIsolationScope()));
|
|
94
|
+
return sentry.stack = sentry.stack || new AsyncContextStack(defaultScopes.getDefaultCurrentScope(), defaultScopes.getDefaultIsolationScope());
|
|
119
95
|
}
|
|
120
|
-
|
|
121
96
|
function withScope(callback) {
|
|
122
97
|
return getAsyncContextStack().withScope(callback);
|
|
123
98
|
}
|
|
124
|
-
|
|
125
99
|
function withSetScope(scope, callback) {
|
|
126
100
|
const stack = getAsyncContextStack();
|
|
127
101
|
return stack.withScope(() => {
|
|
@@ -129,16 +103,11 @@ function withSetScope(scope, callback) {
|
|
|
129
103
|
return callback(scope);
|
|
130
104
|
});
|
|
131
105
|
}
|
|
132
|
-
|
|
133
106
|
function withIsolationScope(callback) {
|
|
134
107
|
return getAsyncContextStack().withScope(() => {
|
|
135
108
|
return callback(getAsyncContextStack().getIsolationScope());
|
|
136
109
|
});
|
|
137
110
|
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Get the stack-based async context strategy.
|
|
141
|
-
*/
|
|
142
111
|
function getStackAsyncContextStrategy() {
|
|
143
112
|
return {
|
|
144
113
|
withIsolationScope,
|
|
@@ -148,7 +117,7 @@ function getStackAsyncContextStrategy() {
|
|
|
148
117
|
return withIsolationScope(callback);
|
|
149
118
|
},
|
|
150
119
|
getCurrentScope: () => getAsyncContextStack().getScope(),
|
|
151
|
-
getIsolationScope: () => getAsyncContextStack().getIsolationScope()
|
|
120
|
+
getIsolationScope: () => getAsyncContextStack().getIsolationScope()
|
|
152
121
|
};
|
|
153
122
|
}
|
|
154
123
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stackStrategy.js","sources":["../../../src/asyncContext/stackStrategy.ts"],"sourcesContent":["import type { Client } from '../client';\nimport { getDefaultCurrentScope, getDefaultIsolationScope } from '../defaultScopes';\nimport { Scope } from '../scope';\nimport { chainAndCopyPromiseLike } from '../utils/chain-and-copy-promiselike';\nimport { isThenable } from '../utils/is';\nimport { getMainCarrier, getSentryCarrier } from './../carrier';\nimport type { AsyncContextStrategy } from './types';\n\ninterface Layer {\n client?: Client;\n scope: Scope;\n}\n\n/**\n * This is an object that holds a stack of scopes.\n */\nexport class AsyncContextStack {\n private readonly _stack: [Layer, ...Layer[]];\n private _isolationScope: Scope;\n\n public constructor(scope?: Scope, isolationScope?: Scope) {\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n // scope stack for domains or the process\n this._stack = [{ scope: assignedScope }];\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Fork a scope for the stack.\n */\n public withScope<T>(callback: (scope: Scope) => T): T {\n const scope = this._pushScope();\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n this._popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n return chainAndCopyPromiseLike(\n maybePromiseResult as PromiseLike<Awaited<typeof maybePromiseResult>> & Record<string, unknown>,\n () => this._popScope(),\n () => this._popScope(),\n ) as T;\n }\n\n this._popScope();\n return maybePromiseResult;\n }\n\n /**\n * Get the client of the stack.\n */\n public getClient<C extends Client>(): C | undefined {\n return this.getStackTop().client as C;\n }\n\n /**\n * Returns the scope of the top stack.\n */\n public getScope(): Scope {\n return this.getStackTop().scope;\n }\n\n /**\n * Get the isolation scope for the stack.\n */\n public getIsolationScope(): Scope {\n return this._isolationScope;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n */\n public getStackTop(): Layer {\n return this._stack[this._stack.length - 1] as Layer;\n }\n\n /**\n * Push a scope to the stack.\n */\n private _pushScope(): Scope {\n // We want to clone the content of prev scope\n const scope = this.getScope().clone();\n this._stack.push({\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * Pop a scope from the stack.\n */\n private _popScope(): boolean {\n if (this._stack.length <= 1) return false;\n return !!this._stack.pop();\n }\n}\n\n/**\n * Get the global async context stack.\n * This will be removed during the v8 cycle and is only here to make migration easier.\n */\nfunction getAsyncContextStack(): AsyncContextStack {\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n\n return (sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope()));\n}\n\nfunction withScope<T>(callback: (scope: Scope) => T): T {\n return getAsyncContextStack().withScope(callback);\n}\n\nfunction withSetScope<T>(scope: Scope, callback: (scope: Scope) => T): T {\n const stack = getAsyncContextStack();\n return stack.withScope(() => {\n stack.getStackTop().scope = scope;\n return callback(scope);\n });\n}\n\nfunction withIsolationScope<T>(callback: (isolationScope: Scope) => T): T {\n return getAsyncContextStack().withScope(() => {\n return callback(getAsyncContextStack().getIsolationScope());\n });\n}\n\n/**\n * Get the stack-based async context strategy.\n */\nexport function getStackAsyncContextStrategy(): AsyncContextStrategy {\n return {\n withIsolationScope,\n withScope,\n withSetScope,\n withSetIsolationScope: <T>(_isolationScope: Scope, callback: (isolationScope: Scope) => T) => {\n return withIsolationScope(callback);\n },\n getCurrentScope: () => getAsyncContextStack().getScope(),\n getIsolationScope: () => getAsyncContextStack().getIsolationScope(),\n };\n}\n"],"names":["scope","Scope","isThenable","chainAndCopyPromiseLike","getMainCarrier","getSentryCarrier","getDefaultCurrentScope","getDefaultIsolationScope"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"stackStrategy.js","sources":["../../../src/asyncContext/stackStrategy.ts"],"sourcesContent":["import type { Client } from '../client';\nimport { getDefaultCurrentScope, getDefaultIsolationScope } from '../defaultScopes';\nimport { Scope } from '../scope';\nimport { chainAndCopyPromiseLike } from '../utils/chain-and-copy-promiselike';\nimport { isThenable } from '../utils/is';\nimport { getMainCarrier, getSentryCarrier } from './../carrier';\nimport type { AsyncContextStrategy } from './types';\n\ninterface Layer {\n client?: Client;\n scope: Scope;\n}\n\n/**\n * This is an object that holds a stack of scopes.\n */\nexport class AsyncContextStack {\n private readonly _stack: [Layer, ...Layer[]];\n private _isolationScope: Scope;\n\n public constructor(scope?: Scope, isolationScope?: Scope) {\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n // scope stack for domains or the process\n this._stack = [{ scope: assignedScope }];\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Fork a scope for the stack.\n */\n public withScope<T>(callback: (scope: Scope) => T): T {\n const scope = this._pushScope();\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n this._popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n return chainAndCopyPromiseLike(\n maybePromiseResult as PromiseLike<Awaited<typeof maybePromiseResult>> & Record<string, unknown>,\n () => this._popScope(),\n () => this._popScope(),\n ) as T;\n }\n\n this._popScope();\n return maybePromiseResult;\n }\n\n /**\n * Get the client of the stack.\n */\n public getClient<C extends Client>(): C | undefined {\n return this.getStackTop().client as C;\n }\n\n /**\n * Returns the scope of the top stack.\n */\n public getScope(): Scope {\n return this.getStackTop().scope;\n }\n\n /**\n * Get the isolation scope for the stack.\n */\n public getIsolationScope(): Scope {\n return this._isolationScope;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n */\n public getStackTop(): Layer {\n return this._stack[this._stack.length - 1] as Layer;\n }\n\n /**\n * Push a scope to the stack.\n */\n private _pushScope(): Scope {\n // We want to clone the content of prev scope\n const scope = this.getScope().clone();\n this._stack.push({\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * Pop a scope from the stack.\n */\n private _popScope(): boolean {\n if (this._stack.length <= 1) return false;\n return !!this._stack.pop();\n }\n}\n\n/**\n * Get the global async context stack.\n * This will be removed during the v8 cycle and is only here to make migration easier.\n */\nfunction getAsyncContextStack(): AsyncContextStack {\n const registry = getMainCarrier();\n const sentry = getSentryCarrier(registry);\n\n return (sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope()));\n}\n\nfunction withScope<T>(callback: (scope: Scope) => T): T {\n return getAsyncContextStack().withScope(callback);\n}\n\nfunction withSetScope<T>(scope: Scope, callback: (scope: Scope) => T): T {\n const stack = getAsyncContextStack();\n return stack.withScope(() => {\n stack.getStackTop().scope = scope;\n return callback(scope);\n });\n}\n\nfunction withIsolationScope<T>(callback: (isolationScope: Scope) => T): T {\n return getAsyncContextStack().withScope(() => {\n return callback(getAsyncContextStack().getIsolationScope());\n });\n}\n\n/**\n * Get the stack-based async context strategy.\n */\nexport function getStackAsyncContextStrategy(): AsyncContextStrategy {\n return {\n withIsolationScope,\n withScope,\n withSetScope,\n withSetIsolationScope: <T>(_isolationScope: Scope, callback: (isolationScope: Scope) => T) => {\n return withIsolationScope(callback);\n },\n getCurrentScope: () => getAsyncContextStack().getScope(),\n getIsolationScope: () => getAsyncContextStack().getIsolationScope(),\n };\n}\n"],"names":["scope","Scope","isThenable","chainAndCopyPromiseLike","getMainCarrier","getSentryCarrier","getDefaultCurrentScope","getDefaultIsolationScope"],"mappings":";;;;;;;;AAgBO,MAAM,iBAAA,CAAkB;AAAA,EAItB,WAAA,CAAYA,SAAe,cAAA,EAAwB;AACxD,IAAA,IA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A,OAAO,SAAS,KAAK,CAAA;AAAA,EACvB,CAAC,CAAA;AACH;AAEA,SAAS,mBAAsB,QAAA,EAA2C;AACxE,EAAA,OAAO,oBAAA,EAAqB,CAAE,SAAA,CAAU,MAAM;AAC5C,IAAA,OAAO,QAAA,CAAS,oBAAA,EAAqB,CAAE,iBAAA,EAAmB,CAAA;AAAA,EAC5D,CAAC,CAAA;AACH;AAKO,SAAS,4BAAA,GAAqD;AACnE,EAAA,OAAO;AAAA,IACL,kBAAA;AAAA,IACA,SAAA;AAAA,IACA,YAAA;AAAA,IACA,qBAAA,EAAuB,CAAI,eAAA,EAAwB,QAAA,KAA2C;AAC5F,MAAA,OAAO,mBAAmB,QAAQ,CAAA;AAAA,IACpC,CAAA;AAAA,IACA,eAAA,EAAiB,MAAM,oBAAA,EAAqB,CAAE,QAAA,EAAS;AAAA,IACvD,iBAAA,EAAmB,MAAM,oBAAA,EAAqB,CAAE,iBAAA;AAAkB,GACpE;AACF;;;;;"}
|
package/build/cjs/attributes.js
CHANGED
|
@@ -2,75 +2,31 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const is = require('./utils/is.js');
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Type-guard: The attribute object has the shape the official attribute object (value, type, unit).
|
|
7
|
-
* https://develop.sentry.dev/sdk/telemetry/scopes/#setting-attributes
|
|
8
|
-
*/
|
|
9
5
|
function isAttributeObject(maybeObj) {
|
|
10
|
-
return (
|
|
11
|
-
typeof maybeObj === 'object' &&
|
|
12
|
-
maybeObj != null &&
|
|
13
|
-
!Array.isArray(maybeObj) &&
|
|
14
|
-
Object.keys(maybeObj).includes('value')
|
|
15
|
-
);
|
|
6
|
+
return typeof maybeObj === "object" && maybeObj != null && !Array.isArray(maybeObj) && Object.keys(maybeObj).includes("value");
|
|
16
7
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* Converts an attribute value to a typed attribute value.
|
|
20
|
-
*
|
|
21
|
-
* For now, we intentionally only support primitive values and attribute objects with primitive values.
|
|
22
|
-
* If @param useFallback is true, we stringify non-primitive values to a string attribute value. Otherwise
|
|
23
|
-
* we return `undefined` for unsupported values.
|
|
24
|
-
*
|
|
25
|
-
* @param value - The value of the passed attribute.
|
|
26
|
-
* @param useFallback - If true, unsupported values will be stringified to a string attribute value.
|
|
27
|
-
* Defaults to false. In this case, `undefined` is returned for unsupported values.
|
|
28
|
-
* @returns The typed attribute.
|
|
29
|
-
*/
|
|
30
|
-
function attributeValueToTypedAttributeValue(
|
|
31
|
-
rawValue,
|
|
32
|
-
useFallback,
|
|
33
|
-
) {
|
|
34
|
-
const { value, unit } = isAttributeObject(rawValue) ? rawValue : { value: rawValue, unit: undefined };
|
|
8
|
+
function attributeValueToTypedAttributeValue(rawValue, useFallback) {
|
|
9
|
+
const { value, unit } = isAttributeObject(rawValue) ? rawValue : { value: rawValue, unit: void 0 };
|
|
35
10
|
const attributeValue = getTypedAttributeValue(value);
|
|
36
|
-
const checkedUnit = unit && typeof unit ===
|
|
11
|
+
const checkedUnit = unit && typeof unit === "string" ? { unit } : {};
|
|
37
12
|
if (attributeValue) {
|
|
38
13
|
return { ...attributeValue, ...checkedUnit };
|
|
39
14
|
}
|
|
40
|
-
|
|
41
|
-
if (!useFallback || (useFallback === 'skip-undefined' && value === undefined)) {
|
|
15
|
+
if (!useFallback || useFallback === "skip-undefined" && value === void 0) {
|
|
42
16
|
return;
|
|
43
17
|
}
|
|
44
|
-
|
|
45
|
-
// Fallback: stringify the value
|
|
46
|
-
// TODO(v11): be smarter here and use String constructor if stringify fails
|
|
47
|
-
// (this is a breaking change for already existing attribute values)
|
|
48
|
-
let stringValue = '';
|
|
18
|
+
let stringValue = "";
|
|
49
19
|
try {
|
|
50
|
-
stringValue = JSON.stringify(value) ??
|
|
20
|
+
stringValue = JSON.stringify(value) ?? "";
|
|
51
21
|
} catch {
|
|
52
|
-
// Do nothing
|
|
53
22
|
}
|
|
54
23
|
return {
|
|
55
24
|
value: stringValue,
|
|
56
|
-
type:
|
|
57
|
-
...checkedUnit
|
|
25
|
+
type: "string",
|
|
26
|
+
...checkedUnit
|
|
58
27
|
};
|
|
59
28
|
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Serializes raw attributes to typed attributes as expected in our envelopes.
|
|
63
|
-
*
|
|
64
|
-
* @param attributes The raw attributes to serialize.
|
|
65
|
-
* @param fallback If true, unsupported values will be stringified to a string attribute value.
|
|
66
|
-
* Defaults to false. In this case, `undefined` is returned for unsupported values.
|
|
67
|
-
*
|
|
68
|
-
* @returns The serialized attributes.
|
|
69
|
-
*/
|
|
70
|
-
function serializeAttributes(
|
|
71
|
-
attributes,
|
|
72
|
-
fallback = false,
|
|
73
|
-
) {
|
|
29
|
+
function serializeAttributes(attributes, fallback = false) {
|
|
74
30
|
const serializedAttributes = {};
|
|
75
31
|
for (const [key, value] of Object.entries(attributes ?? {})) {
|
|
76
32
|
const typedValue = attributeValueToTypedAttributeValue(value, fallback);
|
|
@@ -80,11 +36,6 @@ function serializeAttributes(
|
|
|
80
36
|
}
|
|
81
37
|
return serializedAttributes;
|
|
82
38
|
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Estimates the serialized byte size of {@link Attributes},
|
|
86
|
-
* with a couple of heuristics for performance.
|
|
87
|
-
*/
|
|
88
39
|
function estimateTypedAttributesSizeInBytes(attributes) {
|
|
89
40
|
if (!attributes) {
|
|
90
41
|
return 0;
|
|
@@ -95,61 +46,32 @@ function estimateTypedAttributesSizeInBytes(attributes) {
|
|
|
95
46
|
weight += attr.type.length * 2;
|
|
96
47
|
weight += (attr.unit?.length ?? 0) * 2;
|
|
97
48
|
const val = attr.value;
|
|
98
|
-
|
|
99
49
|
if (Array.isArray(val)) {
|
|
100
|
-
// Assumption: Individual array items have the same type and roughly the same size
|
|
101
|
-
// probably not always true but allows us to cut down on runtime
|
|
102
50
|
weight += estimatePrimitiveSizeInBytes(val[0]) * val.length;
|
|
103
51
|
} else if (is.isPrimitive(val)) {
|
|
104
52
|
weight += estimatePrimitiveSizeInBytes(val);
|
|
105
53
|
} else {
|
|
106
|
-
// default fallback for anything else (objects)
|
|
107
54
|
weight += 100;
|
|
108
55
|
}
|
|
109
56
|
}
|
|
110
57
|
return weight;
|
|
111
58
|
}
|
|
112
|
-
|
|
113
59
|
function estimatePrimitiveSizeInBytes(value) {
|
|
114
|
-
if (typeof value ===
|
|
60
|
+
if (typeof value === "string") {
|
|
115
61
|
return value.length * 2;
|
|
116
|
-
} else if (typeof value ===
|
|
62
|
+
} else if (typeof value === "boolean") {
|
|
117
63
|
return 4;
|
|
118
|
-
} else if (typeof value ===
|
|
64
|
+
} else if (typeof value === "number") {
|
|
119
65
|
return 8;
|
|
120
66
|
}
|
|
121
67
|
return 0;
|
|
122
68
|
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* NOTE: We intentionally do not return anything for non-primitive values:
|
|
126
|
-
* - array support will come in the future but if we stringify arrays now,
|
|
127
|
-
* sending arrays (unstringified) later will be a subtle breaking change.
|
|
128
|
-
* - Objects are not supported yet and product support is still TBD.
|
|
129
|
-
* - We still keep the type signature for TypedAttributeValue wider to avoid a
|
|
130
|
-
* breaking change once we add support for non-primitive values.
|
|
131
|
-
* - Once we go back to supporting arrays and stringifying all other values,
|
|
132
|
-
* we already implemented the serialization logic here:
|
|
133
|
-
* https://github.com/getsentry/sentry-javascript/pull/18165
|
|
134
|
-
*/
|
|
135
69
|
function getTypedAttributeValue(value) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
? 'boolean'
|
|
141
|
-
: typeof value === 'number' && !Number.isNaN(value)
|
|
142
|
-
? Number.isInteger(value)
|
|
143
|
-
? 'integer'
|
|
144
|
-
: 'double'
|
|
145
|
-
: null;
|
|
70
|
+
if (Array.isArray(value)) {
|
|
71
|
+
return { value, type: "array" };
|
|
72
|
+
}
|
|
73
|
+
const primitiveType = typeof value === "string" ? "string" : typeof value === "boolean" ? "boolean" : typeof value === "number" && !Number.isNaN(value) ? Number.isInteger(value) ? "integer" : "double" : null;
|
|
146
74
|
if (primitiveType) {
|
|
147
|
-
// @ts-expect-error - TS complains because {@link TypedAttributeValue} is strictly typed to
|
|
148
|
-
// avoid setting the wrong `type` on the attribute value.
|
|
149
|
-
// In this case, getPrimitiveType already does the check but TS doesn't know that.
|
|
150
|
-
// The "clean" alternative is to return an object per `typeof value` case
|
|
151
|
-
// but that would require more bundle size
|
|
152
|
-
// Therefore, we ignore it.
|
|
153
75
|
return { value, type: primitiveType };
|
|
154
76
|
}
|
|
155
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.js","sources":["../../src/attributes.ts"],"sourcesContent":["import type { DurationUnit, FractionUnit, InformationUnit } from './types-hoist/measurement';\nimport type { Primitive } from './types-hoist/misc';\nimport { isPrimitive } from './utils/is';\n\nexport type RawAttributes<T> = T & ValidatedAttributes<T>;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RawAttribute<T> = T extends { value: any } | { unit: any } ? AttributeObject : T;\n\nexport type Attributes = Record<string, TypedAttributeValue>;\n\nexport type AttributeValueType = string | number | boolean | Array<string> | Array<number> | Array<boolean>;\n\ntype AttributeTypeMap = {\n string: string;\n integer: number;\n double: number;\n boolean: boolean;\n 'string[]': Array<string>;\n 'integer[]': Array<number>;\n 'double[]': Array<number>;\n 'boolean[]': Array<boolean>;\n};\n\n/* Generates a type from the AttributeTypeMap like:\n | { value: string; type: 'string' }\n | { value: number; type: 'integer' }\n | { value: number; type: 'double' }\n */\ntype AttributeUnion = {\n [K in keyof AttributeTypeMap]: {\n value: AttributeTypeMap[K];\n type: K;\n };\n}[keyof AttributeTypeMap];\n\nexport type TypedAttributeValue = AttributeUnion & { unit?: AttributeUnit };\n\nexport type AttributeObject = {\n value: unknown;\n unit?: AttributeUnit;\n};\n\n// Unfortunately, we loose type safety if we did something like Exclude<MeasurementUnit, string>\n// so therefore we unionize between the three supported unit categories.\ntype AttributeUnit = DurationUnit | InformationUnit | FractionUnit;\n\n/* If an attribute has either a 'value' or 'unit' property, we use the ValidAttributeObject type. */\nexport type ValidatedAttributes<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends { value: any } | { unit: any } ? AttributeObject : unknown;\n};\n\n/**\n * Type-guard: The attribute object has the shape the official attribute object (value, type, unit).\n * https://develop.sentry.dev/sdk/telemetry/scopes/#setting-attributes\n */\nexport function isAttributeObject(maybeObj: unknown): maybeObj is AttributeObject {\n return (\n typeof maybeObj === 'object' &&\n maybeObj != null &&\n !Array.isArray(maybeObj) &&\n Object.keys(maybeObj).includes('value')\n );\n}\n\n/**\n * Converts an attribute value to a typed attribute value.\n *\n * For now, we intentionally only support primitive values and attribute objects with primitive values.\n * If @param useFallback is true, we stringify non-primitive values to a string attribute value. Otherwise\n * we return `undefined` for unsupported values.\n *\n * @param value - The value of the passed attribute.\n * @param useFallback - If true, unsupported values will be stringified to a string attribute value.\n * Defaults to false. In this case, `undefined` is returned for unsupported values.\n * @returns The typed attribute.\n */\nexport function attributeValueToTypedAttributeValue(\n rawValue: unknown,\n useFallback?: boolean | 'skip-undefined',\n): TypedAttributeValue | void {\n const { value, unit } = isAttributeObject(rawValue) ? rawValue : { value: rawValue, unit: undefined };\n const attributeValue = getTypedAttributeValue(value);\n const checkedUnit = unit && typeof unit === 'string' ? { unit } : {};\n if (attributeValue) {\n return { ...attributeValue, ...checkedUnit };\n }\n\n if (!useFallback || (useFallback === 'skip-undefined' && value === undefined)) {\n return;\n }\n\n // Fallback: stringify the value\n // TODO(v11): be smarter here and use String constructor if stringify fails\n // (this is a breaking change for already existing attribute values)\n let stringValue = '';\n try {\n stringValue = JSON.stringify(value) ?? '';\n } catch {\n // Do nothing\n }\n return {\n value: stringValue,\n type: 'string',\n ...checkedUnit,\n };\n}\n\n/**\n * Serializes raw attributes to typed attributes as expected in our envelopes.\n *\n * @param attributes The raw attributes to serialize.\n * @param fallback If true, unsupported values will be stringified to a string attribute value.\n * Defaults to false. In this case, `undefined` is returned for unsupported values.\n *\n * @returns The serialized attributes.\n */\nexport function serializeAttributes<T>(\n attributes: RawAttributes<T> | undefined,\n fallback: boolean | 'skip-undefined' = false,\n): Attributes {\n const serializedAttributes: Attributes = {};\n for (const [key, value] of Object.entries(attributes ?? {})) {\n const typedValue = attributeValueToTypedAttributeValue(value, fallback);\n if (typedValue) {\n serializedAttributes[key] = typedValue;\n }\n }\n return serializedAttributes;\n}\n\n/**\n * Estimates the serialized byte size of {@link Attributes},\n * with a couple of heuristics for performance.\n */\nexport function estimateTypedAttributesSizeInBytes(attributes: Attributes | undefined): number {\n if (!attributes) {\n return 0;\n }\n let weight = 0;\n for (const [key, attr] of Object.entries(attributes)) {\n weight += key.length * 2;\n weight += attr.type.length * 2;\n weight += (attr.unit?.length ?? 0) * 2;\n const val = attr.value;\n\n if (Array.isArray(val)) {\n // Assumption: Individual array items have the same type and roughly the same size\n // probably not always true but allows us to cut down on runtime\n weight += estimatePrimitiveSizeInBytes(val[0]) * val.length;\n } else if (isPrimitive(val)) {\n weight += estimatePrimitiveSizeInBytes(val);\n } else {\n // default fallback for anything else (objects)\n weight += 100;\n }\n }\n return weight;\n}\n\nfunction estimatePrimitiveSizeInBytes(value: Primitive): number {\n if (typeof value === 'string') {\n return value.length * 2;\n } else if (typeof value === 'boolean') {\n return 4;\n } else if (typeof value === 'number') {\n return 8;\n }\n return 0;\n}\n\n/**\n * NOTE: We intentionally do not return anything for non-primitive values:\n * - array support will come in the future but if we stringify arrays now,\n * sending arrays (unstringified) later will be a subtle breaking change.\n * - Objects are not supported yet and product support is still TBD.\n * - We still keep the type signature for TypedAttributeValue wider to avoid a\n * breaking change once we add support for non-primitive values.\n * - Once we go back to supporting arrays and stringifying all other values,\n * we already implemented the serialization logic here:\n * https://github.com/getsentry/sentry-javascript/pull/18165\n */\nfunction getTypedAttributeValue(value: unknown): TypedAttributeValue | void {\n const primitiveType =\n typeof value === 'string'\n ? 'string'\n : typeof value === 'boolean'\n ? 'boolean'\n : typeof value === 'number' && !Number.isNaN(value)\n ? Number.isInteger(value)\n ? 'integer'\n : 'double'\n : null;\n if (primitiveType) {\n // @ts-expect-error - TS complains because {@link TypedAttributeValue} is strictly typed to\n // avoid setting the wrong `type` on the attribute value.\n // In this case, getPrimitiveType already does the check but TS doesn't know that.\n // The \"clean\" alternative is to return an object per `typeof value` case\n // but that would require more bundle size\n // Therefore, we ignore it.\n return { value, type: primitiveType };\n }\n}\n"],"names":["isPrimitive"],"mappings":";;;;AAoDA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,QAAQ,EAAwC;AAClF,EAAE;AACF,IAAI,OAAO,QAAA,KAAa,QAAA;AACxB,IAAI,QAAA,IAAY,IAAA;AAChB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAA;AAC3B,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mCAAmC;AACnD,EAAE,QAAQ;AACV,EAAE,WAAW;AACb,EAA8B;AAC9B,EAAE,MAAM,EAAE,KAAK,EAAE,MAAK,GAAI,iBAAiB,CAAC,QAAQ,CAAA,GAAI,QAAA,GAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAA,EAAW;AACvG,EAAE,MAAM,cAAA,GAAiB,sBAAsB,CAAC,KAAK,CAAC;AACtD,EAAE,MAAM,WAAA,GAAc,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,GAAW,EAAE,IAAA,EAAK,GAAI,EAAE;AACtE,EAAE,IAAI,cAAc,EAAE;AACtB,IAAI,OAAO,EAAE,GAAG,cAAc,EAAE,GAAG,aAAa;AAChD,EAAE;;AAEF,EAAE,IAAI,CAAC,WAAA,KAAgB,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AAY,IAAI;AAChB,EAAE,IAAI,aAAa,EAAE;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe;AACzC,EAAE;AACF;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"attributes.js","sources":["../../src/attributes.ts"],"sourcesContent":["import type { DurationUnit, FractionUnit, InformationUnit } from './types/measurement';\nimport type { Primitive } from './types/misc';\nimport { isPrimitive } from './utils/is';\n\nexport type RawAttributes<T> = T & ValidatedAttributes<T>;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type RawAttribute<T> = T extends { value: any } | { unit: any } ? AttributeObject : T;\n\nexport type Attributes = Record<string, TypedAttributeValue>;\n\nexport type AttributeValueType = string | number | boolean | Array<string> | Array<number> | Array<boolean>;\n\ntype AttributeTypeMap = {\n string: string;\n integer: number;\n double: number;\n boolean: boolean;\n array: Array<string> | Array<number> | Array<boolean>;\n};\n\n/* Generates a type from the AttributeTypeMap like:\n | { value: string; type: 'string' }\n | { value: number; type: 'integer' }\n | { value: number; type: 'double' }\n */\ntype AttributeUnion = {\n [K in keyof AttributeTypeMap]: {\n value: AttributeTypeMap[K];\n type: K;\n };\n}[keyof AttributeTypeMap];\n\nexport type TypedAttributeValue = AttributeUnion & { unit?: AttributeUnit };\n\nexport type AttributeObject = {\n value: unknown;\n unit?: AttributeUnit;\n};\n\n// Unfortunately, we loose type safety if we did something like Exclude<MeasurementUnit, string>\n// so therefore we unionize between the three supported unit categories.\ntype AttributeUnit = DurationUnit | InformationUnit | FractionUnit;\n\n/* If an attribute has either a 'value' or 'unit' property, we use the ValidAttributeObject type. */\nexport type ValidatedAttributes<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [K in keyof T]: T[K] extends { value: any } | { unit: any } ? AttributeObject : unknown;\n};\n\n/**\n * Type-guard: The attribute object has the shape the official attribute object (value, type, unit).\n * https://develop.sentry.dev/sdk/telemetry/scopes/#setting-attributes\n */\nexport function isAttributeObject(maybeObj: unknown): maybeObj is AttributeObject {\n return (\n typeof maybeObj === 'object' &&\n maybeObj != null &&\n !Array.isArray(maybeObj) &&\n Object.keys(maybeObj).includes('value')\n );\n}\n\n/**\n * Converts an attribute value to a typed attribute value.\n *\n * For now, we support primitive values and arrays, either raw or inside attribute objects.\n * If @param useFallback is true, we stringify other non-primitive values to a string attribute\n * value. Otherwise we return `undefined` for unsupported values.\n *\n * @param value - The value of the passed attribute.\n * @param useFallback - If true, unsupported values will be stringified to a string attribute value.\n * Defaults to false. In this case, `undefined` is returned for unsupported values.\n * @returns The typed attribute.\n */\nexport function attributeValueToTypedAttributeValue(\n rawValue: unknown,\n useFallback?: boolean | 'skip-undefined',\n): TypedAttributeValue | void {\n const { value, unit } = isAttributeObject(rawValue) ? rawValue : { value: rawValue, unit: undefined };\n const attributeValue = getTypedAttributeValue(value);\n const checkedUnit = unit && typeof unit === 'string' ? { unit } : {};\n if (attributeValue) {\n return { ...attributeValue, ...checkedUnit };\n }\n\n if (!useFallback || (useFallback === 'skip-undefined' && value === undefined)) {\n return;\n }\n\n // Fallback: stringify the value\n // TODO(v11): be smarter here and use String constructor if stringify fails\n // (this is a breaking change for already existing attribute values)\n let stringValue = '';\n try {\n stringValue = JSON.stringify(value) ?? '';\n } catch {\n // Do nothing\n }\n return {\n value: stringValue,\n type: 'string',\n ...checkedUnit,\n };\n}\n\n/**\n * Serializes raw attributes to typed attributes as expected in our envelopes.\n *\n * @param attributes The raw attributes to serialize.\n * @param fallback If true, unsupported values will be stringified to a string attribute value.\n * Defaults to false. In this case, `undefined` is returned for unsupported values.\n *\n * @returns The serialized attributes.\n */\nexport function serializeAttributes<T>(\n attributes: RawAttributes<T> | undefined,\n fallback: boolean | 'skip-undefined' = false,\n): Attributes {\n const serializedAttributes: Attributes = {};\n for (const [key, value] of Object.entries(attributes ?? {})) {\n const typedValue = attributeValueToTypedAttributeValue(value, fallback);\n if (typedValue) {\n serializedAttributes[key] = typedValue;\n }\n }\n return serializedAttributes;\n}\n\n/**\n * Estimates the serialized byte size of {@link Attributes},\n * with a couple of heuristics for performance.\n */\nexport function estimateTypedAttributesSizeInBytes(attributes: Attributes | undefined): number {\n if (!attributes) {\n return 0;\n }\n let weight = 0;\n for (const [key, attr] of Object.entries(attributes)) {\n weight += key.length * 2;\n weight += attr.type.length * 2;\n weight += (attr.unit?.length ?? 0) * 2;\n const val = attr.value;\n\n if (Array.isArray(val)) {\n // Assumption: Individual array items have the same type and roughly the same size\n // probably not always true but allows us to cut down on runtime\n weight += estimatePrimitiveSizeInBytes(val[0]) * val.length;\n } else if (isPrimitive(val)) {\n weight += estimatePrimitiveSizeInBytes(val);\n } else {\n // default fallback for anything else (objects)\n weight += 100;\n }\n }\n return weight;\n}\n\nfunction estimatePrimitiveSizeInBytes(value: Primitive): number {\n if (typeof value === 'string') {\n return value.length * 2;\n } else if (typeof value === 'boolean') {\n return 4;\n } else if (typeof value === 'number') {\n return 8;\n }\n return 0;\n}\n\n/**\n * NOTE: We return typed attributes for primitives and arrays:\n * - Relay currently only supports arrays consisting of primitive values. Attributes with non-conforming arrays are dropped by Relay, so runtime type validation in the SDK is unnecessary.\n * - Objects are not supported yet and product support is still TBD.\n */\nfunction getTypedAttributeValue(value: unknown): TypedAttributeValue | void {\n if (Array.isArray(value)) {\n return { value, type: 'array' };\n }\n\n const primitiveType =\n typeof value === 'string'\n ? 'string'\n : typeof value === 'boolean'\n ? 'boolean'\n : typeof value === 'number' && !Number.isNaN(value)\n ? Number.isInteger(value)\n ? 'integer'\n : 'double'\n : null;\n if (primitiveType) {\n // @ts-expect-error - TS complains because {@link TypedAttributeValue} is strictly typed to\n // avoid setting the wrong `type` on the attribute value.\n // In this case, getPrimitiveType already does the check but TS doesn't know that.\n // The \"clean\" alternative is to return an object per `typeof value` case\n // but that would require more bundle size\n // Therefore, we ignore it.\n return { value, type: primitiveType };\n }\n}\n"],"names":["isPrimitive"],"mappings":";;;;AAqDO,SAAS,kBAAkB,QAAA,EAA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