@sentry/browser 10.52.0 → 10.53.1
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 +7 -7
- package/build/npm/cjs/dev/client.js.map +1 -1
- package/build/npm/cjs/dev/diagnose-sdk.js +3 -3
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/dev/eventbuilder.js +23 -23
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
- package/build/npm/cjs/dev/helpers.js +10 -10
- package/build/npm/cjs/dev/helpers.js.map +1 -1
- package/build/npm/cjs/dev/index.js +84 -84
- package/build/npm/cjs/dev/integrations/breadcrumbs.js +29 -29
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browserapierrors.js +16 -16
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/browsersession.js +9 -9
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/dev/integrations/contextlines.js +5 -5
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/dev/integrations/culturecontext.js +3 -3
- package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +2 -2
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +5 -5
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +7 -7
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -5
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +7 -7
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/dev/integrations/globalhandlers.js +16 -16
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/dev/integrations/graphqlClient.js +9 -9
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpclient.js +14 -14
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/dev/integrations/httpcontext.js +3 -3
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/dev/integrations/linkederrors.js +3 -3
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/dev/integrations/reportingobserver.js +7 -7
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spanstreaming.js +10 -10
- package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/dev/integrations/spotlight.js +6 -6
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/dev/integrations/view-hierarchy.js +3 -3
- package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/dev/integrations/webWorker.js +18 -18
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/dev/profiling/UIProfiler.js +43 -33
- package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/dev/profiling/index.js +7 -7
- package/build/npm/cjs/dev/profiling/index.js.map +1 -1
- package/build/npm/cjs/dev/profiling/integration.js +20 -18
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js +14 -11
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/dev/profiling/utils.js +39 -68
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
- package/build/npm/cjs/dev/report-dialog.js +7 -7
- package/build/npm/cjs/dev/report-dialog.js.map +1 -1
- package/build/npm/cjs/dev/sdk.js +8 -8
- package/build/npm/cjs/dev/sdk.js.map +1 -1
- package/build/npm/cjs/dev/stack-parsers.js +10 -10
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
- package/build/npm/cjs/dev/tracing/backgroundtab.js +7 -7
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +52 -52
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/dev/tracing/linkedTraces.js +11 -11
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js +2 -2
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/dev/tracing/request.js +28 -28
- package/build/npm/cjs/dev/tracing/request.js.map +1 -1
- package/build/npm/cjs/dev/tracing/setActiveSpan.js +5 -5
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/dev/transports/fetch.js +3 -3
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
- package/build/npm/cjs/dev/transports/offline.js +5 -5
- package/build/npm/cjs/dev/transports/offline.js.map +1 -1
- package/build/npm/cjs/dev/userfeedback.js +3 -3
- package/build/npm/cjs/dev/userfeedback.js.map +1 -1
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js +3 -3
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +3 -3
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/cjs/prod/client.js +7 -7
- package/build/npm/cjs/prod/client.js.map +1 -1
- package/build/npm/cjs/prod/diagnose-sdk.js +3 -3
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/cjs/prod/eventbuilder.js +23 -23
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
- package/build/npm/cjs/prod/helpers.js +10 -10
- package/build/npm/cjs/prod/helpers.js.map +1 -1
- package/build/npm/cjs/prod/index.js +84 -84
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +29 -29
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browserapierrors.js +16 -16
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/browsersession.js +9 -9
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/cjs/prod/integrations/contextlines.js +5 -5
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/cjs/prod/integrations/culturecontext.js +3 -3
- package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +2 -2
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +5 -5
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +7 -7
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -5
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +7 -7
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/cjs/prod/integrations/globalhandlers.js +16 -16
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/cjs/prod/integrations/graphqlClient.js +9 -9
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpclient.js +14 -14
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/cjs/prod/integrations/httpcontext.js +3 -3
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/cjs/prod/integrations/linkederrors.js +3 -3
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/cjs/prod/integrations/reportingobserver.js +7 -7
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spanstreaming.js +10 -10
- package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/cjs/prod/integrations/spotlight.js +6 -6
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/cjs/prod/integrations/view-hierarchy.js +3 -3
- package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/cjs/prod/integrations/webWorker.js +18 -18
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
- package/build/npm/cjs/prod/profiling/UIProfiler.js +43 -33
- package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/cjs/prod/profiling/index.js +7 -7
- package/build/npm/cjs/prod/profiling/index.js.map +1 -1
- package/build/npm/cjs/prod/profiling/integration.js +20 -18
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +14 -11
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/cjs/prod/profiling/utils.js +39 -68
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
- package/build/npm/cjs/prod/report-dialog.js +7 -7
- package/build/npm/cjs/prod/report-dialog.js.map +1 -1
- package/build/npm/cjs/prod/sdk.js +8 -8
- package/build/npm/cjs/prod/sdk.js.map +1 -1
- package/build/npm/cjs/prod/stack-parsers.js +10 -10
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
- package/build/npm/cjs/prod/tracing/backgroundtab.js +7 -7
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +52 -52
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/prod/tracing/linkedTraces.js +11 -11
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +2 -2
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/cjs/prod/tracing/request.js +28 -28
- package/build/npm/cjs/prod/tracing/request.js.map +1 -1
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +5 -5
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/cjs/prod/transports/fetch.js +3 -3
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
- package/build/npm/cjs/prod/transports/offline.js +5 -5
- package/build/npm/cjs/prod/transports/offline.js.map +1 -1
- package/build/npm/cjs/prod/userfeedback.js +3 -3
- package/build/npm/cjs/prod/userfeedback.js.map +1 -1
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +3 -3
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +3 -3
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/dev/client.js +1 -1
- package/build/npm/esm/dev/client.js.map +1 -1
- package/build/npm/esm/dev/diagnose-sdk.js +1 -1
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/dev/eventbuilder.js +1 -1
- package/build/npm/esm/dev/eventbuilder.js.map +1 -1
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
- package/build/npm/esm/dev/feedbackSync.js.map +1 -1
- package/build/npm/esm/dev/helpers.js +1 -1
- package/build/npm/esm/dev/helpers.js.map +1 -1
- package/build/npm/esm/dev/index.js +1 -1
- package/build/npm/esm/dev/integrations/breadcrumbs.js +1 -1
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/dev/integrations/browserapierrors.js +1 -1
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/browsersession.js +1 -1
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/dev/integrations/contextlines.js +1 -1
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/dev/integrations/culturecontext.js +1 -1
- package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +1 -1
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/dev/integrations/globalhandlers.js +1 -1
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/dev/integrations/graphqlClient.js +1 -1
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpclient.js +1 -1
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/dev/integrations/httpcontext.js +1 -1
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/dev/integrations/linkederrors.js +1 -1
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/dev/integrations/reportingobserver.js +1 -1
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/dev/integrations/spanstreaming.js +1 -1
- package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/dev/integrations/spotlight.js +1 -1
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/dev/integrations/view-hierarchy.js +1 -1
- package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/dev/integrations/webWorker.js +1 -1
- 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 +12 -2
- package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/dev/profiling/index.js +1 -1
- package/build/npm/esm/dev/profiling/index.js.map +1 -1
- package/build/npm/esm/dev/profiling/integration.js +9 -7
- package/build/npm/esm/dev/profiling/integration.js.map +1 -1
- package/build/npm/esm/dev/profiling/startProfileForSpan.js +5 -2
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/dev/profiling/utils.js +6 -36
- package/build/npm/esm/dev/profiling/utils.js.map +1 -1
- package/build/npm/esm/dev/report-dialog.js +1 -1
- package/build/npm/esm/dev/report-dialog.js.map +1 -1
- package/build/npm/esm/dev/sdk.js +1 -1
- package/build/npm/esm/dev/sdk.js.map +1 -1
- package/build/npm/esm/dev/stack-parsers.js +1 -1
- package/build/npm/esm/dev/stack-parsers.js.map +1 -1
- package/build/npm/esm/dev/tracing/backgroundtab.js +1 -1
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js +1 -1
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/dev/tracing/linkedTraces.js +2 -2
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -1
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/dev/tracing/request.js +1 -1
- package/build/npm/esm/dev/tracing/request.js.map +1 -1
- package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -1
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/dev/transports/fetch.js +1 -1
- package/build/npm/esm/dev/transports/fetch.js.map +1 -1
- package/build/npm/esm/dev/transports/offline.js +1 -1
- package/build/npm/esm/dev/transports/offline.js.map +1 -1
- package/build/npm/esm/dev/userfeedback.js +1 -1
- package/build/npm/esm/dev/userfeedback.js.map +1 -1
- package/build/npm/esm/dev/utils/detectBrowserExtension.js +1 -1
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js +1 -1
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/prod/client.js +1 -1
- package/build/npm/esm/prod/client.js.map +1 -1
- package/build/npm/esm/prod/diagnose-sdk.js +1 -1
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
- package/build/npm/esm/prod/eventbuilder.js +1 -1
- package/build/npm/esm/prod/eventbuilder.js.map +1 -1
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
- package/build/npm/esm/prod/feedbackSync.js.map +1 -1
- package/build/npm/esm/prod/helpers.js +1 -1
- package/build/npm/esm/prod/helpers.js.map +1 -1
- package/build/npm/esm/prod/index.js +1 -1
- package/build/npm/esm/prod/integrations/breadcrumbs.js +1 -1
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
- package/build/npm/esm/prod/integrations/browserapierrors.js +1 -1
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/browsersession.js +1 -1
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
- package/build/npm/esm/prod/integrations/contextlines.js +1 -1
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
- package/build/npm/esm/prod/integrations/culturecontext.js +1 -1
- package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +1 -1
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
- package/build/npm/esm/prod/integrations/globalhandlers.js +1 -1
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
- package/build/npm/esm/prod/integrations/graphqlClient.js +1 -1
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpclient.js +1 -1
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
- package/build/npm/esm/prod/integrations/httpcontext.js +1 -1
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
- package/build/npm/esm/prod/integrations/linkederrors.js +1 -1
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
- package/build/npm/esm/prod/integrations/reportingobserver.js +1 -1
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
- package/build/npm/esm/prod/integrations/spanstreaming.js +1 -1
- package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
- package/build/npm/esm/prod/integrations/spotlight.js +1 -1
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
- package/build/npm/esm/prod/integrations/view-hierarchy.js +1 -1
- package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
- package/build/npm/esm/prod/integrations/webWorker.js +1 -1
- 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 +12 -2
- package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
- package/build/npm/esm/prod/profiling/index.js +1 -1
- package/build/npm/esm/prod/profiling/index.js.map +1 -1
- package/build/npm/esm/prod/profiling/integration.js +9 -7
- package/build/npm/esm/prod/profiling/integration.js.map +1 -1
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +5 -2
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
- package/build/npm/esm/prod/profiling/utils.js +6 -36
- package/build/npm/esm/prod/profiling/utils.js.map +1 -1
- package/build/npm/esm/prod/report-dialog.js +1 -1
- package/build/npm/esm/prod/report-dialog.js.map +1 -1
- package/build/npm/esm/prod/sdk.js +1 -1
- package/build/npm/esm/prod/sdk.js.map +1 -1
- package/build/npm/esm/prod/stack-parsers.js +1 -1
- package/build/npm/esm/prod/stack-parsers.js.map +1 -1
- package/build/npm/esm/prod/tracing/backgroundtab.js +1 -1
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +1 -1
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/prod/tracing/linkedTraces.js +2 -2
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -1
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
- package/build/npm/esm/prod/tracing/request.js +1 -1
- package/build/npm/esm/prod/tracing/request.js.map +1 -1
- package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -1
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
- package/build/npm/esm/prod/transports/fetch.js +1 -1
- package/build/npm/esm/prod/transports/fetch.js.map +1 -1
- package/build/npm/esm/prod/transports/offline.js +1 -1
- package/build/npm/esm/prod/transports/offline.js.map +1 -1
- package/build/npm/esm/prod/userfeedback.js +1 -1
- package/build/npm/esm/prod/userfeedback.js.map +1 -1
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +1 -1
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +1 -1
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/types/client.d.ts +2 -2
- package/build/npm/types/client.d.ts.map +1 -1
- package/build/npm/types/eventbuilder.d.ts +1 -1
- package/build/npm/types/eventbuilder.d.ts.map +1 -1
- package/build/npm/types/exports.d.ts +3 -3
- package/build/npm/types/exports.d.ts.map +1 -1
- package/build/npm/types/feedbackAsync.d.ts +2 -7
- package/build/npm/types/feedbackAsync.d.ts.map +1 -1
- package/build/npm/types/feedbackSync.d.ts +2 -7
- package/build/npm/types/feedbackSync.d.ts.map +1 -1
- package/build/npm/types/helpers.d.ts +2 -2
- package/build/npm/types/helpers.d.ts.map +1 -1
- package/build/npm/types/index.bundle.logs.metrics.d.ts +1 -1
- package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +1 -1
- package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.d.ts +1 -1
- package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +2 -2
- 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 -1
- 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 -1
- 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 -1
- 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 +2 -2
- package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
- package/build/npm/types/index.d.ts +3 -3
- package/build/npm/types/index.d.ts.map +1 -1
- package/build/npm/types/integrations/contextlines.d.ts +1 -1
- package/build/npm/types/integrations/contextlines.d.ts.map +1 -1
- package/build/npm/types/integrations/globalhandlers.d.ts +1 -1
- package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
- package/build/npm/types/integrations/view-hierarchy.d.ts +1 -1
- package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -1
- package/build/npm/types/integrations/webWorker.d.ts +1 -1
- package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.captureconsole.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.captureconsole.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.dedupe.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.dedupe.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.feedback.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.feedback.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -1
- package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts +1 -1
- package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts.map +1 -1
- package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
- package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -1
- package/build/npm/types/profiling/UIProfiler.d.ts +1 -1
- package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -1
- package/build/npm/types/profiling/index.d.ts +1 -1
- package/build/npm/types/profiling/index.d.ts.map +1 -1
- package/build/npm/types/profiling/integration.d.ts.map +1 -1
- package/build/npm/types/profiling/startProfileForSpan.d.ts +1 -1
- package/build/npm/types/profiling/startProfileForSpan.d.ts.map +1 -1
- package/build/npm/types/profiling/utils.d.ts +3 -5
- package/build/npm/types/profiling/utils.d.ts.map +1 -1
- package/build/npm/types/report-dialog.d.ts +1 -1
- package/build/npm/types/report-dialog.d.ts.map +1 -1
- package/build/npm/types/sdk.d.ts +1 -1
- package/build/npm/types/sdk.d.ts.map +1 -1
- package/build/npm/types/stack-parsers.d.ts +1 -1
- package/build/npm/types/stack-parsers.d.ts.map +1 -1
- package/build/npm/types/tracing/browserTracingIntegration.d.ts +1 -1
- package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
- package/build/npm/types/tracing/linkedTraces.d.ts +2 -2
- package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -1
- package/build/npm/types/tracing/reportPageLoaded.d.ts +1 -1
- package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -1
- package/build/npm/types/tracing/request.d.ts +1 -1
- package/build/npm/types/tracing/request.d.ts.map +1 -1
- package/build/npm/types/tracing/setActiveSpan.d.ts +1 -1
- package/build/npm/types/tracing/setActiveSpan.d.ts.map +1 -1
- package/build/npm/types/transports/fetch.d.ts +1 -1
- package/build/npm/types/transports/fetch.d.ts.map +1 -1
- package/build/npm/types/transports/offline.d.ts +1 -1
- package/build/npm/types/transports/offline.d.ts.map +1 -1
- package/build/npm/types/transports/types.d.ts +1 -1
- package/build/npm/types/transports/types.d.ts.map +1 -1
- package/build/npm/types/userfeedback.d.ts +1 -1
- package/build/npm/types/userfeedback.d.ts.map +1 -1
- package/build/npm/types/utils/lazyLoadIntegration.d.ts +1 -1
- package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
- package/build/npm/types-ts3.8/client.d.ts +2 -2
- package/build/npm/types-ts3.8/eventbuilder.d.ts +1 -1
- package/build/npm/types-ts3.8/exports.d.ts +3 -3
- package/build/npm/types-ts3.8/feedbackAsync.d.ts +2 -7
- package/build/npm/types-ts3.8/feedbackSync.d.ts +2 -7
- package/build/npm/types-ts3.8/helpers.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +2 -2
- package/build/npm/types-ts3.8/index.d.ts +3 -3
- package/build/npm/types-ts3.8/integrations/contextlines.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations/view-hierarchy.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations/webWorker.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.captureconsole.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.createlangchaincallbackhandler.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.dedupe.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.extraerrordata.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.feedback.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlangchainembeddings.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlanggraph.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +1 -1
- package/build/npm/types-ts3.8/integrations-bundle/index.rewriteframes.d.ts +1 -1
- package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
- package/build/npm/types-ts3.8/profiling/UIProfiler.d.ts +1 -1
- package/build/npm/types-ts3.8/profiling/index.d.ts +1 -1
- package/build/npm/types-ts3.8/profiling/startProfileForSpan.d.ts +1 -1
- package/build/npm/types-ts3.8/profiling/utils.d.ts +3 -5
- package/build/npm/types-ts3.8/report-dialog.d.ts +1 -1
- package/build/npm/types-ts3.8/sdk.d.ts +1 -1
- package/build/npm/types-ts3.8/stack-parsers.d.ts +1 -1
- package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +1 -1
- package/build/npm/types-ts3.8/tracing/linkedTraces.d.ts +2 -2
- package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +1 -1
- package/build/npm/types-ts3.8/tracing/request.d.ts +1 -1
- package/build/npm/types-ts3.8/tracing/setActiveSpan.d.ts +1 -1
- package/build/npm/types-ts3.8/transports/fetch.d.ts +1 -1
- package/build/npm/types-ts3.8/transports/offline.d.ts +1 -1
- package/build/npm/types-ts3.8/transports/types.d.ts +1 -1
- package/build/npm/types-ts3.8/userfeedback.d.ts +1 -1
- package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const browser = require('@sentry/core/browser');
|
|
4
4
|
const debugBuild = require('../debug-build.js');
|
|
5
5
|
const helpers = require('../helpers.js');
|
|
6
6
|
const utils = require('./utils.js');
|
|
@@ -14,7 +14,7 @@ function startProfileForSpan(span) {
|
|
|
14
14
|
// Start the profiler and get the profiler instance.
|
|
15
15
|
let startTimestamp;
|
|
16
16
|
if (utils.isAutomatedPageLoadSpan(span)) {
|
|
17
|
-
startTimestamp =
|
|
17
|
+
startTimestamp = browser.timestampInSeconds() * 1000;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const profiler = utils.startJSSelfProfile();
|
|
@@ -26,13 +26,13 @@ function startProfileForSpan(span) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (debugBuild.DEBUG_BUILD) {
|
|
29
|
-
|
|
29
|
+
browser.debug.log(`[Profiling] started profiling span: ${browser.spanToJSON(span).description}`);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// We create "unique" span names to avoid concurrent spans with same names
|
|
33
33
|
// from being ignored by the profiler. From here on, only this span name should be used when
|
|
34
34
|
// calling the profiler methods. Note: we log the original name to the user to avoid confusion.
|
|
35
|
-
const profileId =
|
|
35
|
+
const profileId = browser.uuid4();
|
|
36
36
|
|
|
37
37
|
// A couple of important things to note here:
|
|
38
38
|
// `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.
|
|
@@ -43,11 +43,14 @@ function startProfileForSpan(span) {
|
|
|
43
43
|
// After the original finish method is called, the event will be reported through the integration and delegated to transport.
|
|
44
44
|
let processedProfile = null;
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
browser.getCurrentScope().setContext('profile', {
|
|
47
47
|
profile_id: profileId,
|
|
48
48
|
start_timestamp: startTimestamp,
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
utils.PROFILED_ROOT_SPANS.add(span);
|
|
52
|
+
utils.setThreadAttributes(span);
|
|
53
|
+
|
|
51
54
|
/**
|
|
52
55
|
* Idempotent handler for profile stop
|
|
53
56
|
*/
|
|
@@ -62,7 +65,7 @@ function startProfileForSpan(span) {
|
|
|
62
65
|
}
|
|
63
66
|
if (processedProfile) {
|
|
64
67
|
if (debugBuild.DEBUG_BUILD) {
|
|
65
|
-
|
|
68
|
+
browser.debug.log('[Profiling] profile for:', browser.spanToJSON(span).description, 'already exists, returning early');
|
|
66
69
|
}
|
|
67
70
|
return;
|
|
68
71
|
}
|
|
@@ -76,14 +79,14 @@ function startProfileForSpan(span) {
|
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
if (debugBuild.DEBUG_BUILD) {
|
|
79
|
-
|
|
82
|
+
browser.debug.log(`[Profiling] stopped profiling of span: ${browser.spanToJSON(span).description}`);
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
// In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile.
|
|
83
86
|
if (!profile) {
|
|
84
87
|
if (debugBuild.DEBUG_BUILD) {
|
|
85
|
-
|
|
86
|
-
`[Profiling] profiler returned null profile for: ${
|
|
88
|
+
browser.debug.log(
|
|
89
|
+
`[Profiling] profiler returned null profile for: ${browser.spanToJSON(span).description}`,
|
|
87
90
|
'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started',
|
|
88
91
|
);
|
|
89
92
|
}
|
|
@@ -95,7 +98,7 @@ function startProfileForSpan(span) {
|
|
|
95
98
|
})
|
|
96
99
|
.catch(error => {
|
|
97
100
|
if (debugBuild.DEBUG_BUILD) {
|
|
98
|
-
|
|
101
|
+
browser.debug.log('[Profiling] error while stopping profiler:', error);
|
|
99
102
|
}
|
|
100
103
|
});
|
|
101
104
|
}
|
|
@@ -103,7 +106,7 @@ function startProfileForSpan(span) {
|
|
|
103
106
|
// Enqueue a timeout to prevent profiles from running over max duration.
|
|
104
107
|
let maxDurationTimeoutID = helpers.WINDOW.setTimeout(() => {
|
|
105
108
|
if (debugBuild.DEBUG_BUILD) {
|
|
106
|
-
|
|
109
|
+
browser.debug.log('[Profiling] max profile duration elapsed, stopping profiling for:', browser.spanToJSON(span).description);
|
|
107
110
|
}
|
|
108
111
|
// If the timeout exceeds, we want to stop profiling, but not finish the span
|
|
109
112
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startProfileForSpan.js","sources":["../../../../../src/profiling/startProfileForSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core';\nimport { debug, getCurrentScope, spanToJSON, timestampInSeconds, uuid4 } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile } from './jsSelfProfiling';\nimport {
|
|
1
|
+
{"version":3,"file":"startProfileForSpan.js","sources":["../../../../../src/profiling/startProfileForSpan.ts"],"sourcesContent":["import type { Span } from '@sentry/core/browser';\nimport { debug, getCurrentScope, spanToJSON, timestampInSeconds, uuid4 } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport type { JSSelfProfile } from './jsSelfProfiling';\nimport {\n addProfileToGlobalCache,\n isAutomatedPageLoadSpan,\n MAX_PROFILE_DURATION_MS,\n PROFILED_ROOT_SPANS,\n setThreadAttributes,\n startJSSelfProfile,\n} from './utils';\n\n/**\n * Wraps startTransaction and stopTransaction with profiling related logic.\n * startProfileForTransaction is called after the call to startTransaction in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n */\nexport function startProfileForSpan(span: Span): void {\n // Start the profiler and get the profiler instance.\n let startTimestamp: number | undefined;\n if (isAutomatedPageLoadSpan(span)) {\n startTimestamp = timestampInSeconds() * 1000;\n }\n\n const profiler = startJSSelfProfile();\n\n // We failed to construct the profiler, so we skip.\n // No need to log anything as this has already been logged in startProfile.\n if (!profiler) {\n return;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`);\n }\n\n // We create \"unique\" span names to avoid concurrent spans with same names\n // from being ignored by the profiler. From here on, only this span name should be used when\n // calling the profiler methods. Note: we log the original name to the user to avoid confusion.\n const profileId = uuid4();\n\n // A couple of important things to note here:\n // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.\n // Whichever of the two (span.finish/timeout) is first to run, the profiling will be stopped and the gathered profile\n // will be processed when the original span is finished. Since onProfileHandler can be invoked multiple times in the\n // event of an error or user mistake (calling span.finish multiple times), it is important that the behavior of onProfileHandler\n // is idempotent as we do not want any timings or profiles to be overridden by the last call to onProfileHandler.\n // After the original finish method is called, the event will be reported through the integration and delegated to transport.\n let processedProfile: JSSelfProfile | null = null;\n\n getCurrentScope().setContext('profile', {\n profile_id: profileId,\n start_timestamp: startTimestamp,\n });\n\n PROFILED_ROOT_SPANS.add(span);\n setThreadAttributes(span);\n\n /**\n * Idempotent handler for profile stop\n */\n async function onProfileHandler(): Promise<void> {\n // Check if the profile exists and return it the behavior has to be idempotent as users may call span.finish multiple times.\n if (!span) {\n return;\n }\n // Satisfy the type checker, but profiler will always be defined here.\n if (!profiler) {\n return;\n }\n if (processedProfile) {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] profile for:', spanToJSON(span).description, 'already exists, returning early');\n }\n return;\n }\n\n return profiler\n .stop()\n .then((profile: JSSelfProfile): void => {\n if (maxDurationTimeoutID) {\n WINDOW.clearTimeout(maxDurationTimeoutID);\n maxDurationTimeoutID = undefined;\n }\n\n if (DEBUG_BUILD) {\n debug.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`);\n }\n\n // In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile.\n if (!profile) {\n if (DEBUG_BUILD) {\n debug.log(\n `[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`,\n 'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started',\n );\n }\n return;\n }\n\n processedProfile = profile;\n addProfileToGlobalCache(profileId, profile);\n })\n .catch(error => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] error while stopping profiler:', error);\n }\n });\n }\n\n // Enqueue a timeout to prevent profiles from running over max duration.\n let maxDurationTimeoutID: number | undefined = WINDOW.setTimeout(() => {\n if (DEBUG_BUILD) {\n debug.log('[Profiling] max profile duration elapsed, stopping profiling for:', spanToJSON(span).description);\n }\n // If the timeout exceeds, we want to stop profiling, but not finish the span\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n onProfileHandler();\n }, MAX_PROFILE_DURATION_MS);\n\n // We need to reference the original end call to avoid creating an infinite loop\n const originalEnd = span.end.bind(span);\n\n /**\n * Wraps span `end()` with profiling related logic.\n * startProfiling is called after the call to spanStart in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to spanEnd.\n */\n function profilingWrappedSpanEnd(): Span {\n if (!span) {\n return originalEnd();\n }\n // onProfileHandler should always return the same profile even if this is called multiple times.\n // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.\n void onProfileHandler().then(\n () => {\n originalEnd();\n },\n () => {\n // If onProfileHandler fails, we still want to call the original finish method.\n originalEnd();\n },\n );\n\n return span;\n }\n\n span.end = profilingWrappedSpanEnd;\n}\n"],"names":["isAutomatedPageLoadSpan","timestampInSeconds","startJSSelfProfile","DEBUG_BUILD","debug","spanToJSON","uuid4","getCurrentScope","PROFILED_ROOT_SPANS","setThreadAttributes","WINDOW","addProfileToGlobalCache","MAX_PROFILE_DURATION_MS"],"mappings":";;;;;;;AAcA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,IAAI,EAAc;AACtD;AACA,EAAE,IAAI,cAAc;AACpB,EAAE,IAAIA,6BAAuB,CAAC,IAAI,CAAC,EAAE;AACrC,IAAI,iBAAiBC,0BAAkB,EAAC,GAAI,IAAI;AAChD,EAAE;;AAEF,EAAE,MAAM,QAAA,GAAWC,wBAAkB,EAAE;;AAEvC;AACA;AACA,EAAE,IAAI,CAAC,QAAQ,EAAE;AACjB,IAAI;AACJ,EAAE;;AAEF,EAAE,IAAIC,sBAAW,EAAE;AACnB,IAAIC,aAAK,CAAC,GAAG,CAAC,CAAC,oCAAoC,EAAEC,kBAAU,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAA,CAAA;AACA,EAAA;;AAEA;AACA;AACA;AACA,EAAA,MAAA,SAAA,GAAAC,aAAA,EAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,gBAAA,GAAA,IAAA;;AAEA,EAAAC,uBAAA,EAAA,CAAA,UAAA,CAAA,SAAA,EAAA;AACA,IAAA,UAAA,EAAA,SAAA;AACA,IAAA,eAAA,EAAA,cAAA;AACA,GAAA,CAAA;;AAEA,EAAAC,yBAAA,CAAA,GAAA,CAAA,IAAA,CAAA;AACA,EAAAC,yBAAA,CAAA,IAAA,CAAA;;AAEA;AACA;AACA;AACA,EAAA,eAAA,gBAAA,GAAA;AACA;AACA,IAAA,IAAA,CAAA,IAAA,EAAA;AACA,MAAA;AACA,IAAA;AACA;AACA,IAAA,IAAA,CAAA,QAAA,EAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA,IAAA,gBAAA,EAAA;AACA,MAAA,IAAAN,sBAAA,EAAA;AACA,QAAAC,aAAA,CAAA,GAAA,CAAA,0BAAA,EAAAC,kBAAA,CAAA,IAAA,CAAA,CAAA,WAAA,EAAA,iCAAA,CAAA;AACA,MAAA;AACA,MAAA;AACA,IAAA;;AAEA,IAAA,OAAA;AACA,OAAA,IAAA;AACA,OAAA,IAAA,CAAA,CAAA,OAAA,KAAA;AACA,QAAA,IAAA,oBAAA,EAAA;AACA,UAAAK,cAAA,CAAA,YAAA,CAAA,oBAAA,CAAA;AACA,UAAA,oBAAA,GAAA,SAAA;AACA,QAAA;;AAEA,QAAA,IAAAP,sBAAA,EAAA;AACA,UAAAC,aAAA,CAAA,GAAA,CAAA,CAAA,uCAAA,EAAAC,kBAAA,CAAA,IAAA,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA;AACA,QAAA;;AAEA;AACA,QAAA,IAAA,CAAA,OAAA,EAAA;AACA,UAAA,IAAAF,sBAAA,EAAA;AACA,YAAAC,aAAA,CAAA,GAAA;AACA,cAAA,CAAA,gDAAA,EAAAC,kBAAA,CAAA,IAAA,CAAA,CAAA,WAAA,CAAA,CAAA;AACA,cAAA,8GAAA;AACA,aAAA;AACA,UAAA;AACA,UAAA;AACA,QAAA;;AAEA,QAAA,gBAAA,GAAA,OAAA;AACA,QAAAM,6BAAA,CAAA,SAAA,EAAA,OAAA,CAAA;AACA,MAAA,CAAA;AACA,OAAA,KAAA,CAAA,KAAA,IAAA;AACA,QAAA,IAAAR,sBAAA,EAAA;AACA,UAAAC,aAAA,CAAA,GAAA,CAAA,4CAAA,EAAA,KAAA,CAAA;AACA,QAAA;AACA,MAAA,CAAA,CAAA;AACA,EAAA;;AAEA;AACA,EAAA,IAAA,oBAAA,GAAAM,cAAA,CAAA,UAAA,CAAA,MAAA;AACA,IAAA,IAAAP,sBAAA,EAAA;AACA,MAAAC,aAAA,CAAA,GAAA,CAAA,mEAAA,EAAAC,kBAAA,CAAA,IAAA,CAAA,CAAA,WAAA,CAAA;AACA,IAAA;AACA;AACA;AACA,IAAA,gBAAA,EAAA;AACA,EAAA,CAAA,EAAAO,6BAAA,CAAA;;AAEA;AACA,EAAA,MAAA,WAAA,GAAA,IAAA,CAAA,GAAA,CAAA,IAAA,CAAA,IAAA,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAA,SAAA,uBAAA,GAAA;AACA,IAAA,IAAA,CAAA,IAAA,EAAA;AACA,MAAA,OAAA,WAAA,EAAA;AACA,IAAA;AACA;AACA;AACA,IAAA,KAAA,gBAAA,EAAA,CAAA,IAAA;AACA,MAAA,MAAA;AACA,QAAA,WAAA,EAAA;AACA,MAAA,CAAA;AACA,MAAA,MAAA;AACA;AACA,QAAA,WAAA,EAAA;AACA,MAAA,CAAA;AACA,KAAA;;AAEA,IAAA,OAAA,IAAA;AACA,EAAA;;AAEA,EAAA,IAAA,CAAA,GAAA,GAAA,uBAAA;AACA;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const browser = require('@sentry/core/browser');
|
|
4
4
|
const debugBuild = require('../debug-build.js');
|
|
5
5
|
const helpers = require('../helpers.js');
|
|
6
6
|
|
|
7
7
|
const MS_TO_NS = 1e6;
|
|
8
8
|
|
|
9
9
|
// Checking if we are in Main or Worker thread: `self` (not `window`) is the `globalThis` in Web Workers and `importScripts` are only available in Web Workers
|
|
10
|
-
const isMainThread = 'window' in
|
|
10
|
+
const isMainThread = 'window' in browser.GLOBAL_OBJ && browser.GLOBAL_OBJ.window === browser.GLOBAL_OBJ && typeof importScripts === 'undefined';
|
|
11
11
|
|
|
12
12
|
// Setting ID to 0 as we cannot get an ID from Web Workers
|
|
13
13
|
const PROFILER_THREAD_ID_STRING = String(0);
|
|
@@ -76,7 +76,7 @@ function getTraceId(event) {
|
|
|
76
76
|
// warn users that this is happening if they enable debug flag
|
|
77
77
|
if (typeof traceId === 'string' && traceId.length !== 32) {
|
|
78
78
|
if (debugBuild.DEBUG_BUILD) {
|
|
79
|
-
|
|
79
|
+
browser.debug.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
if (typeof traceId !== 'string') {
|
|
@@ -122,8 +122,8 @@ function createProfilePayload(
|
|
|
122
122
|
? start_timestamp
|
|
123
123
|
: typeof event.start_timestamp === 'number'
|
|
124
124
|
? event.start_timestamp * 1000
|
|
125
|
-
:
|
|
126
|
-
const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 :
|
|
125
|
+
: browser.timestampInSeconds() * 1000;
|
|
126
|
+
const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : browser.timestampInSeconds() * 1000;
|
|
127
127
|
|
|
128
128
|
const profile = {
|
|
129
129
|
event_id: profile_id,
|
|
@@ -131,7 +131,7 @@ function createProfilePayload(
|
|
|
131
131
|
platform: 'javascript',
|
|
132
132
|
version: '1',
|
|
133
133
|
release: event.release || '',
|
|
134
|
-
environment: event.environment ||
|
|
134
|
+
environment: event.environment || browser.DEFAULT_ENVIRONMENT,
|
|
135
135
|
runtime: {
|
|
136
136
|
name: 'javascript',
|
|
137
137
|
version: helpers.WINDOW.navigator.userAgent,
|
|
@@ -155,7 +155,7 @@ function createProfilePayload(
|
|
|
155
155
|
transactions: [
|
|
156
156
|
{
|
|
157
157
|
name: event.transaction || '',
|
|
158
|
-
id: event.event_id ||
|
|
158
|
+
id: event.event_id || browser.uuid4(),
|
|
159
159
|
trace_id: traceId,
|
|
160
160
|
active_thread_id: PROFILER_THREAD_ID_STRING,
|
|
161
161
|
relative_start_ns: '0',
|
|
@@ -188,12 +188,12 @@ function createProfileChunkPayload(
|
|
|
188
188
|
const sdk = client.getSdkMetadata?.()?.sdk;
|
|
189
189
|
|
|
190
190
|
return {
|
|
191
|
-
chunk_id:
|
|
191
|
+
chunk_id: browser.uuid4(),
|
|
192
192
|
client_sdk: {
|
|
193
193
|
name: sdk?.name ?? 'sentry.javascript.browser',
|
|
194
194
|
version: sdk?.version ?? '0.0.0',
|
|
195
195
|
},
|
|
196
|
-
profiler_id: profilerId ||
|
|
196
|
+
profiler_id: profilerId || browser.uuid4(),
|
|
197
197
|
platform: 'javascript',
|
|
198
198
|
version: '2',
|
|
199
199
|
release: options.release ?? '',
|
|
@@ -292,7 +292,7 @@ function convertToContinuousProfile(input
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
// Align timestamps to SDK time origin to match span/event timelines
|
|
295
|
-
const perfOrigin =
|
|
295
|
+
const perfOrigin = browser.browserPerformanceTimeOrigin();
|
|
296
296
|
const origin = typeof performance.timeOrigin === 'number' ? performance.timeOrigin : perfOrigin || 0;
|
|
297
297
|
const adjustForOriginChange = origin - (perfOrigin || origin);
|
|
298
298
|
|
|
@@ -326,7 +326,7 @@ function convertToContinuousProfile(input
|
|
|
326
326
|
*
|
|
327
327
|
*/
|
|
328
328
|
function isAutomatedPageLoadSpan(span) {
|
|
329
|
-
return
|
|
329
|
+
return browser.spanToJSON(span).op === 'pageload';
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
/**
|
|
@@ -358,7 +358,7 @@ function convertJSSelfProfileToSampledFormat(input) {
|
|
|
358
358
|
// when that happens, we need to ensure we are correcting the profile timings so the two timelines stay in sync.
|
|
359
359
|
// Since JS self profiling time origin is always initialized to performance.timeOrigin, we need to adjust for
|
|
360
360
|
// the drift between the SDK selected value and our profile time origin.
|
|
361
|
-
const perfOrigin =
|
|
361
|
+
const perfOrigin = browser.browserPerformanceTimeOrigin();
|
|
362
362
|
const origin = typeof performance.timeOrigin === 'number' ? performance.timeOrigin : perfOrigin || 0;
|
|
363
363
|
const adjustForOriginChange = origin - (perfOrigin || origin);
|
|
364
364
|
|
|
@@ -442,7 +442,7 @@ function addProfilesToEnvelope(envelope, profiles) {
|
|
|
442
442
|
function findProfiledTransactionsFromEnvelope(envelope) {
|
|
443
443
|
const events = [];
|
|
444
444
|
|
|
445
|
-
|
|
445
|
+
browser.forEachEnvelopeItem(envelope, (item, type) => {
|
|
446
446
|
if (type !== 'transaction') {
|
|
447
447
|
return;
|
|
448
448
|
}
|
|
@@ -463,7 +463,7 @@ function findProfiledTransactionsFromEnvelope(envelope) {
|
|
|
463
463
|
* Applies debug meta data to an event from a list of paths to resources (sourcemaps)
|
|
464
464
|
*/
|
|
465
465
|
function applyDebugMetadata(resource_paths) {
|
|
466
|
-
const client =
|
|
466
|
+
const client = browser.getClient();
|
|
467
467
|
const options = client?.getOptions();
|
|
468
468
|
const stackParser = options?.stackParser;
|
|
469
469
|
|
|
@@ -471,7 +471,7 @@ function applyDebugMetadata(resource_paths) {
|
|
|
471
471
|
return [];
|
|
472
472
|
}
|
|
473
473
|
|
|
474
|
-
return
|
|
474
|
+
return browser.getDebugImagesForResources(stackParser, resource_paths);
|
|
475
475
|
}
|
|
476
476
|
|
|
477
477
|
/**
|
|
@@ -481,7 +481,7 @@ function isValidSampleRate(rate) {
|
|
|
481
481
|
// we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck
|
|
482
482
|
if ((typeof rate !== 'number' && typeof rate !== 'boolean') || (typeof rate === 'number' && isNaN(rate))) {
|
|
483
483
|
debugBuild.DEBUG_BUILD &&
|
|
484
|
-
|
|
484
|
+
browser.debug.warn(
|
|
485
485
|
`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(
|
|
486
486
|
rate,
|
|
487
487
|
)} of type ${JSON.stringify(typeof rate)}.`,
|
|
@@ -496,7 +496,7 @@ function isValidSampleRate(rate) {
|
|
|
496
496
|
|
|
497
497
|
// in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false
|
|
498
498
|
if (rate < 0 || rate > 1) {
|
|
499
|
-
debugBuild.DEBUG_BUILD &&
|
|
499
|
+
debugBuild.DEBUG_BUILD && browser.debug.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${rate}.`);
|
|
500
500
|
return false;
|
|
501
501
|
}
|
|
502
502
|
return true;
|
|
@@ -508,14 +508,14 @@ function isValidProfile(profile) {
|
|
|
508
508
|
// Log a warning if the profile has less than 2 samples so users can know why
|
|
509
509
|
// they are not seeing any profiling data and we cant avoid the back and forth
|
|
510
510
|
// of asking them to provide us with a dump of the profile data.
|
|
511
|
-
|
|
511
|
+
browser.debug.log('[Profiling] Discarding profile because it contains less than 2 samples');
|
|
512
512
|
}
|
|
513
513
|
return false;
|
|
514
514
|
}
|
|
515
515
|
|
|
516
516
|
if (!profile.frames.length) {
|
|
517
517
|
if (debugBuild.DEBUG_BUILD) {
|
|
518
|
-
|
|
518
|
+
browser.debug.log('[Profiling] Discarding profile because it contains no frames');
|
|
519
519
|
}
|
|
520
520
|
return false;
|
|
521
521
|
}
|
|
@@ -545,7 +545,7 @@ function startJSSelfProfile() {
|
|
|
545
545
|
|
|
546
546
|
if (!isJSProfilerSupported(JSProfilerConstructor)) {
|
|
547
547
|
if (debugBuild.DEBUG_BUILD) {
|
|
548
|
-
|
|
548
|
+
browser.debug.log('[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.');
|
|
549
549
|
}
|
|
550
550
|
return;
|
|
551
551
|
}
|
|
@@ -562,10 +562,10 @@ function startJSSelfProfile() {
|
|
|
562
562
|
return new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples });
|
|
563
563
|
} catch (_e) {
|
|
564
564
|
if (debugBuild.DEBUG_BUILD) {
|
|
565
|
-
|
|
565
|
+
browser.debug.log(
|
|
566
566
|
"[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.",
|
|
567
567
|
);
|
|
568
|
-
|
|
568
|
+
browser.debug.log('[Profiling] Disabling profiling for current user session.');
|
|
569
569
|
}
|
|
570
570
|
PROFILING_CONSTRUCTOR_FAILED = true;
|
|
571
571
|
}
|
|
@@ -580,20 +580,20 @@ function shouldProfileSpanLegacy(span) {
|
|
|
580
580
|
// If constructor failed once, it will always fail, so we can early return.
|
|
581
581
|
if (PROFILING_CONSTRUCTOR_FAILED) {
|
|
582
582
|
if (debugBuild.DEBUG_BUILD) {
|
|
583
|
-
|
|
583
|
+
browser.debug.log('[Profiling] Profiling has been disabled for the duration of the current user session.');
|
|
584
584
|
}
|
|
585
585
|
return false;
|
|
586
586
|
}
|
|
587
587
|
|
|
588
588
|
if (!span.isRecording()) {
|
|
589
|
-
debugBuild.DEBUG_BUILD &&
|
|
589
|
+
debugBuild.DEBUG_BUILD && browser.debug.log('[Profiling] Discarding profile because root span was not sampled.');
|
|
590
590
|
return false;
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
-
const client =
|
|
593
|
+
const client = browser.getClient();
|
|
594
594
|
const options = client?.getOptions();
|
|
595
595
|
if (!options) {
|
|
596
|
-
debugBuild.DEBUG_BUILD &&
|
|
596
|
+
debugBuild.DEBUG_BUILD && browser.debug.log('[Profiling] Profiling disabled, no options found.');
|
|
597
597
|
return false;
|
|
598
598
|
}
|
|
599
599
|
|
|
@@ -605,14 +605,14 @@ function shouldProfileSpanLegacy(span) {
|
|
|
605
605
|
// Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The
|
|
606
606
|
// only valid values are booleans or numbers between 0 and 1.)
|
|
607
607
|
if (!isValidSampleRate(profilesSampleRate)) {
|
|
608
|
-
debugBuild.DEBUG_BUILD &&
|
|
608
|
+
debugBuild.DEBUG_BUILD && browser.debug.warn('[Profiling] Discarding profile because of invalid sample rate.');
|
|
609
609
|
return false;
|
|
610
610
|
}
|
|
611
611
|
|
|
612
612
|
// if the function returned 0 (or false), or if `profileSampleRate` is 0, it's a sign the profile should be dropped
|
|
613
613
|
if (!profilesSampleRate) {
|
|
614
614
|
debugBuild.DEBUG_BUILD &&
|
|
615
|
-
|
|
615
|
+
browser.debug.log(
|
|
616
616
|
'[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0',
|
|
617
617
|
);
|
|
618
618
|
return false;
|
|
@@ -624,7 +624,7 @@ function shouldProfileSpanLegacy(span) {
|
|
|
624
624
|
// Check if we should sample this profile
|
|
625
625
|
if (!sampled) {
|
|
626
626
|
debugBuild.DEBUG_BUILD &&
|
|
627
|
-
|
|
627
|
+
browser.debug.log(
|
|
628
628
|
`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(
|
|
629
629
|
profilesSampleRate,
|
|
630
630
|
)})`,
|
|
@@ -642,7 +642,7 @@ function shouldProfileSession(options) {
|
|
|
642
642
|
// If constructor failed once, it will always fail, so we can early return.
|
|
643
643
|
if (PROFILING_CONSTRUCTOR_FAILED) {
|
|
644
644
|
if (debugBuild.DEBUG_BUILD) {
|
|
645
|
-
|
|
645
|
+
browser.debug.log(
|
|
646
646
|
'[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started.',
|
|
647
647
|
);
|
|
648
648
|
}
|
|
@@ -650,7 +650,7 @@ function shouldProfileSession(options) {
|
|
|
650
650
|
}
|
|
651
651
|
|
|
652
652
|
if (options.profileLifecycle !== 'trace' && options.profileLifecycle !== 'manual') {
|
|
653
|
-
debugBuild.DEBUG_BUILD &&
|
|
653
|
+
debugBuild.DEBUG_BUILD && browser.debug.warn('[Profiling] Session not sampled. Invalid `profileLifecycle` option.');
|
|
654
654
|
return false;
|
|
655
655
|
}
|
|
656
656
|
|
|
@@ -658,13 +658,13 @@ function shouldProfileSession(options) {
|
|
|
658
658
|
const profileSessionSampleRate = options.profileSessionSampleRate;
|
|
659
659
|
|
|
660
660
|
if (!isValidSampleRate(profileSessionSampleRate)) {
|
|
661
|
-
debugBuild.DEBUG_BUILD &&
|
|
661
|
+
debugBuild.DEBUG_BUILD && browser.debug.warn('[Profiling] Discarding profile because of invalid profileSessionSampleRate.');
|
|
662
662
|
return false;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
665
|
if (!profileSessionSampleRate) {
|
|
666
666
|
debugBuild.DEBUG_BUILD &&
|
|
667
|
-
|
|
667
|
+
browser.debug.log('[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0');
|
|
668
668
|
return false;
|
|
669
669
|
}
|
|
670
670
|
|
|
@@ -732,50 +732,20 @@ function addProfileToGlobalCache(profile_id, profile) {
|
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
|
|
735
|
-
|
|
736
|
-
* Attaches the profiled thread information to the event's trace context.
|
|
737
|
-
*/
|
|
738
|
-
function attachProfiledThreadToEvent(event) {
|
|
739
|
-
if (!event?.contexts?.profile) {
|
|
740
|
-
return event;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
if (!event.contexts) {
|
|
744
|
-
return event;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
// Only mutate the trace context when it already has a trace_id — that
|
|
748
|
-
// guarantees `applySpanToEvent` has already run, and we are not creating a partial trace context from scratch.
|
|
749
|
-
if (event.contexts.trace?.trace_id) {
|
|
750
|
-
event.contexts.trace = {
|
|
751
|
-
...event.contexts.trace,
|
|
752
|
-
data: {
|
|
753
|
-
...(event.contexts.trace.data ?? {}),
|
|
754
|
-
['thread.id']: PROFILER_THREAD_ID_STRING,
|
|
755
|
-
['thread.name']: PROFILER_THREAD_NAME,
|
|
756
|
-
},
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
// Attach thread info to individual spans so that spans can be associated with the profiled thread on the UI even if contexts are missing.
|
|
761
|
-
event.spans?.forEach(span => {
|
|
762
|
-
span.data = {
|
|
763
|
-
...(span.data || {}),
|
|
764
|
-
['thread.id']: PROFILER_THREAD_ID_STRING,
|
|
765
|
-
['thread.name']: PROFILER_THREAD_NAME,
|
|
766
|
-
};
|
|
767
|
-
});
|
|
735
|
+
const PROFILED_ROOT_SPANS = new WeakSet();
|
|
768
736
|
|
|
769
|
-
|
|
737
|
+
function setThreadAttributes(span) {
|
|
738
|
+
span.setAttribute('thread.id', PROFILER_THREAD_ID_STRING);
|
|
739
|
+
span.setAttribute('thread.name', PROFILER_THREAD_NAME);
|
|
770
740
|
}
|
|
771
741
|
|
|
772
742
|
exports.MAX_PROFILE_DURATION_MS = MAX_PROFILE_DURATION_MS;
|
|
743
|
+
exports.PROFILED_ROOT_SPANS = PROFILED_ROOT_SPANS;
|
|
773
744
|
exports.PROFILER_THREAD_ID_STRING = PROFILER_THREAD_ID_STRING;
|
|
774
745
|
exports.PROFILER_THREAD_NAME = PROFILER_THREAD_NAME;
|
|
775
746
|
exports.addProfileToGlobalCache = addProfileToGlobalCache;
|
|
776
747
|
exports.addProfilesToEnvelope = addProfilesToEnvelope;
|
|
777
748
|
exports.applyDebugMetadata = applyDebugMetadata;
|
|
778
|
-
exports.attachProfiledThreadToEvent = attachProfiledThreadToEvent;
|
|
779
749
|
exports.convertJSSelfProfileToSampledFormat = convertJSSelfProfileToSampledFormat;
|
|
780
750
|
exports.createProfileChunkPayload = createProfileChunkPayload;
|
|
781
751
|
exports.createProfilePayload = createProfilePayload;
|
|
@@ -786,6 +756,7 @@ exports.getActiveProfilesCount = getActiveProfilesCount;
|
|
|
786
756
|
exports.hasLegacyProfiling = hasLegacyProfiling;
|
|
787
757
|
exports.isAutomatedPageLoadSpan = isAutomatedPageLoadSpan;
|
|
788
758
|
exports.isValidSampleRate = isValidSampleRate;
|
|
759
|
+
exports.setThreadAttributes = setThreadAttributes;
|
|
789
760
|
exports.shouldProfileSession = shouldProfileSession;
|
|
790
761
|
exports.shouldProfileSpanLegacy = shouldProfileSpanLegacy;
|
|
791
762
|
exports.startJSSelfProfile = startJSSelfProfile;
|