@sentry/browser 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/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
|
@@ -1,82 +1,57 @@
|
|
|
1
1
|
import { defineIntegration, supportsReportingObserver, GLOBAL_OBJ, getClient, withScope, captureMessage } from '@sentry/core/browser';
|
|
2
2
|
|
|
3
|
-
const WINDOW = GLOBAL_OBJ
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const SETUP_CLIENTS = new WeakMap();
|
|
8
|
-
|
|
3
|
+
const WINDOW = GLOBAL_OBJ;
|
|
4
|
+
const INTEGRATION_NAME = "ReportingObserver";
|
|
5
|
+
const SETUP_CLIENTS = /* @__PURE__ */ new WeakMap();
|
|
9
6
|
const _reportingObserverIntegration = ((options = {}) => {
|
|
10
|
-
const types = options.types || [
|
|
11
|
-
|
|
12
|
-
/** Handler for the reporting observer. */
|
|
7
|
+
const types = options.types || ["crash", "deprecation", "intervention"];
|
|
13
8
|
function handler(reports) {
|
|
14
|
-
if (!SETUP_CLIENTS.has(getClient()
|
|
9
|
+
if (!SETUP_CLIENTS.has(getClient())) {
|
|
15
10
|
return;
|
|
16
11
|
}
|
|
17
|
-
|
|
18
12
|
for (const report of reports) {
|
|
19
|
-
withScope(scope => {
|
|
20
|
-
scope.setExtra(
|
|
21
|
-
|
|
13
|
+
withScope((scope) => {
|
|
14
|
+
scope.setExtra("url", report.url);
|
|
22
15
|
const label = `ReportingObserver [${report.type}]`;
|
|
23
|
-
let details =
|
|
24
|
-
|
|
16
|
+
let details = "No details available";
|
|
25
17
|
if (report.body) {
|
|
26
|
-
|
|
27
|
-
const plainBody
|
|
28
|
-
|
|
29
|
-
= {};
|
|
30
|
-
|
|
31
|
-
// eslint-disable-next-line guard-for-in
|
|
18
|
+
const plainBody = {};
|
|
32
19
|
for (const prop in report.body) {
|
|
33
20
|
plainBody[prop] = report.body[prop];
|
|
34
21
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const body = report.body ;
|
|
40
|
-
// A fancy way to create a message out of crashId OR reason OR both OR fallback
|
|
41
|
-
details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;
|
|
22
|
+
scope.setExtra("body", plainBody);
|
|
23
|
+
if (report.type === "crash") {
|
|
24
|
+
const body = report.body;
|
|
25
|
+
details = [body.crashId || "", body.reason || ""].join(" ").trim() || details;
|
|
42
26
|
} else {
|
|
43
|
-
const body = report.body
|
|
27
|
+
const body = report.body;
|
|
44
28
|
details = body.message || details;
|
|
45
29
|
}
|
|
46
30
|
}
|
|
47
|
-
|
|
48
31
|
captureMessage(`${label}: ${details}`);
|
|
49
32
|
});
|
|
50
33
|
}
|
|
51
34
|
}
|
|
52
|
-
|
|
53
35
|
return {
|
|
54
36
|
name: INTEGRATION_NAME,
|
|
55
37
|
setupOnce() {
|
|
56
38
|
if (!supportsReportingObserver()) {
|
|
57
39
|
return;
|
|
58
40
|
}
|
|
59
|
-
|
|
60
|
-
const observer = new (WINDOW ).ReportingObserver(
|
|
41
|
+
const observer = new WINDOW.ReportingObserver(
|
|
61
42
|
handler,
|
|
62
43
|
{
|
|
63
44
|
buffered: true,
|
|
64
|
-
types
|
|
65
|
-
}
|
|
45
|
+
types
|
|
46
|
+
}
|
|
66
47
|
);
|
|
67
|
-
|
|
68
48
|
observer.observe();
|
|
69
49
|
},
|
|
70
|
-
|
|
71
50
|
setup(client) {
|
|
72
51
|
SETUP_CLIENTS.set(client, true);
|
|
73
|
-
}
|
|
52
|
+
}
|
|
74
53
|
};
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Reporting API integration - https://w3c.github.io/reporting/
|
|
79
|
-
*/
|
|
54
|
+
});
|
|
80
55
|
const reportingObserverIntegration = defineIntegration(_reportingObserverIntegration);
|
|
81
56
|
|
|
82
57
|
export { reportingObserverIntegration };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reportingobserver.js","sources":["../../../../../src/integrations/reportingobserver.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core/browser';\nimport {\n captureMessage,\n defineIntegration,\n getClient,\n GLOBAL_OBJ,\n supportsReportingObserver,\n withScope,\n} from '@sentry/core/browser';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst INTEGRATION_NAME = 'ReportingObserver';\n\ninterface Report {\n [key: string]: unknown;\n type: ReportTypes;\n url: string;\n body?: ReportBody;\n}\n\ntype ReportTypes = 'crash' | 'deprecation' | 'intervention';\n\ntype ReportBody = CrashReportBody | DeprecationReportBody | InterventionReportBody;\n\ninterface CrashReportBody {\n [key: string]: unknown;\n crashId: string;\n reason?: string;\n}\n\ninterface DeprecationReportBody {\n [key: string]: unknown;\n id: string;\n anticipatedRemoval?: Date;\n message: string;\n sourceFile?: string;\n lineNumber?: number;\n columnNumber?: number;\n}\n\ninterface InterventionReportBody {\n [key: string]: unknown;\n id: string;\n message: string;\n sourceFile?: string;\n lineNumber?: number;\n columnNumber?: number;\n}\n\ninterface ReportingObserverOptions {\n types?: ReportTypes[];\n}\n\n/** This is experimental and the types are not included with TypeScript, sadly. */\ninterface ReportingObserverClass {\n new (\n handler: (reports: Report[]) => void,\n options: { buffered?: boolean; types?: ReportTypes[] },\n ): {\n observe: () => void;\n };\n}\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _reportingObserverIntegration = ((options: ReportingObserverOptions = {}) => {\n const types = options.types || ['crash', 'deprecation', 'intervention'];\n\n /** Handler for the reporting observer. */\n function handler(reports: Report[]): void {\n if (!SETUP_CLIENTS.has(getClient() as Client)) {\n return;\n }\n\n for (const report of reports) {\n withScope(scope => {\n scope.setExtra('url', report.url);\n\n const label = `ReportingObserver [${report.type}]`;\n let details = 'No details available';\n\n if (report.body) {\n // Object.keys doesn't work on ReportBody, as all properties are inherited\n const plainBody: {\n [key: string]: unknown;\n } = {};\n\n // eslint-disable-next-line guard-for-in\n for (const prop in report.body) {\n plainBody[prop] = report.body[prop];\n }\n\n scope.setExtra('body', plainBody);\n\n if (report.type === 'crash') {\n const body = report.body as CrashReportBody;\n // A fancy way to create a message out of crashId OR reason OR both OR fallback\n details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;\n } else {\n const body = report.body as DeprecationReportBody | InterventionReportBody;\n details = body.message || details;\n }\n }\n\n captureMessage(`${label}: ${details}`);\n });\n }\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n if (!supportsReportingObserver()) {\n return;\n }\n\n const observer = new (WINDOW as typeof WINDOW & { ReportingObserver: ReportingObserverClass }).ReportingObserver(\n handler,\n {\n buffered: true,\n types,\n },\n );\n\n observer.observe();\n },\n\n setup(client): void {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Reporting API integration - https://w3c.github.io/reporting/\n */\nexport const reportingObserverIntegration = defineIntegration(_reportingObserverIntegration);\n"],"names":[],"mappings":";;AAUA,MAAM,MAAA,GAAS,UAAA
|
|
1
|
+
{"version":3,"file":"reportingobserver.js","sources":["../../../../../src/integrations/reportingobserver.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core/browser';\nimport {\n captureMessage,\n defineIntegration,\n getClient,\n GLOBAL_OBJ,\n supportsReportingObserver,\n withScope,\n} from '@sentry/core/browser';\n\nconst WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nconst INTEGRATION_NAME = 'ReportingObserver';\n\ninterface Report {\n [key: string]: unknown;\n type: ReportTypes;\n url: string;\n body?: ReportBody;\n}\n\ntype ReportTypes = 'crash' | 'deprecation' | 'intervention';\n\ntype ReportBody = CrashReportBody | DeprecationReportBody | InterventionReportBody;\n\ninterface CrashReportBody {\n [key: string]: unknown;\n crashId: string;\n reason?: string;\n}\n\ninterface DeprecationReportBody {\n [key: string]: unknown;\n id: string;\n anticipatedRemoval?: Date;\n message: string;\n sourceFile?: string;\n lineNumber?: number;\n columnNumber?: number;\n}\n\ninterface InterventionReportBody {\n [key: string]: unknown;\n id: string;\n message: string;\n sourceFile?: string;\n lineNumber?: number;\n columnNumber?: number;\n}\n\ninterface ReportingObserverOptions {\n types?: ReportTypes[];\n}\n\n/** This is experimental and the types are not included with TypeScript, sadly. */\ninterface ReportingObserverClass {\n new (\n handler: (reports: Report[]) => void,\n options: { buffered?: boolean; types?: ReportTypes[] },\n ): {\n observe: () => void;\n };\n}\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _reportingObserverIntegration = ((options: ReportingObserverOptions = {}) => {\n const types = options.types || ['crash', 'deprecation', 'intervention'];\n\n /** Handler for the reporting observer. */\n function handler(reports: Report[]): void {\n if (!SETUP_CLIENTS.has(getClient() as Client)) {\n return;\n }\n\n for (const report of reports) {\n withScope(scope => {\n scope.setExtra('url', report.url);\n\n const label = `ReportingObserver [${report.type}]`;\n let details = 'No details available';\n\n if (report.body) {\n // Object.keys doesn't work on ReportBody, as all properties are inherited\n const plainBody: {\n [key: string]: unknown;\n } = {};\n\n // eslint-disable-next-line guard-for-in\n for (const prop in report.body) {\n plainBody[prop] = report.body[prop];\n }\n\n scope.setExtra('body', plainBody);\n\n if (report.type === 'crash') {\n const body = report.body as CrashReportBody;\n // A fancy way to create a message out of crashId OR reason OR both OR fallback\n details = [body.crashId || '', body.reason || ''].join(' ').trim() || details;\n } else {\n const body = report.body as DeprecationReportBody | InterventionReportBody;\n details = body.message || details;\n }\n }\n\n captureMessage(`${label}: ${details}`);\n });\n }\n }\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n if (!supportsReportingObserver()) {\n return;\n }\n\n const observer = new (WINDOW as typeof WINDOW & { ReportingObserver: ReportingObserverClass }).ReportingObserver(\n handler,\n {\n buffered: true,\n types,\n },\n );\n\n observer.observe();\n },\n\n setup(client): void {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Reporting API integration - https://w3c.github.io/reporting/\n */\nexport const reportingObserverIntegration = defineIntegration(_reportingObserverIntegration);\n"],"names":[],"mappings":";;AAUA,MAAM,MAAA,GAAS,UAAA;AAEf,MAAM,gBAAA,GAAmB,mBAAA;AAoDzB,MAAM,aAAA,uBAAoB,OAAA,EAAyB;AAEnD,MAAM,6BAAA,IAAiC,CAAC,OAAA,GAAoC,EAAC,KAAM;AACjF,EAAA,MAAM,QAAQ,OAAA,CAAQ,KAAA,IAAS,CAAC,OAAA,EAAS,eAAe,cAAc,CAAA;AAGtE,EAAA,SAAS,QAAQ,OAAA,EAAyB;AACxC,IAAA,IAAI,CAAC,aAAA,CAAc,GAAA,CAAI,SAAA,EAAqB,CAAA,EAAG;AAC7C,MAAA;AAAA,IACF;AAEA,IAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,MAAA,SAAA,CAAU,CAAA,KAAA,KAAS;AACjB,QAAA,KAAA,CAAM,QAAA,CAAS,KAAA,EAAO,MAAA,CAAO,GAAG,CAAA;AAEhC,QAAA,MAAM,KAAA,GAAQ,CAAA,mBAAA,EAAsB,MAAA,CAAO,IAAI,CAAA,CAAA,CAAA;AAC/C,QAAA,IAAI,OAAA,GAAU,sBAAA;AAEd,QAAA,IAAI,OAAO,IAAA,EAAM;AAEf,UAAA,MAAM,YAEF,EAAC;AAGL,UAAA,KAAA,MAAW,IAAA,IAAQ,OAAO,IAAA,EAAM;AAC9B,YAAA,SAAA,CAAU,IAAI,CAAA,GAAI,MAAA,CAAO,IAAA,CAAK,IAAI,CAAA;AAAA,UACpC;AAEA,UAAA,KAAA,CAAM,QAAA,CAAS,QAAQ,SAAS,CAAA;AAEhC,UAAA,IAAI,MAAA,CAAO,SAAS,OAAA,EAAS;AAC3B,YAAA,MAAM,OAAO,MAAA,CAAO,IAAA;AAEpB,YAAA,OAAA,GAAU,CAAC,IAAA,CAAK,OAAA,IAAW,EAAA,EAAI,IAAA,CAAK,MAAA,IAAU,EAAE,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,CAAE,IAAA,EAAK,IAAK,OAAA;AAAA,UACxE,CAAA,MAAO;AACL,YAAA,MAAM,OAAO,MAAA,CAAO,IAAA;AACpB,YAAA,OAAA,GAAU,KAAK,OAAA,IAAW,OAAA;AAAA,UAC5B;AAAA,QACF;AAEA,QAAA,cAAA,CAAe,CAAA,EAAG,KAAK,CAAA,EAAA,EAAK,OAAO,CAAA,CAAE,CAAA;AAAA,MACvC,CAAC,CAAA;AAAA,IACH;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,IAAI,CAAC,2BAA0B,EAAG;AAChC,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,QAAA,GAAW,IAAK,MAAA,CAAyE,iBAAA;AAAA,QAC7F,OAAA;AAAA,QACA;AAAA,UACE,QAAA,EAAU,IAAA;AAAA,UACV;AAAA;AACF,OACF;AAEA,MAAA,QAAA,CAAS,OAAA,EAAQ;AAAA,IACnB,CAAA;AAAA,IAEA,MAAM,MAAA,EAAc;AAClB,MAAA,aAAA,CAAc,GAAA,CAAI,QAAQ,IAAI,CAAA;AAAA,IAChC;AAAA,GACF;AACF,CAAA,CAAA;AAKO,MAAM,4BAAA,GAA+B,kBAAkB,6BAA6B;;;;"}
|
|
@@ -3,63 +3,45 @@ import { DEBUG_BUILD } from '../debug-build.js';
|
|
|
3
3
|
|
|
4
4
|
const spanStreamingIntegration = defineIntegration(() => {
|
|
5
5
|
return {
|
|
6
|
-
name:
|
|
7
|
-
|
|
6
|
+
name: "SpanStreaming",
|
|
8
7
|
beforeSetup(client) {
|
|
9
|
-
// If users only set spanStreamingIntegration, without traceLifecycle, we set it to "stream" for them.
|
|
10
|
-
// This avoids the classic double-opt-in problem we'd otherwise have in the browser SDK.
|
|
11
8
|
const clientOptions = client.getOptions();
|
|
12
9
|
if (!clientOptions.traceLifecycle) {
|
|
13
10
|
DEBUG_BUILD && debug.log('[SpanStreaming] setting `traceLifecycle` to "stream"');
|
|
14
|
-
clientOptions.traceLifecycle =
|
|
11
|
+
clientOptions.traceLifecycle = "stream";
|
|
15
12
|
}
|
|
16
13
|
},
|
|
17
|
-
|
|
18
14
|
setup(client) {
|
|
19
|
-
const initialMessage =
|
|
20
|
-
const fallbackMsg =
|
|
15
|
+
const initialMessage = "SpanStreaming integration requires";
|
|
16
|
+
const fallbackMsg = "Falling back to static trace lifecycle.";
|
|
21
17
|
const clientOptions = client.getOptions();
|
|
22
|
-
|
|
23
18
|
if (!hasSpanStreamingEnabled(client)) {
|
|
24
|
-
clientOptions.traceLifecycle =
|
|
19
|
+
clientOptions.traceLifecycle = "static";
|
|
25
20
|
DEBUG_BUILD && debug.warn(`${initialMessage} \`traceLifecycle\` to be set to "stream"! ${fallbackMsg}`);
|
|
26
21
|
return;
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
const beforeSendSpan = clientOptions.beforeSendSpan;
|
|
30
|
-
// If users misconfigure their SDK by opting into span streaming but
|
|
31
|
-
// using an incompatible beforeSendSpan callback, we fall back to the static trace lifecycle.
|
|
32
24
|
if (beforeSendSpan && !isStreamedBeforeSendSpanCallback(beforeSendSpan)) {
|
|
33
|
-
clientOptions.traceLifecycle =
|
|
34
|
-
DEBUG_BUILD &&
|
|
35
|
-
debug.warn(`${initialMessage} a beforeSendSpan callback using \`withStreamedSpan\`! ${fallbackMsg}`);
|
|
25
|
+
clientOptions.traceLifecycle = "static";
|
|
26
|
+
DEBUG_BUILD && debug.warn(`${initialMessage} a beforeSendSpan callback using \`withStreamedSpan\`! ${fallbackMsg}`);
|
|
36
27
|
return;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
29
|
const buffer = new SpanBuffer(client);
|
|
40
|
-
|
|
41
|
-
client.on('afterSpanEnd', span => {
|
|
42
|
-
// Negatively sampled spans must not be captured.
|
|
43
|
-
// This happens because OTel and we create non-recording spans for negatively sampled spans
|
|
44
|
-
// that go through the same life cycle as recording spans.
|
|
30
|
+
client.on("afterSpanEnd", (span) => {
|
|
45
31
|
if (!spanIsSampled(span)) {
|
|
46
32
|
return;
|
|
47
33
|
}
|
|
48
34
|
buffer.add(captureSpan(span, client));
|
|
49
35
|
});
|
|
50
|
-
|
|
51
|
-
// In addition to capturing the span, we also flush the trace when the segment
|
|
52
|
-
// span ends to ensure things are sent timely. We never know when the browser
|
|
53
|
-
// is closed, users navigate away, etc.
|
|
54
|
-
client.on('afterSegmentSpanEnd', segmentSpan => {
|
|
36
|
+
client.on("afterSegmentSpanEnd", (segmentSpan) => {
|
|
55
37
|
const traceId = segmentSpan.spanContext().traceId;
|
|
56
38
|
setTimeout(() => {
|
|
57
39
|
buffer.flush(traceId);
|
|
58
40
|
}, 500);
|
|
59
41
|
});
|
|
60
|
-
}
|
|
42
|
+
}
|
|
61
43
|
};
|
|
62
|
-
})
|
|
44
|
+
});
|
|
63
45
|
|
|
64
46
|
export { spanStreamingIntegration };
|
|
65
47
|
//# sourceMappingURL=spanstreaming.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanstreaming.js","sources":["../../../../../src/integrations/spanstreaming.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport {\n captureSpan,\n debug,\n defineIntegration,\n hasSpanStreamingEnabled,\n isStreamedBeforeSendSpanCallback,\n SpanBuffer,\n spanIsSampled,\n} from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport const spanStreamingIntegration = defineIntegration(() => {\n return {\n name: 'SpanStreaming',\n\n beforeSetup(client) {\n // If users only set spanStreamingIntegration, without traceLifecycle, we set it to \"stream\" for them.\n // This avoids the classic double-opt-in problem we'd otherwise have in the browser SDK.\n const clientOptions = client.getOptions();\n if (!clientOptions.traceLifecycle) {\n DEBUG_BUILD && debug.log('[SpanStreaming] setting `traceLifecycle` to \"stream\"');\n clientOptions.traceLifecycle = 'stream';\n }\n },\n\n setup(client) {\n const initialMessage = 'SpanStreaming integration requires';\n const fallbackMsg = 'Falling back to static trace lifecycle.';\n const clientOptions = client.getOptions();\n\n if (!hasSpanStreamingEnabled(client)) {\n clientOptions.traceLifecycle = 'static';\n DEBUG_BUILD && debug.warn(`${initialMessage} \\`traceLifecycle\\` to be set to \"stream\"! ${fallbackMsg}`);\n return;\n }\n\n const beforeSendSpan = clientOptions.beforeSendSpan;\n // If users misconfigure their SDK by opting into span streaming but\n // using an incompatible beforeSendSpan callback, we fall back to the static trace lifecycle.\n if (beforeSendSpan && !isStreamedBeforeSendSpanCallback(beforeSendSpan)) {\n clientOptions.traceLifecycle = 'static';\n DEBUG_BUILD &&\n debug.warn(`${initialMessage} a beforeSendSpan callback using \\`withStreamedSpan\\`! ${fallbackMsg}`);\n return;\n }\n\n const buffer = new SpanBuffer(client);\n\n client.on('afterSpanEnd', span => {\n // Negatively sampled spans must not be captured.\n // This happens because OTel and we create non-recording spans for negatively sampled spans\n // that go through the same life cycle as recording spans.\n if (!spanIsSampled(span)) {\n return;\n }\n buffer.add(captureSpan(span, client));\n });\n\n // In addition to capturing the span, we also flush the trace when the segment\n // span ends to ensure things are sent timely. We never know when the browser\n // is closed, users navigate away, etc.\n client.on('afterSegmentSpanEnd', segmentSpan => {\n const traceId = segmentSpan.spanContext().traceId;\n setTimeout(() => {\n buffer.flush(traceId);\n }, 500);\n });\n },\n };\n}) satisfies IntegrationFn;\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"spanstreaming.js","sources":["../../../../../src/integrations/spanstreaming.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport {\n captureSpan,\n debug,\n defineIntegration,\n hasSpanStreamingEnabled,\n isStreamedBeforeSendSpanCallback,\n SpanBuffer,\n spanIsSampled,\n} from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport const spanStreamingIntegration = defineIntegration(() => {\n return {\n name: 'SpanStreaming',\n\n beforeSetup(client) {\n // If users only set spanStreamingIntegration, without traceLifecycle, we set it to \"stream\" for them.\n // This avoids the classic double-opt-in problem we'd otherwise have in the browser SDK.\n const clientOptions = client.getOptions();\n if (!clientOptions.traceLifecycle) {\n DEBUG_BUILD && debug.log('[SpanStreaming] setting `traceLifecycle` to \"stream\"');\n clientOptions.traceLifecycle = 'stream';\n }\n },\n\n setup(client) {\n const initialMessage = 'SpanStreaming integration requires';\n const fallbackMsg = 'Falling back to static trace lifecycle.';\n const clientOptions = client.getOptions();\n\n if (!hasSpanStreamingEnabled(client)) {\n clientOptions.traceLifecycle = 'static';\n DEBUG_BUILD && debug.warn(`${initialMessage} \\`traceLifecycle\\` to be set to \"stream\"! ${fallbackMsg}`);\n return;\n }\n\n const beforeSendSpan = clientOptions.beforeSendSpan;\n // If users misconfigure their SDK by opting into span streaming but\n // using an incompatible beforeSendSpan callback, we fall back to the static trace lifecycle.\n if (beforeSendSpan && !isStreamedBeforeSendSpanCallback(beforeSendSpan)) {\n clientOptions.traceLifecycle = 'static';\n DEBUG_BUILD &&\n debug.warn(`${initialMessage} a beforeSendSpan callback using \\`withStreamedSpan\\`! ${fallbackMsg}`);\n return;\n }\n\n const buffer = new SpanBuffer(client);\n\n client.on('afterSpanEnd', span => {\n // Negatively sampled spans must not be captured.\n // This happens because OTel and we create non-recording spans for negatively sampled spans\n // that go through the same life cycle as recording spans.\n if (!spanIsSampled(span)) {\n return;\n }\n buffer.add(captureSpan(span, client));\n });\n\n // In addition to capturing the span, we also flush the trace when the segment\n // span ends to ensure things are sent timely. We never know when the browser\n // is closed, users navigate away, etc.\n client.on('afterSegmentSpanEnd', segmentSpan => {\n const traceId = segmentSpan.spanContext().traceId;\n setTimeout(() => {\n buffer.flush(traceId);\n }, 500);\n });\n },\n };\n}) satisfies IntegrationFn;\n"],"names":[],"mappings":";;;AAYO,MAAM,wBAAA,GAA2B,kBAAkB,MAAM;AAC9D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IAEN,YAAY,MAAA,EAAQ;AAGlB,MAAA,MAAM,aAAA,GAAgB,OAAO,UAAA,EAAW;AACxC,MAAA,IAAI,CAAC,cAAc,cAAA,EAAgB;AACjC,QAAA,WAAA,IAAe,KAAA,CAAM,IAAI,sDAAsD,CAAA;AAC/E,QAAA,aAAA,CAAc,cAAA,GAAiB,QAAA;AAAA,MACjC;AAAA,IACF,CAAA;AAAA,IAEA,MAAM,MAAA,EAAQ;AACZ,MAAA,MAAM,cAAA,GAAiB,oCAAA;AACvB,MAAA,MAAM,WAAA,GAAc,yCAAA;AACpB,MAAA,MAAM,aAAA,GAAgB,OAAO,UAAA,EAAW;AAExC,MAAA,IAAI,CAAC,uBAAA,CAAwB,MAAM,CAAA,EAAG;AACpC,QAAA,aAAA,CAAc,cAAA,GAAiB,QAAA;AAC/B,QAAA,WAAA,IAAe,MAAM,IAAA,CAAK,CAAA,EAAG,cAAc,CAAA,2CAAA,EAA8C,WAAW,CAAA,CAAE,CAAA;AACtG,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,iBAAiB,aAAA,CAAc,cAAA;AAGrC,MAAA,IAAI,cAAA,IAAkB,CAAC,gCAAA,CAAiC,cAAc,CAAA,EAAG;AACvE,QAAA,aAAA,CAAc,cAAA,GAAiB,QAAA;AAC/B,QAAA,WAAA,IACE,MAAM,IAAA,CAAK,CAAA,EAAG,cAAc,CAAA,uDAAA,EAA0D,WAAW,CAAA,CAAE,CAAA;AACrG,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,MAAA,GAAS,IAAI,UAAA,CAAW,MAAM,CAAA;AAEpC,MAAA,MAAA,CAAO,EAAA,CAAG,gBAAgB,CAAA,IAAA,KAAQ;AAIhC,QAAA,IAAI,CAAC,aAAA,CAAc,IAAI,CAAA,EAAG;AACxB,UAAA;AAAA,QACF;AACA,QAAA,MAAA,CAAO,GAAA,CAAI,WAAA,CAAY,IAAA,EAAM,MAAM,CAAC,CAAA;AAAA,MACtC,CAAC,CAAA;AAKD,MAAA,MAAA,CAAO,EAAA,CAAG,uBAAuB,CAAA,WAAA,KAAe;AAC9C,QAAA,MAAM,OAAA,GAAU,WAAA,CAAY,WAAA,EAAY,CAAE,OAAA;AAC1C,QAAA,UAAA,CAAW,MAAM;AACf,UAAA,MAAA,CAAO,MAAM,OAAO,CAAA;AAAA,QACtB,GAAG,GAAG,CAAA;AAAA,MACR,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAC;;;;"}
|
|
@@ -2,68 +2,55 @@ import { defineIntegration, debug, serializeEnvelope } from '@sentry/core/browse
|
|
|
2
2
|
import { getNativeImplementation } from '@sentry-internal/browser-utils';
|
|
3
3
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
4
4
|
|
|
5
|
-
const INTEGRATION_NAME =
|
|
6
|
-
|
|
7
|
-
const SPOTLIGHT_IGNORE_SPANS = [{ op: 'ui.interaction.click', name: '#sentry-spotlight' }];
|
|
8
|
-
|
|
5
|
+
const INTEGRATION_NAME = "SpotlightBrowser";
|
|
6
|
+
const SPOTLIGHT_IGNORE_SPANS = [{ op: "ui.interaction.click", name: "#sentry-spotlight" }];
|
|
9
7
|
const _spotlightIntegration = ((options = {}) => {
|
|
10
|
-
const sidecarUrl = options.sidecarUrl ||
|
|
11
|
-
|
|
8
|
+
const sidecarUrl = options.sidecarUrl || "http://localhost:8969/stream";
|
|
12
9
|
return {
|
|
13
10
|
name: INTEGRATION_NAME,
|
|
14
11
|
setup: () => {
|
|
15
|
-
DEBUG_BUILD && debug.log(
|
|
12
|
+
DEBUG_BUILD && debug.log("Using Sidecar URL", sidecarUrl);
|
|
16
13
|
},
|
|
17
14
|
beforeSetup(client) {
|
|
18
15
|
const opts = client.getOptions();
|
|
19
|
-
opts.ignoreSpans = [...
|
|
16
|
+
opts.ignoreSpans = [...opts.ignoreSpans || [], ...SPOTLIGHT_IGNORE_SPANS];
|
|
20
17
|
},
|
|
21
18
|
afterAllSetup: (client) => {
|
|
22
19
|
setupSidecarForwarding(client, sidecarUrl);
|
|
23
|
-
}
|
|
20
|
+
}
|
|
24
21
|
};
|
|
25
|
-
})
|
|
26
|
-
|
|
22
|
+
});
|
|
27
23
|
function setupSidecarForwarding(client, sidecarUrl) {
|
|
28
|
-
const makeFetch = getNativeImplementation(
|
|
24
|
+
const makeFetch = getNativeImplementation("fetch");
|
|
29
25
|
let failCount = 0;
|
|
30
|
-
|
|
31
|
-
client.on('beforeEnvelope', (envelope) => {
|
|
26
|
+
client.on("beforeEnvelope", (envelope) => {
|
|
32
27
|
if (failCount > 3) {
|
|
33
|
-
debug.warn(
|
|
28
|
+
debug.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:", failCount);
|
|
34
29
|
return;
|
|
35
30
|
}
|
|
36
|
-
|
|
37
31
|
makeFetch(sidecarUrl, {
|
|
38
|
-
method:
|
|
32
|
+
method: "POST",
|
|
39
33
|
body: serializeEnvelope(envelope),
|
|
40
34
|
headers: {
|
|
41
|
-
|
|
35
|
+
"Content-Type": "application/x-sentry-envelope"
|
|
42
36
|
},
|
|
43
|
-
mode:
|
|
37
|
+
mode: "cors"
|
|
44
38
|
}).then(
|
|
45
|
-
res => {
|
|
39
|
+
(res) => {
|
|
46
40
|
if (res.status >= 200 && res.status < 400) {
|
|
47
|
-
// Reset failed requests counter on success
|
|
48
41
|
failCount = 0;
|
|
49
42
|
}
|
|
50
43
|
},
|
|
51
|
-
err => {
|
|
44
|
+
(err) => {
|
|
52
45
|
failCount++;
|
|
53
46
|
debug.error(
|
|
54
47
|
"Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",
|
|
55
|
-
err
|
|
48
|
+
err
|
|
56
49
|
);
|
|
57
|
-
}
|
|
50
|
+
}
|
|
58
51
|
);
|
|
59
52
|
});
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Use this integration to send errors and transactions to Spotlight.
|
|
64
|
-
*
|
|
65
|
-
* Learn more about spotlight at https://spotlightjs.com
|
|
66
|
-
*/
|
|
67
54
|
const spotlightBrowserIntegration = defineIntegration(_spotlightIntegration);
|
|
68
55
|
|
|
69
56
|
export { INTEGRATION_NAME, SPOTLIGHT_IGNORE_SPANS, spotlightBrowserIntegration };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotlight.js","sources":["../../../../../src/integrations/spotlight.ts"],"sourcesContent":["import type { Client, Envelope, IntegrationFn } from '@sentry/core/browser';\nimport { debug, defineIntegration, serializeEnvelope } from '@sentry/core/browser';\nimport { getNativeImplementation } from '@sentry-internal/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { WINDOW } from '../helpers';\n\nexport type SpotlightConnectionOptions = {\n /**\n * Set this if the Spotlight Sidecar is not running on localhost:8969\n * By default, the Url is set to http://localhost:8969/stream\n */\n sidecarUrl?: string;\n};\n\nexport const INTEGRATION_NAME = 'SpotlightBrowser';\n\nexport const SPOTLIGHT_IGNORE_SPANS = [{ op: 'ui.interaction.click', name: '#sentry-spotlight' }];\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const sidecarUrl = options.sidecarUrl || 'http://localhost:8969/stream';\n\n return {\n name: INTEGRATION_NAME,\n setup: () => {\n DEBUG_BUILD && debug.log('Using Sidecar URL', sidecarUrl);\n },\n beforeSetup(client: Client) {\n const opts = client.getOptions();\n opts.ignoreSpans = [...(opts.ignoreSpans || []), ...SPOTLIGHT_IGNORE_SPANS];\n },\n afterAllSetup: (client: Client) => {\n setupSidecarForwarding(client, sidecarUrl);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction setupSidecarForwarding(client: Client, sidecarUrl: string): void {\n const makeFetch: typeof WINDOW.fetch | undefined = getNativeImplementation('fetch');\n let failCount = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failCount > 3) {\n debug.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:', failCount);\n return;\n }\n\n makeFetch(sidecarUrl, {\n method: 'POST',\n body: serializeEnvelope(envelope),\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n mode: 'cors',\n }).then(\n res => {\n if (res.status >= 200 && res.status < 400) {\n // Reset failed requests counter on success\n failCount = 0;\n }\n },\n err => {\n failCount++;\n debug.error(\n \"Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/\",\n err,\n );\n },\n );\n });\n}\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport const spotlightBrowserIntegration = defineIntegration(_spotlightIntegration);\n"],"names":[],"mappings":";;;;AAcO,MAAM,gBAAA,GAAmB
|
|
1
|
+
{"version":3,"file":"spotlight.js","sources":["../../../../../src/integrations/spotlight.ts"],"sourcesContent":["import type { Client, Envelope, IntegrationFn } from '@sentry/core/browser';\nimport { debug, defineIntegration, serializeEnvelope } from '@sentry/core/browser';\nimport { getNativeImplementation } from '@sentry-internal/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { WINDOW } from '../helpers';\n\nexport type SpotlightConnectionOptions = {\n /**\n * Set this if the Spotlight Sidecar is not running on localhost:8969\n * By default, the Url is set to http://localhost:8969/stream\n */\n sidecarUrl?: string;\n};\n\nexport const INTEGRATION_NAME = 'SpotlightBrowser';\n\nexport const SPOTLIGHT_IGNORE_SPANS = [{ op: 'ui.interaction.click', name: '#sentry-spotlight' }];\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const sidecarUrl = options.sidecarUrl || 'http://localhost:8969/stream';\n\n return {\n name: INTEGRATION_NAME,\n setup: () => {\n DEBUG_BUILD && debug.log('Using Sidecar URL', sidecarUrl);\n },\n beforeSetup(client: Client) {\n const opts = client.getOptions();\n opts.ignoreSpans = [...(opts.ignoreSpans || []), ...SPOTLIGHT_IGNORE_SPANS];\n },\n afterAllSetup: (client: Client) => {\n setupSidecarForwarding(client, sidecarUrl);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction setupSidecarForwarding(client: Client, sidecarUrl: string): void {\n const makeFetch: typeof WINDOW.fetch | undefined = getNativeImplementation('fetch');\n let failCount = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failCount > 3) {\n debug.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:', failCount);\n return;\n }\n\n makeFetch(sidecarUrl, {\n method: 'POST',\n body: serializeEnvelope(envelope),\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n mode: 'cors',\n }).then(\n res => {\n if (res.status >= 200 && res.status < 400) {\n // Reset failed requests counter on success\n failCount = 0;\n }\n },\n err => {\n failCount++;\n debug.error(\n \"Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/\",\n err,\n );\n },\n );\n });\n}\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport const spotlightBrowserIntegration = defineIntegration(_spotlightIntegration);\n"],"names":[],"mappings":";;;;AAcO,MAAM,gBAAA,GAAmB;AAEzB,MAAM,yBAAyB,CAAC,EAAE,IAAI,sBAAA,EAAwB,IAAA,EAAM,qBAAqB;AAEhG,MAAM,qBAAA,IAAyB,CAAC,OAAA,GAA+C,EAAC,KAAM;AACpF,EAAA,MAAM,UAAA,GAAa,QAAQ,UAAA,IAAc,8BAAA;AAEzC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,OAAO,MAAM;AACX,MAAA,WAAA,IAAe,KAAA,CAAM,GAAA,CAAI,mBAAA,EAAqB,UAAU,CAAA;AAAA,IAC1D,CAAA;AAAA,IACA,YAAY,MAAA,EAAgB;AAC1B,MAAA,MAAM,IAAA,GAAO,OAAO,UAAA,EAAW;AAC/B,MAAA,IAAA,CAAK,WAAA,GAAc,CAAC,GAAI,IAAA,CAAK,eAAe,EAAC,EAAI,GAAG,sBAAsB,CAAA;AAAA,IAC5E,CAAA;AAAA,IACA,aAAA,EAAe,CAAC,MAAA,KAAmB;AACjC,MAAA,sBAAA,CAAuB,QAAQ,UAAU,CAAA;AAAA,IAC3C;AAAA,GACF;AACF,CAAA,CAAA;AAEA,SAAS,sBAAA,CAAuB,QAAgB,UAAA,EAA0B;AACxE,EAAA,MAAM,SAAA,GAA6C,wBAAwB,OAAO,CAAA;AAClF,EAAA,IAAI,SAAA,GAAY,CAAA;AAEhB,EAAA,MAAA,CAAO,EAAA,CAAG,gBAAA,EAAkB,CAAC,QAAA,KAAuB;AAClD,IAAA,IAAI,YAAY,CAAA,EAAG;AACjB,MAAA,KAAA,CAAM,IAAA,CAAK,yFAAyF,SAAS,CAAA;AAC7G,MAAA;AAAA,IACF;AAEA,IAAA,SAAA,CAAU,UAAA,EAAY;AAAA,MACpB,MAAA,EAAQ,MAAA;AAAA,MACR,IAAA,EAAM,kBAAkB,QAAQ,CAAA;AAAA,MAChC,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB;AAAA,OAClB;AAAA,MACA,IAAA,EAAM;AAAA,KACP,CAAA,CAAE,IAAA;AAAA,MACD,CAAA,GAAA,KAAO;AACL,QAAA,IAAI,GAAA,CAAI,MAAA,IAAU,GAAA,IAAO,GAAA,CAAI,SAAS,GAAA,EAAK;AAEzC,UAAA,SAAA,GAAY,CAAA;AAAA,QACd;AAAA,MACF,CAAA;AAAA,MACA,CAAA,GAAA,KAAO;AACL,QAAA,SAAA,EAAA;AACA,QAAA,KAAA,CAAM,KAAA;AAAA,UACJ,8FAAA;AAAA,UACA;AAAA,SACF;AAAA,MACF;AAAA,KACF;AAAA,EACF,CAAC,CAAA;AACH;AAOO,MAAM,2BAAA,GAA8B,kBAAkB,qBAAqB;;;;"}
|
|
@@ -1,49 +1,33 @@
|
|
|
1
1
|
import { defineIntegration, getComponentName } from '@sentry/core/browser';
|
|
2
2
|
import { WINDOW } from '../helpers.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* An integration to include a view hierarchy attachment which contains the DOM.
|
|
6
|
-
*/
|
|
7
4
|
const viewHierarchyIntegration = defineIntegration((options = {}) => {
|
|
8
|
-
const skipHtmlTags = [
|
|
9
|
-
|
|
10
|
-
/** Walk an element */
|
|
5
|
+
const skipHtmlTags = ["script"];
|
|
11
6
|
function walk(element, windows, depth = 0) {
|
|
12
7
|
if (!element) {
|
|
13
8
|
return;
|
|
14
9
|
}
|
|
15
|
-
|
|
16
|
-
// With Web Components, we need to walk into shadow DOMs
|
|
17
|
-
const children = 'shadowRoot' in element && element.shadowRoot ? element.shadowRoot.children : element.children;
|
|
18
|
-
|
|
10
|
+
const children = "shadowRoot" in element && element.shadowRoot ? element.shadowRoot.children : element.children;
|
|
19
11
|
for (const child of children) {
|
|
20
12
|
if (!(child instanceof HTMLElement)) {
|
|
21
13
|
continue;
|
|
22
14
|
}
|
|
23
|
-
|
|
24
|
-
const componentName = getComponentName(child, 1) || undefined;
|
|
15
|
+
const componentName = getComponentName(child, 1) || void 0;
|
|
25
16
|
const tagName = child.tagName.toLowerCase();
|
|
26
|
-
|
|
27
17
|
if (skipHtmlTags.includes(tagName)) {
|
|
28
18
|
continue;
|
|
29
19
|
}
|
|
30
|
-
|
|
31
20
|
const result = options.onElement?.({ element: child, componentName, tagName, depth }) || {};
|
|
32
|
-
|
|
33
|
-
if (result === 'skip') {
|
|
21
|
+
if (result === "skip") {
|
|
34
22
|
continue;
|
|
35
23
|
}
|
|
36
|
-
|
|
37
|
-
// Skip this element but include its children
|
|
38
|
-
if (result === 'children') {
|
|
24
|
+
if (result === "children") {
|
|
39
25
|
walk(child, windows, depth + 1);
|
|
40
26
|
continue;
|
|
41
27
|
}
|
|
42
|
-
|
|
43
28
|
const { x, y, width, height } = child.getBoundingClientRect();
|
|
44
|
-
|
|
45
29
|
const window = {
|
|
46
|
-
identifier:
|
|
30
|
+
identifier: child.id || void 0,
|
|
47
31
|
type: componentName || tagName,
|
|
48
32
|
visible: true,
|
|
49
33
|
alpha: 1,
|
|
@@ -51,47 +35,36 @@ const viewHierarchyIntegration = defineIntegration((options = {}) => {
|
|
|
51
35
|
width,
|
|
52
36
|
x,
|
|
53
37
|
y,
|
|
54
|
-
...result
|
|
38
|
+
...result
|
|
55
39
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
window.children = children;
|
|
59
|
-
|
|
60
|
-
// Recursively walk the children
|
|
40
|
+
const children2 = [];
|
|
41
|
+
window.children = children2;
|
|
61
42
|
walk(child, window.children, depth + 1);
|
|
62
|
-
|
|
63
43
|
windows.push(window);
|
|
64
44
|
}
|
|
65
45
|
}
|
|
66
|
-
|
|
67
46
|
return {
|
|
68
|
-
name:
|
|
47
|
+
name: "ViewHierarchy",
|
|
69
48
|
processEvent: (event, hint) => {
|
|
70
|
-
|
|
71
|
-
if (event.type !== undefined || options.shouldAttach?.(event, hint) === false) {
|
|
49
|
+
if (event.type !== void 0 || options.shouldAttach?.(event, hint) === false) {
|
|
72
50
|
return event;
|
|
73
51
|
}
|
|
74
|
-
|
|
75
52
|
const root = {
|
|
76
|
-
rendering_system:
|
|
77
|
-
positioning:
|
|
78
|
-
windows: []
|
|
53
|
+
rendering_system: "DOM",
|
|
54
|
+
positioning: "absolute",
|
|
55
|
+
windows: []
|
|
79
56
|
};
|
|
80
|
-
|
|
81
57
|
walk(options.rootElement?.() || WINDOW.document.body, root.windows);
|
|
82
|
-
|
|
83
58
|
const attachment = {
|
|
84
|
-
filename:
|
|
85
|
-
attachmentType:
|
|
86
|
-
contentType:
|
|
87
|
-
data: JSON.stringify(root)
|
|
59
|
+
filename: "view-hierarchy.json",
|
|
60
|
+
attachmentType: "event.view_hierarchy",
|
|
61
|
+
contentType: "application/json",
|
|
62
|
+
data: JSON.stringify(root)
|
|
88
63
|
};
|
|
89
|
-
|
|
90
64
|
hint.attachments = hint.attachments || [];
|
|
91
65
|
hint.attachments.push(attachment);
|
|
92
|
-
|
|
93
66
|
return event;
|
|
94
|
-
}
|
|
67
|
+
}
|
|
95
68
|
};
|
|
96
69
|
});
|
|
97
70
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-hierarchy.js","sources":["../../../../../src/integrations/view-hierarchy.ts"],"sourcesContent":["import type { Attachment, Event, EventHint, ViewHierarchyData, ViewHierarchyWindow } from '@sentry/core/browser';\nimport { defineIntegration, getComponentName } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\n\ninterface OnElementArgs {\n /**\n * The element being processed.\n */\n element: HTMLElement;\n /**\n * Lowercase tag name of the element.\n */\n tagName: string;\n /**\n * The component name of the element.\n */\n componentName?: string;\n\n /**\n * The current depth of the element in the view hierarchy. The root element will have a depth of 0.\n *\n * This allows you to limit the traversal depth for large DOM trees.\n */\n depth?: number;\n}\n\ninterface Options {\n /**\n * Whether to attach the view hierarchy to the event.\n *\n * Default: Always attach.\n */\n shouldAttach?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * A function that returns the root element to start walking the DOM from.\n *\n * Default: `window.document.body`\n */\n rootElement?: () => HTMLElement | undefined;\n\n /**\n * Called for each HTMLElement as we walk the DOM.\n *\n * Return an object to include the element with any additional properties.\n * Return `skip` to exclude the element and its children.\n * Return `children` to skip the element but include its children.\n */\n onElement?: (prop: OnElementArgs) => Record<string, string | number | boolean> | 'skip' | 'children';\n}\n\n/**\n * An integration to include a view hierarchy attachment which contains the DOM.\n */\nexport const viewHierarchyIntegration = defineIntegration((options: Options = {}) => {\n const skipHtmlTags = ['script'];\n\n /** Walk an element */\n function walk(element: HTMLElement, windows: ViewHierarchyWindow[], depth = 0): void {\n if (!element) {\n return;\n }\n\n // With Web Components, we need to walk into shadow DOMs\n const children = 'shadowRoot' in element && element.shadowRoot ? element.shadowRoot.children : element.children;\n\n for (const child of children) {\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n\n const componentName = getComponentName(child, 1) || undefined;\n const tagName = child.tagName.toLowerCase();\n\n if (skipHtmlTags.includes(tagName)) {\n continue;\n }\n\n const result = options.onElement?.({ element: child, componentName, tagName, depth }) || {};\n\n if (result === 'skip') {\n continue;\n }\n\n // Skip this element but include its children\n if (result === 'children') {\n walk(child, windows, depth + 1);\n continue;\n }\n\n const { x, y, width, height } = child.getBoundingClientRect();\n\n const window: ViewHierarchyWindow = {\n identifier: (child.id || undefined) as string,\n type: componentName || tagName,\n visible: true,\n alpha: 1,\n height,\n width,\n x,\n y,\n ...result,\n };\n\n const children: ViewHierarchyWindow[] = [];\n window.children = children;\n\n // Recursively walk the children\n walk(child, window.children, depth + 1);\n\n windows.push(window);\n }\n }\n\n return {\n name: 'ViewHierarchy',\n processEvent: (event, hint) => {\n // only capture for error events\n if (event.type !== undefined || options.shouldAttach?.(event, hint) === false) {\n return event;\n }\n\n const root: ViewHierarchyData = {\n rendering_system: 'DOM',\n positioning: 'absolute',\n windows: [],\n };\n\n walk(options.rootElement?.() || WINDOW.document.body, root.windows);\n\n const attachment: Attachment = {\n filename: 'view-hierarchy.json',\n attachmentType: 'event.view_hierarchy',\n contentType: 'application/json',\n data: JSON.stringify(root),\n };\n\n hint.attachments = hint.attachments || [];\n hint.attachments.push(attachment);\n\n return event;\n },\n };\n});\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"view-hierarchy.js","sources":["../../../../../src/integrations/view-hierarchy.ts"],"sourcesContent":["import type { Attachment, Event, EventHint, ViewHierarchyData, ViewHierarchyWindow } from '@sentry/core/browser';\nimport { defineIntegration, getComponentName } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\n\ninterface OnElementArgs {\n /**\n * The element being processed.\n */\n element: HTMLElement;\n /**\n * Lowercase tag name of the element.\n */\n tagName: string;\n /**\n * The component name of the element.\n */\n componentName?: string;\n\n /**\n * The current depth of the element in the view hierarchy. The root element will have a depth of 0.\n *\n * This allows you to limit the traversal depth for large DOM trees.\n */\n depth?: number;\n}\n\ninterface Options {\n /**\n * Whether to attach the view hierarchy to the event.\n *\n * Default: Always attach.\n */\n shouldAttach?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * A function that returns the root element to start walking the DOM from.\n *\n * Default: `window.document.body`\n */\n rootElement?: () => HTMLElement | undefined;\n\n /**\n * Called for each HTMLElement as we walk the DOM.\n *\n * Return an object to include the element with any additional properties.\n * Return `skip` to exclude the element and its children.\n * Return `children` to skip the element but include its children.\n */\n onElement?: (prop: OnElementArgs) => Record<string, string | number | boolean> | 'skip' | 'children';\n}\n\n/**\n * An integration to include a view hierarchy attachment which contains the DOM.\n */\nexport const viewHierarchyIntegration = defineIntegration((options: Options = {}) => {\n const skipHtmlTags = ['script'];\n\n /** Walk an element */\n function walk(element: HTMLElement, windows: ViewHierarchyWindow[], depth = 0): void {\n if (!element) {\n return;\n }\n\n // With Web Components, we need to walk into shadow DOMs\n const children = 'shadowRoot' in element && element.shadowRoot ? element.shadowRoot.children : element.children;\n\n for (const child of children) {\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n\n const componentName = getComponentName(child, 1) || undefined;\n const tagName = child.tagName.toLowerCase();\n\n if (skipHtmlTags.includes(tagName)) {\n continue;\n }\n\n const result = options.onElement?.({ element: child, componentName, tagName, depth }) || {};\n\n if (result === 'skip') {\n continue;\n }\n\n // Skip this element but include its children\n if (result === 'children') {\n walk(child, windows, depth + 1);\n continue;\n }\n\n const { x, y, width, height } = child.getBoundingClientRect();\n\n const window: ViewHierarchyWindow = {\n identifier: (child.id || undefined) as string,\n type: componentName || tagName,\n visible: true,\n alpha: 1,\n height,\n width,\n x,\n y,\n ...result,\n };\n\n const children: ViewHierarchyWindow[] = [];\n window.children = children;\n\n // Recursively walk the children\n walk(child, window.children, depth + 1);\n\n windows.push(window);\n }\n }\n\n return {\n name: 'ViewHierarchy',\n processEvent: (event, hint) => {\n // only capture for error events\n if (event.type !== undefined || options.shouldAttach?.(event, hint) === false) {\n return event;\n }\n\n const root: ViewHierarchyData = {\n rendering_system: 'DOM',\n positioning: 'absolute',\n windows: [],\n };\n\n walk(options.rootElement?.() || WINDOW.document.body, root.windows);\n\n const attachment: Attachment = {\n filename: 'view-hierarchy.json',\n attachmentType: 'event.view_hierarchy',\n contentType: 'application/json',\n data: JSON.stringify(root),\n };\n\n hint.attachments = hint.attachments || [];\n hint.attachments.push(attachment);\n\n return event;\n },\n };\n});\n"],"names":["children"],"mappings":";;;AAsDO,MAAM,wBAAA,GAA2B,iBAAA,CAAkB,CAAC,OAAA,GAAmB,EAAC,KAAM;AACnF,EAAA,MAAM,YAAA,GAAe,CAAC,QAAQ,CAAA;AAG9B,EAAA,SAAS,IAAA,CAAK,OAAA,EAAsB,OAAA,EAAgC,KAAA,GAAQ,CAAA,EAAS;AACnF,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA;AAAA,IACF;AAGA,IAAA,MAAM,QAAA,GAAW,gBAAgB,OAAA,IAAW,OAAA,CAAQ,aAAa,OAAA,CAAQ,UAAA,CAAW,WAAW,OAAA,CAAQ,QAAA;AAEvG,IAAA,KAAA,MAAW,SAAS,QAAA,EAAU;AAC5B,MAAA,IAAI,EAAE,iBAAiB,WAAA,CAAA,EAAc;AACnC,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,aAAA,GAAgB,gBAAA,CAAiB,KAAA,EAAO,CAAC,CAAA,IAAK,MAAA;AACpD,MAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,CAAQ,WAAA,EAAY;AAE1C,MAAA,IAAI,YAAA,CAAa,QAAA,CAAS,OAAO,CAAA,EAAG;AAClC,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,MAAA,GAAS,OAAA,CAAQ,SAAA,GAAY,EAAE,OAAA,EAAS,KAAA,EAAO,aAAA,EAAe,OAAA,EAAS,KAAA,EAAO,CAAA,IAAK,EAAC;AAE1F,MAAA,IAAI,WAAW,MAAA,EAAQ;AACrB,QAAA;AAAA,MACF;AAGA,MAAA,IAAI,WAAW,UAAA,EAAY;AACzB,QAAA,IAAA,CAAK,KAAA,EAAO,OAAA,EAAS,KAAA,GAAQ,CAAC,CAAA;AAC9B,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,EAAE,CAAA,EAAG,CAAA,EAAG,OAAO,MAAA,EAAO,GAAI,MAAM,qBAAA,EAAsB;AAE5D,MAAA,MAAM,MAAA,GAA8B;AAAA,QAClC,UAAA,EAAa,MAAM,EAAA,IAAM,MAAA;AAAA,QACzB,MAAM,aAAA,IAAiB,OAAA;AAAA,QACvB,OAAA,EAAS,IAAA;AAAA,QACT,KAAA,EAAO,CAAA;AAAA,QACP,MAAA;AAAA,QACA,KAAA;AAAA,QACA,CAAA;AAAA,QACA,CAAA;AAAA,QACA,GAAG;AAAA,OACL;AAEA,MAAA,MAAMA,YAAkC,EAAC;AACzC,MAAA,MAAA,CAAO,QAAA,GAAWA,SAAAA;AAGlB,MAAA,IAAA,CAAK,KAAA,EAAO,MAAA,CAAO,QAAA,EAAU,KAAA,GAAQ,CAAC,CAAA;AAEtC,MAAA,OAAA,CAAQ,KAAK,MAAM,CAAA;AAAA,IACrB;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IACN,YAAA,EAAc,CAAC,KAAA,EAAO,IAAA,KAAS;AAE7B,MAAA,IAAI,KAAA,CAAM,SAAS,MAAA,IAAa,OAAA,CAAQ,eAAe,KAAA,EAAO,IAAI,MAAM,KAAA,EAAO;AAC7E,QAAA,OAAO,KAAA;AAAA,MACT;AAEA,MAAA,MAAM,IAAA,GAA0B;AAAA,QAC9B,gBAAA,EAAkB,KAAA;AAAA,QAClB,WAAA,EAAa,UAAA;AAAA,QACb,SAAS;AAAC,OACZ;AAEA,MAAA,IAAA,CAAK,QAAQ,WAAA,IAAc,IAAK,OAAO,QAAA,CAAS,IAAA,EAAM,KAAK,OAAO,CAAA;AAElE,MAAA,MAAM,UAAA,GAAyB;AAAA,QAC7B,QAAA,EAAU,qBAAA;AAAA,QACV,cAAA,EAAgB,sBAAA;AAAA,QAChB,WAAA,EAAa,kBAAA;AAAA,QACb,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,IAAI;AAAA,OAC3B;AAEA,MAAA,IAAA,CAAK,WAAA,GAAc,IAAA,CAAK,WAAA,IAAe,EAAC;AACxC,MAAA,IAAA,CAAK,WAAA,CAAY,KAAK,UAAU,CAAA;AAEhC,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,GACF;AACF,CAAC;;;;"}
|