@sentry/browser 10.53.0 → 10.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/npm/cjs/dev/client.js +15 -54
- package/build/npm/cjs/dev/client.js.map +1 -1
- package/build/npm/cjs/dev/debug-build.js +0 -5
- package/build/npm/cjs/dev/debug-build.js.map +1 -1
- package/build/npm/cjs/dev/diagnose-sdk.js +15 -37
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/dev/eventbuilder.js +59 -217
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
- package/build/npm/cjs/dev/feedbackAsync.js +1 -5
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/dev/feedbackSync.js +1 -2
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
- package/build/npm/cjs/dev/helpers.js +24 -102
- package/build/npm/cjs/dev/helpers.js.map +1 -1
- package/build/npm/cjs/dev/index.js +2 -0
- package/build/npm/cjs/dev/index.js.map +1 -1
- package/build/npm/cjs/dev/integrations/breadcrumbs.js +52 -134
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browserapierrors.js +45 -111
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browsersession.js +7 -35
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/dev/integrations/contextlines.js +9 -45
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/dev/integrations/culturecontext.js +11 -36
- package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +60 -0
- package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/cjs/dev/integrations/globalhandlers.js +38 -99
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/dev/integrations/graphqlClient.js +31 -119
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpclient.js +43 -203
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpcontext.js +7 -17
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/linkederrors.js +7 -15
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/reportingobserver.js +19 -44
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spanstreaming.js +11 -29
- package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spotlight.js +17 -30
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/dev/integrations/view-hierarchy.js +19 -46
- package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/dev/integrations/webWorker.js +40 -211
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/dev/profiling/UIProfiler.js +87 -190
- package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/dev/profiling/index.js +9 -30
- package/build/npm/cjs/dev/profiling/index.js.map +1 -1
- package/build/npm/cjs/dev/profiling/integration.js +30 -64
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js +28 -84
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/dev/profiling/utils.js +131 -398
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
- package/build/npm/cjs/dev/report-dialog.js +10 -25
- package/build/npm/cjs/dev/report-dialog.js.map +1 -1
- package/build/npm/cjs/dev/sdk.js +8 -76
- package/build/npm/cjs/dev/sdk.js.map +1 -1
- package/build/npm/cjs/dev/stack-parsers.js +42 -126
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
- package/build/npm/cjs/dev/tracing/backgroundtab.js +4 -16
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/dev/tracing/linkedTraces.js +25 -116
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js +1 -9
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/dev/tracing/request.js +58 -223
- package/build/npm/cjs/dev/tracing/request.js.map +1 -1
- package/build/npm/cjs/dev/tracing/setActiveSpan.js +1 -48
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/dev/tracing/utils.js +4 -27
- package/build/npm/cjs/dev/tracing/utils.js.map +1 -1
- package/build/npm/cjs/dev/transports/fetch.js +10 -23
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
- package/build/npm/cjs/dev/transports/offline.js +27 -84
- package/build/npm/cjs/dev/transports/offline.js.map +1 -1
- package/build/npm/cjs/dev/userfeedback.js +12 -22
- package/build/npm/cjs/dev/userfeedback.js.map +1 -1
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js +5 -26
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/cjs/prod/client.js +15 -54
- package/build/npm/cjs/prod/client.js.map +1 -1
- package/build/npm/cjs/prod/debug-build.js +0 -5
- package/build/npm/cjs/prod/debug-build.js.map +1 -1
- package/build/npm/cjs/prod/diagnose-sdk.js +15 -37
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/prod/eventbuilder.js +59 -217
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
- package/build/npm/cjs/prod/feedbackAsync.js +1 -5
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/prod/feedbackSync.js +1 -2
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
- package/build/npm/cjs/prod/helpers.js +24 -102
- package/build/npm/cjs/prod/helpers.js.map +1 -1
- package/build/npm/cjs/prod/index.js +2 -0
- package/build/npm/cjs/prod/index.js.map +1 -1
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +52 -134
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browserapierrors.js +45 -111
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browsersession.js +7 -35
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/prod/integrations/contextlines.js +9 -45
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/prod/integrations/culturecontext.js +11 -36
- package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +60 -0
- package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js +38 -99
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/prod/integrations/graphqlClient.js +31 -119
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpclient.js +43 -203
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpcontext.js +7 -17
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/linkederrors.js +7 -15
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/reportingobserver.js +19 -44
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spanstreaming.js +11 -29
- package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spotlight.js +17 -30
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/prod/integrations/view-hierarchy.js +19 -46
- package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/prod/integrations/webWorker.js +40 -211
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/prod/profiling/UIProfiler.js +87 -190
- package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/prod/profiling/index.js +9 -30
- package/build/npm/cjs/prod/profiling/index.js.map +1 -1
- package/build/npm/cjs/prod/profiling/integration.js +30 -64
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +28 -84
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/prod/profiling/utils.js +131 -398
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
- package/build/npm/cjs/prod/report-dialog.js +10 -25
- package/build/npm/cjs/prod/report-dialog.js.map +1 -1
- package/build/npm/cjs/prod/sdk.js +5 -73
- package/build/npm/cjs/prod/sdk.js.map +1 -1
- package/build/npm/cjs/prod/stack-parsers.js +42 -126
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
- package/build/npm/cjs/prod/tracing/backgroundtab.js +4 -16
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/prod/tracing/linkedTraces.js +25 -117
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +1 -9
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/prod/tracing/request.js +58 -223
- package/build/npm/cjs/prod/tracing/request.js.map +1 -1
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +1 -48
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/prod/tracing/utils.js +4 -27
- package/build/npm/cjs/prod/tracing/utils.js.map +1 -1
- package/build/npm/cjs/prod/transports/fetch.js +10 -23
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
- package/build/npm/cjs/prod/transports/offline.js +27 -84
- package/build/npm/cjs/prod/transports/offline.js.map +1 -1
- package/build/npm/cjs/prod/userfeedback.js +12 -22
- package/build/npm/cjs/prod/userfeedback.js.map +1 -1
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +5 -26
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/dev/client.js +15 -54
- package/build/npm/esm/dev/client.js.map +1 -1
- package/build/npm/esm/dev/debug-build.js +0 -5
- package/build/npm/esm/dev/debug-build.js.map +1 -1
- package/build/npm/esm/dev/diagnose-sdk.js +15 -37
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/dev/eventbuilder.js +59 -217
- package/build/npm/esm/dev/eventbuilder.js.map +1 -1
- package/build/npm/esm/dev/feedbackAsync.js +1 -5
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
- package/build/npm/esm/dev/feedbackSync.js +1 -2
- package/build/npm/esm/dev/feedbackSync.js.map +1 -1
- package/build/npm/esm/dev/helpers.js +24 -102
- package/build/npm/esm/dev/helpers.js.map +1 -1
- package/build/npm/esm/dev/index.js +1 -0
- package/build/npm/esm/dev/index.js.map +1 -1
- package/build/npm/esm/dev/integrations/breadcrumbs.js +52 -134
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/dev/integrations/browserapierrors.js +45 -111
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/browsersession.js +7 -35
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/dev/integrations/contextlines.js +9 -45
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/dev/integrations/culturecontext.js +11 -36
- package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +58 -0
- package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/esm/dev/integrations/globalhandlers.js +38 -99
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/dev/integrations/graphqlClient.js +31 -119
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpclient.js +43 -203
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpcontext.js +7 -17
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/linkederrors.js +7 -15
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/reportingobserver.js +19 -44
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/dev/integrations/spanstreaming.js +11 -29
- package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/dev/integrations/spotlight.js +17 -30
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/dev/integrations/view-hierarchy.js +19 -46
- package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/dev/integrations/webWorker.js +40 -211
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/esm/dev/package.json +1 -1
- package/build/npm/esm/dev/profiling/UIProfiler.js +87 -190
- package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/dev/profiling/index.js +9 -30
- package/build/npm/esm/dev/profiling/index.js.map +1 -1
- package/build/npm/esm/dev/profiling/integration.js +30 -64
- package/build/npm/esm/dev/profiling/integration.js.map +1 -1
- package/build/npm/esm/dev/profiling/startProfileForSpan.js +28 -84
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/dev/profiling/utils.js +131 -398
- package/build/npm/esm/dev/profiling/utils.js.map +1 -1
- package/build/npm/esm/dev/report-dialog.js +10 -25
- package/build/npm/esm/dev/report-dialog.js.map +1 -1
- package/build/npm/esm/dev/sdk.js +8 -76
- package/build/npm/esm/dev/sdk.js.map +1 -1
- package/build/npm/esm/dev/stack-parsers.js +42 -126
- package/build/npm/esm/dev/stack-parsers.js.map +1 -1
- package/build/npm/esm/dev/tracing/backgroundtab.js +4 -16
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/dev/tracing/linkedTraces.js +25 -116
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -9
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/dev/tracing/request.js +59 -224
- package/build/npm/esm/dev/tracing/request.js.map +1 -1
- package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -48
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/dev/tracing/utils.js +4 -27
- package/build/npm/esm/dev/tracing/utils.js.map +1 -1
- package/build/npm/esm/dev/transports/fetch.js +10 -23
- package/build/npm/esm/dev/transports/fetch.js.map +1 -1
- package/build/npm/esm/dev/transports/offline.js +27 -84
- package/build/npm/esm/dev/transports/offline.js.map +1 -1
- package/build/npm/esm/dev/userfeedback.js +12 -22
- package/build/npm/esm/dev/userfeedback.js.map +1 -1
- package/build/npm/esm/dev/utils/detectBrowserExtension.js +5 -26
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/prod/client.js +15 -54
- package/build/npm/esm/prod/client.js.map +1 -1
- package/build/npm/esm/prod/debug-build.js +0 -5
- package/build/npm/esm/prod/debug-build.js.map +1 -1
- package/build/npm/esm/prod/diagnose-sdk.js +15 -37
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/prod/eventbuilder.js +59 -217
- package/build/npm/esm/prod/eventbuilder.js.map +1 -1
- package/build/npm/esm/prod/feedbackAsync.js +1 -5
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
- package/build/npm/esm/prod/feedbackSync.js +1 -2
- package/build/npm/esm/prod/feedbackSync.js.map +1 -1
- package/build/npm/esm/prod/helpers.js +24 -102
- package/build/npm/esm/prod/helpers.js.map +1 -1
- package/build/npm/esm/prod/index.js +1 -0
- package/build/npm/esm/prod/index.js.map +1 -1
- package/build/npm/esm/prod/integrations/breadcrumbs.js +52 -134
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/prod/integrations/browserapierrors.js +45 -111
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/browsersession.js +7 -35
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/prod/integrations/contextlines.js +9 -45
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/prod/integrations/culturecontext.js +11 -36
- package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -22
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +6 -12
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +5 -30
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +10 -47
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +58 -0
- package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js +38 -99
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/prod/integrations/graphqlClient.js +31 -119
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpclient.js +43 -203
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpcontext.js +7 -17
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/linkederrors.js +7 -15
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/reportingobserver.js +19 -44
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/prod/integrations/spanstreaming.js +11 -29
- package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/prod/integrations/spotlight.js +17 -30
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/prod/integrations/view-hierarchy.js +19 -46
- package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/prod/integrations/webWorker.js +40 -211
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/esm/prod/package.json +1 -1
- package/build/npm/esm/prod/profiling/UIProfiler.js +87 -190
- package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/prod/profiling/index.js +9 -30
- package/build/npm/esm/prod/profiling/index.js.map +1 -1
- package/build/npm/esm/prod/profiling/integration.js +30 -64
- package/build/npm/esm/prod/profiling/integration.js.map +1 -1
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +28 -84
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/prod/profiling/utils.js +131 -398
- package/build/npm/esm/prod/profiling/utils.js.map +1 -1
- package/build/npm/esm/prod/report-dialog.js +10 -25
- package/build/npm/esm/prod/report-dialog.js.map +1 -1
- package/build/npm/esm/prod/sdk.js +5 -73
- package/build/npm/esm/prod/sdk.js.map +1 -1
- package/build/npm/esm/prod/stack-parsers.js +42 -126
- package/build/npm/esm/prod/stack-parsers.js.map +1 -1
- package/build/npm/esm/prod/tracing/backgroundtab.js +4 -16
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +102 -291
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/prod/tracing/linkedTraces.js +25 -117
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -9
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/prod/tracing/request.js +59 -224
- package/build/npm/esm/prod/tracing/request.js.map +1 -1
- package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -48
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/prod/tracing/utils.js +4 -27
- package/build/npm/esm/prod/tracing/utils.js.map +1 -1
- package/build/npm/esm/prod/transports/fetch.js +10 -23
- package/build/npm/esm/prod/transports/fetch.js.map +1 -1
- package/build/npm/esm/prod/transports/offline.js +27 -84
- package/build/npm/esm/prod/transports/offline.js.map +1 -1
- package/build/npm/esm/prod/userfeedback.js +12 -22
- package/build/npm/esm/prod/userfeedback.js.map +1 -1
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +5 -26
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +40 -75
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/types/eventbuilder.d.ts.map +1 -1
- package/build/npm/types/helpers.d.ts.map +1 -1
- package/build/npm/types/index.bundle.d.ts +2 -2
- package/build/npm/types/index.bundle.d.ts.map +1 -1
- package/build/npm/types/index.bundle.feedback.d.ts +2 -2
- package/build/npm/types/index.bundle.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.logs.metrics.d.ts +2 -2
- package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.feedback.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.d.ts +1 -0
- package/build/npm/types/index.d.ts.map +1 -1
- package/build/npm/types/integrations/fetchStreamPerformance.d.ts +14 -0
- package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -0
- package/build/npm/types/tracing/browserTracingIntegration.d.ts +3 -0
- package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
- package/build/npm/types/tracing/request.d.ts +3 -0
- package/build/npm/types/tracing/request.d.ts.map +1 -1
- package/build/npm/types-ts3.8/index.bundle.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.feedback.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.feedback.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
- package/build/npm/types-ts3.8/index.d.ts +1 -0
- package/build/npm/types-ts3.8/integrations/fetchStreamPerformance.d.ts +14 -0
- package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +3 -0
- package/build/npm/types-ts3.8/tracing/request.d.ts +3 -0
- package/package.json +7 -7
|
@@ -2,28 +2,20 @@ import { TRACING_DEFAULTS, consoleSandbox, getLocationHref, browserPerformanceTi
|
|
|
2
2
|
import { addHistoryInstrumentationHandler, registerInpInteractionListener, startTrackingWebVitals, trackLcpAsSpan, trackClsAsSpan, trackInpAsSpan, startTrackingINP, startTrackingLongAnimationFrames, startTrackingLongTasks, startTrackingInteractions, addPerformanceEntries } from '@sentry-internal/browser-utils';
|
|
3
3
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
4
4
|
import { WINDOW, getHttpRequestData } from '../helpers.js';
|
|
5
|
+
import { fetchStreamPerformanceIntegration } from '../integrations/fetchStreamPerformance.js';
|
|
5
6
|
import { registerBackgroundTabDetection } from './backgroundtab.js';
|
|
6
7
|
import { linkTraces } from './linkedTraces.js';
|
|
7
8
|
import { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request.js';
|
|
8
9
|
|
|
9
|
-
const BROWSER_TRACING_INTEGRATION_ID =
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* We don't want to start a bunch of idle timers and PerformanceObservers
|
|
13
|
-
* for web crawlers, as they may prevent the page from being seen as "idle"
|
|
14
|
-
* by the crawler's rendering engine (e.g. Googlebot's headless Chromium).
|
|
15
|
-
*/
|
|
16
|
-
const BOT_USER_AGENT_RE =
|
|
17
|
-
/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;
|
|
18
|
-
|
|
10
|
+
const BROWSER_TRACING_INTEGRATION_ID = "BrowserTracing";
|
|
11
|
+
const BOT_USER_AGENT_RE = /Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;
|
|
19
12
|
function isBotUserAgent() {
|
|
20
|
-
const nav = WINDOW.navigator
|
|
13
|
+
const nav = WINDOW.navigator;
|
|
21
14
|
if (!nav?.userAgent) {
|
|
22
15
|
return false;
|
|
23
16
|
}
|
|
24
17
|
return BOT_USER_AGENT_RE.test(nav.userAgent);
|
|
25
18
|
}
|
|
26
|
-
|
|
27
19
|
const DEFAULT_BROWSER_TRACING_OPTIONS = {
|
|
28
20
|
...TRACING_DEFAULTS,
|
|
29
21
|
instrumentNavigation: true,
|
|
@@ -35,43 +27,25 @@ const DEFAULT_BROWSER_TRACING_OPTIONS = {
|
|
|
35
27
|
ignoreResourceSpans: [],
|
|
36
28
|
ignorePerformanceApiSpans: [],
|
|
37
29
|
detectRedirects: true,
|
|
38
|
-
linkPreviousTrace:
|
|
30
|
+
linkPreviousTrace: "in-memory",
|
|
39
31
|
consistentTraceSampling: false,
|
|
40
32
|
enableReportPageLoaded: false,
|
|
41
33
|
_experiments: {},
|
|
42
|
-
...defaultRequestInstrumentationOptions
|
|
34
|
+
...defaultRequestInstrumentationOptions
|
|
43
35
|
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* The Browser Tracing integration automatically instruments browser pageload/navigation
|
|
47
|
-
* actions as transactions, and captures requests, metrics and errors as spans.
|
|
48
|
-
*
|
|
49
|
-
* The integration can be configured with a variety of options, and can be extended to use
|
|
50
|
-
* any routing library.
|
|
51
|
-
*
|
|
52
|
-
* We explicitly export the proper type here, as this has to be extended in some cases.
|
|
53
|
-
*/
|
|
54
36
|
const browserTracingIntegration = ((options = {}) => {
|
|
55
|
-
if (
|
|
37
|
+
if ("enableElementTiming" in options) {
|
|
56
38
|
consoleSandbox(() => {
|
|
57
|
-
// oxlint-disable-next-line no-console
|
|
58
39
|
console.warn(
|
|
59
|
-
|
|
40
|
+
"[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead."
|
|
60
41
|
);
|
|
61
42
|
});
|
|
62
43
|
}
|
|
63
|
-
|
|
64
44
|
const latestRoute = {
|
|
65
|
-
name:
|
|
66
|
-
source:
|
|
45
|
+
name: void 0,
|
|
46
|
+
source: void 0
|
|
67
47
|
};
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* This is just a small wrapper that makes `document` optional.
|
|
71
|
-
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
|
|
72
|
-
*/
|
|
73
|
-
const optionalWindowDocument = WINDOW.document ;
|
|
74
|
-
|
|
48
|
+
const optionalWindowDocument = WINDOW.document;
|
|
75
49
|
const {
|
|
76
50
|
enableInp,
|
|
77
51
|
enableLongTask,
|
|
@@ -96,59 +70,41 @@ const browserTracingIntegration = ((options = {}) => {
|
|
|
96
70
|
consistentTraceSampling,
|
|
97
71
|
enableReportPageLoaded,
|
|
98
72
|
onRequestSpanStart,
|
|
99
|
-
onRequestSpanEnd
|
|
73
|
+
onRequestSpanEnd
|
|
100
74
|
} = {
|
|
101
75
|
...DEFAULT_BROWSER_TRACING_OPTIONS,
|
|
102
|
-
...options
|
|
76
|
+
...options
|
|
103
77
|
};
|
|
104
|
-
|
|
105
78
|
const _isBot = isBotUserAgent();
|
|
106
|
-
|
|
107
79
|
let _collectWebVitals;
|
|
108
80
|
let lastInteractionTimestamp;
|
|
109
|
-
|
|
110
81
|
let _pageloadSpan;
|
|
111
|
-
|
|
112
|
-
/** Create routing idle transaction. */
|
|
113
82
|
function _createRouteSpan(client, startSpanOptions, makeActive = true) {
|
|
114
|
-
const isPageloadSpan = startSpanOptions.op ===
|
|
115
|
-
|
|
83
|
+
const isPageloadSpan = startSpanOptions.op === "pageload";
|
|
116
84
|
const initialSpanName = startSpanOptions.name;
|
|
117
|
-
const finalStartSpanOptions = beforeStartSpan
|
|
118
|
-
? beforeStartSpan(startSpanOptions)
|
|
119
|
-
: startSpanOptions;
|
|
120
|
-
|
|
85
|
+
const finalStartSpanOptions = beforeStartSpan ? beforeStartSpan(startSpanOptions) : startSpanOptions;
|
|
121
86
|
const attributes = finalStartSpanOptions.attributes || {};
|
|
122
|
-
|
|
123
|
-
// If `finalStartSpanOptions.name` is different than `startSpanOptions.name`
|
|
124
|
-
// it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'.
|
|
125
87
|
if (initialSpanName !== finalStartSpanOptions.name) {
|
|
126
|
-
attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] =
|
|
88
|
+
attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = "custom";
|
|
127
89
|
finalStartSpanOptions.attributes = attributes;
|
|
128
90
|
}
|
|
129
|
-
|
|
130
91
|
if (!makeActive) {
|
|
131
|
-
// We want to ensure this has 0s duration
|
|
132
92
|
const now = dateTimestampInSeconds();
|
|
133
93
|
startInactiveSpan({
|
|
134
94
|
...finalStartSpanOptions,
|
|
135
|
-
startTime: now
|
|
95
|
+
startTime: now
|
|
136
96
|
}).end(now);
|
|
137
97
|
return;
|
|
138
98
|
}
|
|
139
|
-
|
|
140
99
|
latestRoute.name = finalStartSpanOptions.name;
|
|
141
100
|
latestRoute.source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
|
|
142
|
-
|
|
143
101
|
const idleSpan = startIdleSpan(finalStartSpanOptions, {
|
|
144
102
|
idleTimeout,
|
|
145
103
|
finalTimeout,
|
|
146
104
|
childSpanTimeout,
|
|
147
105
|
// should wait for finish signal if it's a pageload transaction
|
|
148
106
|
disableAutoFinish: isPageloadSpan,
|
|
149
|
-
beforeSpanEnd: span => {
|
|
150
|
-
// This will generally always be defined here, because it is set in `setup()` of the integration
|
|
151
|
-
// but technically, it is optional, so we guard here to be extra safe
|
|
107
|
+
beforeSpanEnd: (span) => {
|
|
152
108
|
_collectWebVitals?.();
|
|
153
109
|
const spanStreamingEnabled = hasSpanStreamingEnabled(client);
|
|
154
110
|
addPerformanceEntries(span, {
|
|
@@ -156,71 +112,53 @@ const browserTracingIntegration = ((options = {}) => {
|
|
|
156
112
|
recordLcpOnPageloadSpan: !spanStreamingEnabled && !enableStandaloneLcpSpans,
|
|
157
113
|
ignoreResourceSpans,
|
|
158
114
|
ignorePerformanceApiSpans,
|
|
159
|
-
spanStreamingEnabled
|
|
115
|
+
spanStreamingEnabled
|
|
160
116
|
});
|
|
161
|
-
setActiveIdleSpan(client,
|
|
162
|
-
|
|
163
|
-
// A trace should stay consistent over the entire timespan of one route - even after the pageload/navigation ended.
|
|
164
|
-
// Only when another navigation happens, we want to create a new trace.
|
|
165
|
-
// This way, e.g. errors that occur after the pageload span ended are still associated to the pageload trace.
|
|
117
|
+
setActiveIdleSpan(client, void 0);
|
|
166
118
|
const scope = getCurrentScope();
|
|
167
119
|
const oldPropagationContext = scope.getPropagationContext();
|
|
168
|
-
|
|
169
120
|
scope.setPropagationContext({
|
|
170
121
|
...oldPropagationContext,
|
|
171
122
|
traceId: idleSpan.spanContext().traceId,
|
|
172
123
|
sampled: spanIsSampled(idleSpan),
|
|
173
|
-
dsc: getDynamicSamplingContextFromSpan(span)
|
|
124
|
+
dsc: getDynamicSamplingContextFromSpan(span)
|
|
174
125
|
});
|
|
175
|
-
|
|
176
126
|
if (isPageloadSpan) {
|
|
177
|
-
|
|
178
|
-
_pageloadSpan = undefined;
|
|
127
|
+
_pageloadSpan = void 0;
|
|
179
128
|
}
|
|
180
129
|
},
|
|
181
|
-
trimIdleSpanEndTimestamp: !enableReportPageLoaded
|
|
130
|
+
trimIdleSpanEndTimestamp: !enableReportPageLoaded
|
|
182
131
|
});
|
|
183
|
-
|
|
184
132
|
if (isPageloadSpan && enableReportPageLoaded) {
|
|
185
133
|
_pageloadSpan = idleSpan;
|
|
186
134
|
}
|
|
187
|
-
|
|
188
135
|
setActiveIdleSpan(client, idleSpan);
|
|
189
|
-
|
|
190
136
|
function emitFinish() {
|
|
191
|
-
if (optionalWindowDocument && [
|
|
192
|
-
client.emit(
|
|
137
|
+
if (optionalWindowDocument && ["interactive", "complete"].includes(optionalWindowDocument.readyState)) {
|
|
138
|
+
client.emit("idleSpanEnableAutoFinish", idleSpan);
|
|
193
139
|
}
|
|
194
140
|
}
|
|
195
|
-
|
|
196
|
-
// Enable auto finish of the pageload span if users are not explicitly ending it
|
|
197
141
|
if (isPageloadSpan && !enableReportPageLoaded && optionalWindowDocument) {
|
|
198
|
-
optionalWindowDocument.addEventListener(
|
|
142
|
+
optionalWindowDocument.addEventListener("readystatechange", () => {
|
|
199
143
|
emitFinish();
|
|
200
144
|
});
|
|
201
|
-
|
|
202
145
|
emitFinish();
|
|
203
146
|
}
|
|
204
147
|
}
|
|
205
|
-
|
|
206
148
|
return {
|
|
207
149
|
name: BROWSER_TRACING_INTEGRATION_ID,
|
|
208
150
|
setup(client) {
|
|
209
151
|
if (_isBot) {
|
|
210
|
-
DEBUG_BUILD && debug.log(
|
|
152
|
+
DEBUG_BUILD && debug.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");
|
|
211
153
|
return;
|
|
212
154
|
}
|
|
213
|
-
|
|
214
155
|
registerSpanErrorInstrumentation();
|
|
215
|
-
|
|
216
156
|
const spanStreamingEnabled = hasSpanStreamingEnabled(client);
|
|
217
|
-
|
|
218
157
|
_collectWebVitals = startTrackingWebVitals({
|
|
219
|
-
recordClsStandaloneSpans: spanStreamingEnabled ?
|
|
220
|
-
recordLcpStandaloneSpans: spanStreamingEnabled ?
|
|
221
|
-
client
|
|
158
|
+
recordClsStandaloneSpans: spanStreamingEnabled ? void 0 : enableStandaloneClsSpans || false,
|
|
159
|
+
recordLcpStandaloneSpans: spanStreamingEnabled ? void 0 : enableStandaloneLcpSpans || false,
|
|
160
|
+
client
|
|
222
161
|
});
|
|
223
|
-
|
|
224
162
|
if (spanStreamingEnabled) {
|
|
225
163
|
trackLcpAsSpan(client);
|
|
226
164
|
trackClsAsSpan(client);
|
|
@@ -230,387 +168,260 @@ const browserTracingIntegration = ((options = {}) => {
|
|
|
230
168
|
} else if (enableInp) {
|
|
231
169
|
startTrackingINP();
|
|
232
170
|
}
|
|
233
|
-
|
|
234
|
-
if (
|
|
235
|
-
enableLongAnimationFrame &&
|
|
236
|
-
GLOBAL_OBJ.PerformanceObserver &&
|
|
237
|
-
PerformanceObserver.supportedEntryTypes?.includes('long-animation-frame')
|
|
238
|
-
) {
|
|
171
|
+
if (enableLongAnimationFrame && GLOBAL_OBJ.PerformanceObserver && PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")) {
|
|
239
172
|
startTrackingLongAnimationFrames();
|
|
240
173
|
} else if (enableLongTask) {
|
|
241
174
|
startTrackingLongTasks();
|
|
242
175
|
}
|
|
243
|
-
|
|
244
176
|
if (enableInteractions) {
|
|
245
177
|
startTrackingInteractions();
|
|
246
178
|
}
|
|
247
|
-
|
|
248
179
|
if (detectRedirects && optionalWindowDocument) {
|
|
249
180
|
const interactionHandler = () => {
|
|
250
181
|
lastInteractionTimestamp = timestampInSeconds();
|
|
251
182
|
};
|
|
252
|
-
addEventListener(
|
|
253
|
-
addEventListener(
|
|
183
|
+
addEventListener("click", interactionHandler, { capture: true });
|
|
184
|
+
addEventListener("keydown", interactionHandler, { capture: true, passive: true });
|
|
254
185
|
}
|
|
255
|
-
|
|
256
186
|
function maybeEndActiveSpan() {
|
|
257
187
|
const activeSpan = getActiveIdleSpan(client);
|
|
258
|
-
|
|
259
188
|
if (activeSpan && !spanToJSON(activeSpan).timestamp) {
|
|
260
189
|
DEBUG_BUILD && debug.log(`[Tracing] Finishing current active span with op: ${spanToJSON(activeSpan).op}`);
|
|
261
|
-
|
|
262
|
-
activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'cancelled');
|
|
190
|
+
activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "cancelled");
|
|
263
191
|
activeSpan.end();
|
|
264
192
|
}
|
|
265
193
|
}
|
|
266
|
-
|
|
267
|
-
client.on('startNavigationSpan', (startSpanOptions, navigationOptions) => {
|
|
194
|
+
client.on("startNavigationSpan", (startSpanOptions, navigationOptions) => {
|
|
268
195
|
if (getClient() !== client) {
|
|
269
196
|
return;
|
|
270
197
|
}
|
|
271
|
-
|
|
272
198
|
if (navigationOptions?.isRedirect) {
|
|
273
|
-
DEBUG_BUILD &&
|
|
274
|
-
debug.warn('[Tracing] Detected redirect, navigation span will not be the root span, but a child span.');
|
|
199
|
+
DEBUG_BUILD && debug.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span.");
|
|
275
200
|
_createRouteSpan(
|
|
276
201
|
client,
|
|
277
202
|
{
|
|
278
|
-
op:
|
|
279
|
-
...startSpanOptions
|
|
203
|
+
op: "navigation.redirect",
|
|
204
|
+
...startSpanOptions
|
|
280
205
|
},
|
|
281
|
-
false
|
|
206
|
+
false
|
|
282
207
|
);
|
|
283
208
|
return;
|
|
284
209
|
}
|
|
285
|
-
|
|
286
|
-
// Reset the last interaction timestamp since we now start a new navigation.
|
|
287
|
-
// Any subsequent navigation span starts could again be a redirect, so we
|
|
288
|
-
// should reset our heuristic detectors.
|
|
289
|
-
lastInteractionTimestamp = undefined;
|
|
290
|
-
|
|
210
|
+
lastInteractionTimestamp = void 0;
|
|
291
211
|
maybeEndActiveSpan();
|
|
292
|
-
|
|
293
212
|
getIsolationScope().setPropagationContext({
|
|
294
213
|
traceId: generateTraceId(),
|
|
295
214
|
sampleRand: Math.random(),
|
|
296
|
-
propagationSpanId: hasSpansEnabled() ?
|
|
215
|
+
propagationSpanId: hasSpansEnabled() ? void 0 : generateSpanId()
|
|
297
216
|
});
|
|
298
|
-
|
|
299
217
|
const scope = getCurrentScope();
|
|
300
218
|
scope.setPropagationContext({
|
|
301
219
|
traceId: generateTraceId(),
|
|
302
220
|
sampleRand: Math.random(),
|
|
303
|
-
propagationSpanId: hasSpansEnabled() ?
|
|
221
|
+
propagationSpanId: hasSpansEnabled() ? void 0 : generateSpanId()
|
|
304
222
|
});
|
|
305
|
-
|
|
306
|
-
// We reset this to ensure we do not have lingering incorrect data here
|
|
307
|
-
// places that call this hook may set this where appropriate - else, the URL at span sending time is used
|
|
308
223
|
scope.setSDKProcessingMetadata({
|
|
309
|
-
normalizedRequest:
|
|
224
|
+
normalizedRequest: void 0
|
|
310
225
|
});
|
|
311
|
-
|
|
312
226
|
_createRouteSpan(client, {
|
|
313
|
-
op:
|
|
227
|
+
op: "navigation",
|
|
314
228
|
...startSpanOptions,
|
|
315
229
|
// Navigation starts a new trace and is NOT parented under any active interaction (e.g. ui.action.click)
|
|
316
230
|
parentSpan: null,
|
|
317
|
-
forceTransaction: true
|
|
231
|
+
forceTransaction: true
|
|
318
232
|
});
|
|
319
233
|
});
|
|
320
|
-
|
|
321
|
-
client.on('startPageLoadSpan', (startSpanOptions, traceOptions = {}) => {
|
|
234
|
+
client.on("startPageLoadSpan", (startSpanOptions, traceOptions = {}) => {
|
|
322
235
|
if (getClient() !== client) {
|
|
323
236
|
return;
|
|
324
237
|
}
|
|
325
238
|
maybeEndActiveSpan();
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
traceOptions.sentryTrace || getMetaContent('sentry-trace') || getServerTiming('sentry-trace');
|
|
329
|
-
const baggage = traceOptions.baggage || getMetaContent('baggage') || getServerTiming('baggage');
|
|
330
|
-
|
|
239
|
+
const sentryTrace = traceOptions.sentryTrace || getMetaContent("sentry-trace") || getServerTiming("sentry-trace");
|
|
240
|
+
const baggage = traceOptions.baggage || getMetaContent("baggage") || getServerTiming("baggage");
|
|
331
241
|
const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);
|
|
332
|
-
|
|
333
242
|
const scope = getCurrentScope();
|
|
334
243
|
scope.setPropagationContext(propagationContext);
|
|
335
244
|
if (!hasSpansEnabled()) {
|
|
336
|
-
// for browser, we wanna keep the spanIds consistent during the entire lifetime of the trace
|
|
337
|
-
// this works by setting the propagationSpanId to a random spanId so that we have a consistent
|
|
338
|
-
// span id to propagate in TwP mode (!hasSpansEnabled())
|
|
339
245
|
scope.getPropagationContext().propagationSpanId = generateSpanId();
|
|
340
246
|
}
|
|
341
|
-
|
|
342
|
-
// We store the normalized request data on the scope, so we get the request data at time of span creation
|
|
343
|
-
// otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL
|
|
344
247
|
scope.setSDKProcessingMetadata({
|
|
345
|
-
normalizedRequest: getHttpRequestData()
|
|
248
|
+
normalizedRequest: getHttpRequestData()
|
|
346
249
|
});
|
|
347
|
-
|
|
348
250
|
_createRouteSpan(client, {
|
|
349
|
-
op:
|
|
350
|
-
...startSpanOptions
|
|
251
|
+
op: "pageload",
|
|
252
|
+
...startSpanOptions
|
|
351
253
|
});
|
|
352
254
|
});
|
|
353
|
-
|
|
354
|
-
client.on('endPageloadSpan', () => {
|
|
255
|
+
client.on("endPageloadSpan", () => {
|
|
355
256
|
if (enableReportPageLoaded && _pageloadSpan) {
|
|
356
|
-
_pageloadSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,
|
|
257
|
+
_pageloadSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "reportPageLoaded");
|
|
357
258
|
_pageloadSpan.end();
|
|
358
259
|
}
|
|
359
260
|
});
|
|
360
261
|
},
|
|
361
|
-
|
|
362
262
|
afterAllSetup(client) {
|
|
363
263
|
if (_isBot) {
|
|
364
264
|
return;
|
|
365
265
|
}
|
|
366
|
-
|
|
367
266
|
let startingUrl = getLocationHref();
|
|
368
|
-
|
|
369
|
-
if (linkPreviousTrace !== 'off') {
|
|
267
|
+
if (linkPreviousTrace !== "off") {
|
|
370
268
|
linkTraces(client, { linkPreviousTrace, consistentTraceSampling });
|
|
371
269
|
}
|
|
372
|
-
|
|
373
270
|
if (WINDOW.location) {
|
|
374
271
|
if (instrumentPageLoad) {
|
|
375
272
|
const origin = browserPerformanceTimeOrigin();
|
|
376
273
|
startBrowserTracingPageLoadSpan(client, {
|
|
377
274
|
name: WINDOW.location.pathname,
|
|
378
275
|
// pageload should always start at timeOrigin (and needs to be in s, not ms)
|
|
379
|
-
startTime: origin ? origin /
|
|
276
|
+
startTime: origin ? origin / 1e3 : void 0,
|
|
380
277
|
attributes: {
|
|
381
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:
|
|
382
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:
|
|
383
|
-
}
|
|
278
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
|
|
279
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.pageload.browser"
|
|
280
|
+
}
|
|
384
281
|
});
|
|
385
282
|
}
|
|
386
|
-
|
|
387
283
|
if (instrumentNavigation) {
|
|
388
284
|
addHistoryInstrumentationHandler(({ to, from }) => {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
* long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't
|
|
392
|
-
* create an uneccessary navigation transaction.
|
|
393
|
-
*
|
|
394
|
-
* This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also
|
|
395
|
-
* only be caused in certain development environments where the usage of a hot module reloader is causing
|
|
396
|
-
* errors.
|
|
397
|
-
*/
|
|
398
|
-
if (from === undefined && startingUrl?.indexOf(to) !== -1) {
|
|
399
|
-
startingUrl = undefined;
|
|
285
|
+
if (from === void 0 && startingUrl?.indexOf(to) !== -1) {
|
|
286
|
+
startingUrl = void 0;
|
|
400
287
|
return;
|
|
401
288
|
}
|
|
402
|
-
|
|
403
|
-
startingUrl = undefined;
|
|
289
|
+
startingUrl = void 0;
|
|
404
290
|
const parsed = parseStringToURLObject(to);
|
|
405
291
|
const activeSpan = getActiveIdleSpan(client);
|
|
406
|
-
const navigationIsRedirect =
|
|
407
|
-
activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);
|
|
408
|
-
|
|
292
|
+
const navigationIsRedirect = activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);
|
|
409
293
|
startBrowserTracingNavigationSpan(
|
|
410
294
|
client,
|
|
411
295
|
{
|
|
412
296
|
name: parsed?.pathname || WINDOW.location.pathname,
|
|
413
297
|
attributes: {
|
|
414
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]:
|
|
415
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:
|
|
416
|
-
}
|
|
298
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
|
|
299
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.navigation.browser"
|
|
300
|
+
}
|
|
417
301
|
},
|
|
418
|
-
{ url: to, isRedirect: navigationIsRedirect }
|
|
302
|
+
{ url: to, isRedirect: navigationIsRedirect }
|
|
419
303
|
);
|
|
420
304
|
});
|
|
421
305
|
}
|
|
422
306
|
}
|
|
423
|
-
|
|
424
307
|
if (markBackgroundSpan) {
|
|
425
308
|
registerBackgroundTabDetection();
|
|
426
309
|
}
|
|
427
|
-
|
|
428
310
|
if (enableInteractions) {
|
|
429
311
|
registerInteractionListener(client, idleTimeout, finalTimeout, childSpanTimeout, latestRoute);
|
|
430
312
|
}
|
|
431
|
-
|
|
432
313
|
if (enableInp) {
|
|
433
314
|
registerInpInteractionListener();
|
|
434
315
|
}
|
|
435
|
-
|
|
436
316
|
instrumentOutgoingRequests(client, {
|
|
437
317
|
traceFetch,
|
|
438
318
|
traceXHR,
|
|
439
|
-
trackFetchStreamPerformance,
|
|
440
319
|
tracePropagationTargets: client.getOptions().tracePropagationTargets,
|
|
441
320
|
shouldCreateSpanForRequest,
|
|
442
321
|
enableHTTPTimings,
|
|
443
322
|
onRequestSpanStart,
|
|
444
|
-
onRequestSpanEnd
|
|
323
|
+
onRequestSpanEnd
|
|
445
324
|
});
|
|
446
|
-
|
|
325
|
+
if (trackFetchStreamPerformance) {
|
|
326
|
+
client.addIntegration(fetchStreamPerformanceIntegration());
|
|
327
|
+
}
|
|
328
|
+
}
|
|
447
329
|
};
|
|
448
|
-
})
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
* Manually start a page load span.
|
|
452
|
-
* This will only do something if a browser tracing integration integration has been setup.
|
|
453
|
-
*
|
|
454
|
-
* If you provide a custom `traceOptions` object, it will be used to continue the trace
|
|
455
|
-
* instead of the default behavior, which is to look it up on the <meta> tags.
|
|
456
|
-
*/
|
|
457
|
-
function startBrowserTracingPageLoadSpan(
|
|
458
|
-
client,
|
|
459
|
-
spanOptions,
|
|
460
|
-
traceOptions,
|
|
461
|
-
) {
|
|
462
|
-
client.emit('startPageLoadSpan', spanOptions, traceOptions);
|
|
330
|
+
});
|
|
331
|
+
function startBrowserTracingPageLoadSpan(client, spanOptions, traceOptions) {
|
|
332
|
+
client.emit("startPageLoadSpan", spanOptions, traceOptions);
|
|
463
333
|
getCurrentScope().setTransactionName(spanOptions.name);
|
|
464
|
-
|
|
465
334
|
const pageloadSpan = getActiveIdleSpan(client);
|
|
466
|
-
|
|
467
335
|
if (pageloadSpan) {
|
|
468
|
-
client.emit(
|
|
336
|
+
client.emit("afterStartPageLoadSpan", pageloadSpan);
|
|
469
337
|
}
|
|
470
|
-
|
|
471
338
|
return pageloadSpan;
|
|
472
339
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
*/
|
|
478
|
-
function startBrowserTracingNavigationSpan(
|
|
479
|
-
client,
|
|
480
|
-
spanOptions,
|
|
481
|
-
options,
|
|
482
|
-
) {
|
|
483
|
-
const { url, isRedirect } = options || {};
|
|
484
|
-
client.emit('beforeStartNavigationSpan', spanOptions, { isRedirect });
|
|
485
|
-
client.emit('startNavigationSpan', spanOptions, { isRedirect });
|
|
486
|
-
|
|
340
|
+
function startBrowserTracingNavigationSpan(client, spanOptions, options) {
|
|
341
|
+
const { url, isRedirect: isRedirect2 } = options || {};
|
|
342
|
+
client.emit("beforeStartNavigationSpan", spanOptions, { isRedirect: isRedirect2 });
|
|
343
|
+
client.emit("startNavigationSpan", spanOptions, { isRedirect: isRedirect2 });
|
|
487
344
|
const scope = getCurrentScope();
|
|
488
345
|
scope.setTransactionName(spanOptions.name);
|
|
489
|
-
|
|
490
|
-
// We store the normalized request data on the scope, so we get the request data at time of span creation
|
|
491
|
-
// otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL
|
|
492
|
-
if (url && !isRedirect) {
|
|
346
|
+
if (url && !isRedirect2) {
|
|
493
347
|
scope.setSDKProcessingMetadata({
|
|
494
348
|
normalizedRequest: {
|
|
495
349
|
...getHttpRequestData(),
|
|
496
|
-
url
|
|
497
|
-
}
|
|
350
|
+
url
|
|
351
|
+
}
|
|
498
352
|
});
|
|
499
353
|
}
|
|
500
|
-
|
|
501
354
|
return getActiveIdleSpan(client);
|
|
502
355
|
}
|
|
503
|
-
|
|
504
|
-
/** Returns the value of a meta tag */
|
|
505
356
|
function getMetaContent(metaName) {
|
|
506
|
-
|
|
507
|
-
* This is just a small wrapper that makes `document` optional.
|
|
508
|
-
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
|
|
509
|
-
*/
|
|
510
|
-
const optionalWindowDocument = WINDOW.document ;
|
|
511
|
-
|
|
357
|
+
const optionalWindowDocument = WINDOW.document;
|
|
512
358
|
const metaTag = optionalWindowDocument?.querySelector(`meta[name=${metaName}]`);
|
|
513
|
-
return metaTag?.getAttribute(
|
|
359
|
+
return metaTag?.getAttribute("content") || void 0;
|
|
514
360
|
}
|
|
515
|
-
|
|
516
|
-
/** Returns the description of a server timing entry */
|
|
517
361
|
function getServerTiming(name) {
|
|
518
|
-
const navigation = WINDOW.performance?.getEntriesByType?.(
|
|
519
|
-
const entry = navigation?.serverTiming?.find(
|
|
362
|
+
const navigation = WINDOW.performance?.getEntriesByType?.("navigation")[0];
|
|
363
|
+
const entry = navigation?.serverTiming?.find((entry2) => entry2.name === name);
|
|
520
364
|
return entry?.description;
|
|
521
365
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
function registerInteractionListener(
|
|
525
|
-
client,
|
|
526
|
-
idleTimeout,
|
|
527
|
-
finalTimeout,
|
|
528
|
-
childSpanTimeout,
|
|
529
|
-
latestRoute,
|
|
530
|
-
) {
|
|
531
|
-
/**
|
|
532
|
-
* This is just a small wrapper that makes `document` optional.
|
|
533
|
-
* We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
|
|
534
|
-
*/
|
|
535
|
-
const optionalWindowDocument = WINDOW.document ;
|
|
536
|
-
|
|
366
|
+
function registerInteractionListener(client, idleTimeout, finalTimeout, childSpanTimeout, latestRoute) {
|
|
367
|
+
const optionalWindowDocument = WINDOW.document;
|
|
537
368
|
let inflightInteractionSpan;
|
|
538
369
|
const registerInteractionTransaction = () => {
|
|
539
|
-
const op =
|
|
540
|
-
|
|
370
|
+
const op = "ui.action.click";
|
|
541
371
|
const activeIdleSpan = getActiveIdleSpan(client);
|
|
542
372
|
if (activeIdleSpan) {
|
|
543
373
|
const currentRootSpanOp = spanToJSON(activeIdleSpan).op;
|
|
544
|
-
if ([
|
|
545
|
-
DEBUG_BUILD &&
|
|
546
|
-
|
|
547
|
-
return undefined;
|
|
374
|
+
if (["navigation", "pageload"].includes(currentRootSpanOp)) {
|
|
375
|
+
DEBUG_BUILD && debug.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`);
|
|
376
|
+
return void 0;
|
|
548
377
|
}
|
|
549
378
|
}
|
|
550
|
-
|
|
551
379
|
if (inflightInteractionSpan) {
|
|
552
|
-
inflightInteractionSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON,
|
|
380
|
+
inflightInteractionSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "interactionInterrupted");
|
|
553
381
|
inflightInteractionSpan.end();
|
|
554
|
-
inflightInteractionSpan =
|
|
382
|
+
inflightInteractionSpan = void 0;
|
|
555
383
|
}
|
|
556
|
-
|
|
557
384
|
if (!latestRoute.name) {
|
|
558
385
|
DEBUG_BUILD && debug.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);
|
|
559
|
-
return
|
|
386
|
+
return void 0;
|
|
560
387
|
}
|
|
561
|
-
|
|
562
388
|
inflightInteractionSpan = startIdleSpan(
|
|
563
389
|
{
|
|
564
390
|
name: latestRoute.name,
|
|
565
391
|
op,
|
|
566
392
|
attributes: {
|
|
567
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source ||
|
|
568
|
-
}
|
|
393
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || "url"
|
|
394
|
+
}
|
|
569
395
|
},
|
|
570
396
|
{
|
|
571
397
|
idleTimeout,
|
|
572
398
|
finalTimeout,
|
|
573
|
-
childSpanTimeout
|
|
574
|
-
}
|
|
399
|
+
childSpanTimeout
|
|
400
|
+
}
|
|
575
401
|
);
|
|
576
402
|
};
|
|
577
|
-
|
|
578
403
|
if (optionalWindowDocument) {
|
|
579
|
-
addEventListener(
|
|
404
|
+
addEventListener("click", registerInteractionTransaction, { capture: true });
|
|
580
405
|
}
|
|
581
406
|
}
|
|
582
|
-
|
|
583
|
-
// We store the active idle span on the client object, so we can access it from exported functions
|
|
584
|
-
const ACTIVE_IDLE_SPAN_PROPERTY = '_sentry_idleSpan';
|
|
407
|
+
const ACTIVE_IDLE_SPAN_PROPERTY = "_sentry_idleSpan";
|
|
585
408
|
function getActiveIdleSpan(client) {
|
|
586
|
-
return
|
|
409
|
+
return client[ACTIVE_IDLE_SPAN_PROPERTY];
|
|
587
410
|
}
|
|
588
|
-
|
|
589
411
|
function setActiveIdleSpan(client, span) {
|
|
590
412
|
addNonEnumerableProperty(client, ACTIVE_IDLE_SPAN_PROPERTY, span);
|
|
591
413
|
}
|
|
592
|
-
|
|
593
|
-
// The max. time in seconds between two pageload/navigation spans that makes us consider the second one a redirect
|
|
594
414
|
const REDIRECT_THRESHOLD = 1.5;
|
|
595
|
-
|
|
596
415
|
function isRedirect(activeSpan, lastInteractionTimestamp) {
|
|
597
416
|
const spanData = spanToJSON(activeSpan);
|
|
598
|
-
|
|
599
417
|
const now = dateTimestampInSeconds();
|
|
600
|
-
|
|
601
|
-
// More than REDIRECT_THRESHOLD seconds since last navigation/pageload span?
|
|
602
|
-
// --> never consider this a redirect
|
|
603
418
|
const startTimestamp = spanData.start_timestamp;
|
|
604
419
|
if (now - startTimestamp > REDIRECT_THRESHOLD) {
|
|
605
420
|
return false;
|
|
606
421
|
}
|
|
607
|
-
|
|
608
|
-
// A click happened in the last REDIRECT_THRESHOLD seconds?
|
|
609
|
-
// --> never consider this a redirect
|
|
610
422
|
if (lastInteractionTimestamp && now - lastInteractionTimestamp <= REDIRECT_THRESHOLD) {
|
|
611
423
|
return false;
|
|
612
424
|
}
|
|
613
|
-
|
|
614
425
|
return true;
|
|
615
426
|
}
|
|
616
427
|
|