@sentry/browser 10.22.0 → 10.25.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/{client.js → dev/client.js} +16 -3
- package/build/npm/cjs/dev/client.js.map +1 -0
- package/build/npm/cjs/dev/debug-build.js.map +1 -0
- package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
- package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
- package/build/npm/cjs/dev/helpers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/{integrations → dev/integrations}/globalhandlers.js +6 -1
- package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/{integrations → dev/integrations}/webWorker.js +119 -17
- package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
- package/build/npm/cjs/dev/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
- package/build/npm/cjs/dev/report-dialog.js.map +1 -0
- package/build/npm/cjs/dev/sdk.js +133 -0
- package/build/npm/cjs/dev/sdk.js.map +1 -0
- package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
- package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/{tracing → dev/tracing}/linkedTraces.js +1 -0
- package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/dev/tracing/request.js.map +1 -0
- package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
- package/build/npm/cjs/{transports → dev/transports}/fetch.js +7 -1
- package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
- package/build/npm/cjs/dev/transports/offline.js.map +1 -0
- package/build/npm/cjs/dev/userfeedback.js.map +1 -0
- package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/cjs/prod/client.js +125 -0
- package/build/npm/cjs/prod/client.js.map +1 -0
- package/build/npm/cjs/prod/debug-build.js +11 -0
- package/build/npm/cjs/prod/debug-build.js.map +1 -0
- package/build/npm/cjs/prod/diagnose-sdk.js +51 -0
- package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/cjs/prod/eventbuilder.js +397 -0
- package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
- package/build/npm/cjs/prod/feedbackAsync.js +15 -0
- package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
- package/build/npm/cjs/prod/feedbackSync.js +12 -0
- package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
- package/build/npm/cjs/prod/helpers.js +185 -0
- package/build/npm/cjs/prod/helpers.js.map +1 -0
- package/build/npm/cjs/prod/index.js +179 -0
- package/build/npm/cjs/prod/index.js.map +1 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js +341 -0
- package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js +259 -0
- package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/browsersession.js +44 -0
- package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/cjs/prod/integrations/contextlines.js +89 -0
- package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +29 -0
- package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +55 -0
- package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +38 -0
- package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +48 -0
- package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +74 -0
- package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js +210 -0
- package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js +180 -0
- package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpclient.js +395 -0
- package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js +35 -0
- package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js +39 -0
- package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js +85 -0
- package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/cjs/prod/integrations/spotlight.js +85 -0
- package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/prod/integrations/webWorker.js +251 -0
- package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/cjs/prod/profiling/integration.js +150 -0
- package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
- package/build/npm/cjs/prod/profiling/lifecycleMode/traceLifecycleProfiler.js +343 -0
- package/build/npm/cjs/prod/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js +144 -0
- package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/cjs/prod/profiling/utils.js +786 -0
- package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
- package/build/npm/cjs/prod/report-dialog.js +68 -0
- package/build/npm/cjs/prod/report-dialog.js.map +1 -0
- package/build/npm/cjs/{sdk.js → prod/sdk.js} +5 -2
- package/build/npm/cjs/prod/sdk.js.map +1 -0
- package/build/npm/cjs/prod/stack-parsers.js +202 -0
- package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js +46 -0
- package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +577 -0
- package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js +227 -0
- package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js +18 -0
- package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/cjs/prod/tracing/request.js +342 -0
- package/build/npm/cjs/prod/tracing/request.js.map +1 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js +68 -0
- package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/cjs/prod/tracing/utils.js +54 -0
- package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
- package/build/npm/cjs/prod/transports/fetch.js +71 -0
- package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
- package/build/npm/cjs/prod/transports/offline.js +168 -0
- package/build/npm/cjs/prod/transports/offline.js.map +1 -0
- package/build/npm/cjs/prod/userfeedback.js +42 -0
- package/build/npm/cjs/prod/userfeedback.js.map +1 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js +59 -0
- package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +106 -0
- package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/{client.js → dev/client.js} +16 -3
- package/build/npm/esm/dev/client.js.map +1 -0
- package/build/npm/esm/dev/debug-build.js.map +1 -0
- package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/dev/eventbuilder.js.map +1 -0
- package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
- package/build/npm/esm/dev/feedbackSync.js.map +1 -0
- package/build/npm/esm/dev/helpers.js.map +1 -0
- package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/{integrations → dev/integrations}/globalhandlers.js +5 -2
- package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/dev/integrations/webWorker.js +247 -0
- package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/dev/package.json +1 -0
- package/build/npm/esm/dev/profiling/integration.js.map +1 -0
- package/build/npm/esm/dev/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/dev/profiling/utils.js.map +1 -0
- package/build/npm/esm/dev/report-dialog.js.map +1 -0
- package/build/npm/esm/dev/sdk.js +128 -0
- package/build/npm/esm/dev/sdk.js.map +1 -0
- package/build/npm/esm/dev/stack-parsers.js.map +1 -0
- package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/{tracing → dev/tracing}/linkedTraces.js +1 -0
- package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/dev/tracing/request.js.map +1 -0
- package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/dev/tracing/utils.js.map +1 -0
- package/build/npm/esm/{transports → dev/transports}/fetch.js +8 -2
- package/build/npm/esm/dev/transports/fetch.js.map +1 -0
- package/build/npm/esm/dev/transports/offline.js.map +1 -0
- package/build/npm/esm/dev/userfeedback.js.map +1 -0
- package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/esm/prod/client.js +122 -0
- package/build/npm/esm/prod/client.js.map +1 -0
- package/build/npm/esm/prod/debug-build.js +9 -0
- package/build/npm/esm/prod/debug-build.js.map +1 -0
- package/build/npm/esm/prod/diagnose-sdk.js +49 -0
- package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
- package/build/npm/esm/prod/eventbuilder.js +390 -0
- package/build/npm/esm/prod/eventbuilder.js.map +1 -0
- package/build/npm/esm/prod/feedbackAsync.js +13 -0
- package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
- package/build/npm/esm/prod/feedbackSync.js +10 -0
- package/build/npm/esm/prod/feedbackSync.js.map +1 -0
- package/build/npm/esm/prod/helpers.js +179 -0
- package/build/npm/esm/prod/helpers.js.map +1 -0
- package/build/npm/esm/prod/index.js +40 -0
- package/build/npm/esm/prod/index.js.map +1 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js +339 -0
- package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js +257 -0
- package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/browsersession.js +42 -0
- package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
- package/build/npm/esm/prod/integrations/contextlines.js +86 -0
- package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +27 -0
- package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +52 -0
- package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +35 -0
- package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +46 -0
- package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +72 -0
- package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js +206 -0
- package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js +175 -0
- package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpclient.js +393 -0
- package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
- package/build/npm/esm/prod/integrations/httpcontext.js +33 -0
- package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
- package/build/npm/esm/prod/integrations/linkederrors.js +37 -0
- package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js +83 -0
- package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
- package/build/npm/esm/prod/integrations/spotlight.js +81 -0
- package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/prod/integrations/webWorker.js +247 -0
- package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
- package/build/npm/esm/prod/package.json +1 -0
- package/build/npm/esm/prod/profiling/integration.js +148 -0
- package/build/npm/esm/prod/profiling/integration.js.map +1 -0
- package/build/npm/esm/prod/profiling/lifecycleMode/traceLifecycleProfiler.js +341 -0
- package/build/npm/esm/prod/profiling/lifecycleMode/traceLifecycleProfiler.js.map +1 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js +142 -0
- package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
- package/build/npm/esm/prod/profiling/utils.js +763 -0
- package/build/npm/esm/prod/profiling/utils.js.map +1 -0
- package/build/npm/esm/prod/report-dialog.js +66 -0
- package/build/npm/esm/prod/report-dialog.js.map +1 -0
- package/build/npm/esm/{sdk.js → prod/sdk.js} +5 -2
- package/build/npm/esm/prod/sdk.js.map +1 -0
- package/build/npm/esm/prod/stack-parsers.js +194 -0
- package/build/npm/esm/prod/stack-parsers.js.map +1 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js +44 -0
- package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js +571 -0
- package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js +218 -0
- package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js +16 -0
- package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/prod/tracing/request.js +338 -0
- package/build/npm/esm/prod/tracing/request.js.map +1 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js +66 -0
- package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
- package/build/npm/esm/prod/tracing/utils.js +49 -0
- package/build/npm/esm/prod/tracing/utils.js.map +1 -0
- package/build/npm/esm/prod/transports/fetch.js +69 -0
- package/build/npm/esm/prod/transports/fetch.js.map +1 -0
- package/build/npm/esm/prod/transports/offline.js +162 -0
- package/build/npm/esm/prod/transports/offline.js.map +1 -0
- package/build/npm/esm/prod/userfeedback.js +40 -0
- package/build/npm/esm/prod/userfeedback.js.map +1 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js +57 -0
- package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js +104 -0
- package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
- package/build/npm/types/client.d.ts +11 -0
- package/build/npm/types/client.d.ts.map +1 -1
- package/build/npm/types/integrations/globalhandlers.d.ts +12 -0
- package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
- package/build/npm/types/integrations/webWorker.d.ts +12 -0
- package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
- package/build/npm/types/sdk.d.ts.map +1 -1
- package/build/npm/types/transports/fetch.d.ts.map +1 -1
- package/build/npm/types/transports/types.d.ts +0 -4
- package/build/npm/types/transports/types.d.ts.map +1 -1
- package/build/npm/types-ts3.8/client.d.ts +11 -0
- package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +12 -0
- package/build/npm/types-ts3.8/integrations/webWorker.d.ts +12 -0
- package/build/npm/types-ts3.8/transports/types.d.ts +0 -4
- package/package.json +22 -17
- package/build/npm/cjs/client.js.map +0 -1
- package/build/npm/cjs/debug-build.js.map +0 -1
- package/build/npm/cjs/diagnose-sdk.js.map +0 -1
- package/build/npm/cjs/eventbuilder.js.map +0 -1
- package/build/npm/cjs/feedbackAsync.js.map +0 -1
- package/build/npm/cjs/feedbackSync.js.map +0 -1
- package/build/npm/cjs/helpers.js.map +0 -1
- package/build/npm/cjs/integrations/breadcrumbs.js.map +0 -1
- package/build/npm/cjs/integrations/browserapierrors.js.map +0 -1
- package/build/npm/cjs/integrations/browsersession.js.map +0 -1
- package/build/npm/cjs/integrations/contextlines.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/statsig/integration.js.map +0 -1
- package/build/npm/cjs/integrations/featureFlags/unleash/integration.js.map +0 -1
- package/build/npm/cjs/integrations/globalhandlers.js.map +0 -1
- package/build/npm/cjs/integrations/graphqlClient.js.map +0 -1
- package/build/npm/cjs/integrations/httpclient.js.map +0 -1
- package/build/npm/cjs/integrations/httpcontext.js.map +0 -1
- package/build/npm/cjs/integrations/linkederrors.js.map +0 -1
- package/build/npm/cjs/integrations/reportingobserver.js.map +0 -1
- package/build/npm/cjs/integrations/spotlight.js.map +0 -1
- package/build/npm/cjs/integrations/webWorker.js.map +0 -1
- package/build/npm/cjs/profiling/integration.js.map +0 -1
- package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
- package/build/npm/cjs/profiling/startProfileForSpan.js.map +0 -1
- package/build/npm/cjs/profiling/utils.js.map +0 -1
- package/build/npm/cjs/report-dialog.js.map +0 -1
- package/build/npm/cjs/sdk.js.map +0 -1
- package/build/npm/cjs/stack-parsers.js.map +0 -1
- package/build/npm/cjs/tracing/backgroundtab.js.map +0 -1
- package/build/npm/cjs/tracing/browserTracingIntegration.js.map +0 -1
- package/build/npm/cjs/tracing/linkedTraces.js.map +0 -1
- package/build/npm/cjs/tracing/reportPageLoaded.js.map +0 -1
- package/build/npm/cjs/tracing/request.js.map +0 -1
- package/build/npm/cjs/tracing/setActiveSpan.js.map +0 -1
- package/build/npm/cjs/tracing/utils.js.map +0 -1
- package/build/npm/cjs/transports/fetch.js.map +0 -1
- package/build/npm/cjs/transports/offline.js.map +0 -1
- package/build/npm/cjs/userfeedback.js.map +0 -1
- package/build/npm/cjs/utils/detectBrowserExtension.js.map +0 -1
- package/build/npm/cjs/utils/lazyLoadIntegration.js.map +0 -1
- package/build/npm/esm/client.js.map +0 -1
- package/build/npm/esm/debug-build.js.map +0 -1
- package/build/npm/esm/diagnose-sdk.js.map +0 -1
- package/build/npm/esm/eventbuilder.js.map +0 -1
- package/build/npm/esm/feedbackAsync.js.map +0 -1
- package/build/npm/esm/feedbackSync.js.map +0 -1
- package/build/npm/esm/helpers.js.map +0 -1
- package/build/npm/esm/integrations/breadcrumbs.js.map +0 -1
- package/build/npm/esm/integrations/browserapierrors.js.map +0 -1
- package/build/npm/esm/integrations/browsersession.js.map +0 -1
- package/build/npm/esm/integrations/contextlines.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/growthbook/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/openfeature/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/statsig/integration.js.map +0 -1
- package/build/npm/esm/integrations/featureFlags/unleash/integration.js.map +0 -1
- package/build/npm/esm/integrations/globalhandlers.js.map +0 -1
- package/build/npm/esm/integrations/graphqlClient.js.map +0 -1
- package/build/npm/esm/integrations/httpclient.js.map +0 -1
- package/build/npm/esm/integrations/httpcontext.js.map +0 -1
- package/build/npm/esm/integrations/linkederrors.js.map +0 -1
- package/build/npm/esm/integrations/reportingobserver.js.map +0 -1
- package/build/npm/esm/integrations/spotlight.js.map +0 -1
- package/build/npm/esm/integrations/webWorker.js +0 -145
- package/build/npm/esm/integrations/webWorker.js.map +0 -1
- package/build/npm/esm/package.json +0 -1
- package/build/npm/esm/profiling/integration.js.map +0 -1
- package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
- package/build/npm/esm/profiling/startProfileForSpan.js.map +0 -1
- package/build/npm/esm/profiling/utils.js.map +0 -1
- package/build/npm/esm/report-dialog.js.map +0 -1
- package/build/npm/esm/sdk.js.map +0 -1
- package/build/npm/esm/stack-parsers.js.map +0 -1
- package/build/npm/esm/tracing/backgroundtab.js.map +0 -1
- package/build/npm/esm/tracing/browserTracingIntegration.js.map +0 -1
- package/build/npm/esm/tracing/linkedTraces.js.map +0 -1
- package/build/npm/esm/tracing/reportPageLoaded.js.map +0 -1
- package/build/npm/esm/tracing/request.js.map +0 -1
- package/build/npm/esm/tracing/setActiveSpan.js.map +0 -1
- package/build/npm/esm/tracing/utils.js.map +0 -1
- package/build/npm/esm/transports/fetch.js.map +0 -1
- package/build/npm/esm/transports/offline.js.map +0 -1
- package/build/npm/esm/userfeedback.js.map +0 -1
- package/build/npm/esm/utils/detectBrowserExtension.js.map +0 -1
- package/build/npm/esm/utils/lazyLoadIntegration.js.map +0 -1
- /package/build/npm/cjs/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/npm/cjs/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
- /package/build/npm/cjs/{eventbuilder.js → dev/eventbuilder.js} +0 -0
- /package/build/npm/cjs/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
- /package/build/npm/cjs/{feedbackSync.js → dev/feedbackSync.js} +0 -0
- /package/build/npm/cjs/{helpers.js → dev/helpers.js} +0 -0
- /package/build/npm/cjs/{index.js → dev/index.js} +0 -0
- /package/build/npm/cjs/{index.js.map → dev/index.js.map} +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/breadcrumbs.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/browserapierrors.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/browsersession.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/contextlines.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/graphqlClient.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/httpclient.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/httpcontext.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/linkederrors.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/reportingobserver.js +0 -0
- /package/build/npm/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/integration.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/lifecycleMode/traceLifecycleProfiler.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
- /package/build/npm/cjs/{profiling → dev/profiling}/utils.js +0 -0
- /package/build/npm/cjs/{report-dialog.js → dev/report-dialog.js} +0 -0
- /package/build/npm/cjs/{stack-parsers.js → dev/stack-parsers.js} +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/backgroundtab.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/request.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/setActiveSpan.js +0 -0
- /package/build/npm/cjs/{tracing → dev/tracing}/utils.js +0 -0
- /package/build/npm/cjs/{transports → dev/transports}/offline.js +0 -0
- /package/build/npm/cjs/{userfeedback.js → dev/userfeedback.js} +0 -0
- /package/build/npm/cjs/{utils → dev/utils}/detectBrowserExtension.js +0 -0
- /package/build/npm/cjs/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
- /package/build/npm/esm/{debug-build.js → dev/debug-build.js} +0 -0
- /package/build/npm/esm/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
- /package/build/npm/esm/{eventbuilder.js → dev/eventbuilder.js} +0 -0
- /package/build/npm/esm/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
- /package/build/npm/esm/{feedbackSync.js → dev/feedbackSync.js} +0 -0
- /package/build/npm/esm/{helpers.js → dev/helpers.js} +0 -0
- /package/build/npm/esm/{index.js → dev/index.js} +0 -0
- /package/build/npm/esm/{index.js.map → dev/index.js.map} +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/breadcrumbs.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/browserapierrors.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/browsersession.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/contextlines.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/graphqlClient.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/httpclient.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/httpcontext.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/linkederrors.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/reportingobserver.js +0 -0
- /package/build/npm/esm/{integrations → dev/integrations}/spotlight.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/integration.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/lifecycleMode/traceLifecycleProfiler.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
- /package/build/npm/esm/{profiling → dev/profiling}/utils.js +0 -0
- /package/build/npm/esm/{report-dialog.js → dev/report-dialog.js} +0 -0
- /package/build/npm/esm/{stack-parsers.js → dev/stack-parsers.js} +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/backgroundtab.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/request.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/setActiveSpan.js +0 -0
- /package/build/npm/esm/{tracing → dev/tracing}/utils.js +0 -0
- /package/build/npm/esm/{transports → dev/transports}/offline.js +0 -0
- /package/build/npm/esm/{userfeedback.js → dev/userfeedback.js} +0 -0
- /package/build/npm/esm/{utils → dev/utils}/detectBrowserExtension.js +0 -0
- /package/build/npm/esm/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { uuid4, debug, getRootSpan, getGlobalScope, getSdkMetadataForEnvelopeHeader, createEnvelope, dsnToString } from '@sentry/core';
|
|
2
|
+
import { DEBUG_BUILD } from '../../debug-build.js';
|
|
3
|
+
import { startJSSelfProfile, createProfileChunkPayload, validateProfileChunk } from '../utils.js';
|
|
4
|
+
|
|
5
|
+
const CHUNK_INTERVAL_MS = 60000; // 1 minute
|
|
6
|
+
// Maximum length for trace lifecycle profiling per root span (e.g. if spanEnd never fires)
|
|
7
|
+
const MAX_ROOT_SPAN_PROFILE_MS = 300000; // 5 minutes
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Browser trace-lifecycle profiler (UI Profiling / Profiling V2):
|
|
11
|
+
* - Starts when the first sampled root span starts
|
|
12
|
+
* - Stops when the last sampled root span ends
|
|
13
|
+
* - While running, periodically stops and restarts the JS self-profiling API to collect chunks
|
|
14
|
+
*
|
|
15
|
+
* Profiles are emitted as standalone `profile_chunk` envelopes either when:
|
|
16
|
+
* - there are no more sampled root spans, or
|
|
17
|
+
* - the 60s chunk timer elapses while profiling is running.
|
|
18
|
+
*/
|
|
19
|
+
class BrowserTraceLifecycleProfiler {
|
|
20
|
+
|
|
21
|
+
// For keeping track of active root spans
|
|
22
|
+
|
|
23
|
+
// ID for Profiler session
|
|
24
|
+
|
|
25
|
+
constructor() {
|
|
26
|
+
this._client = undefined;
|
|
27
|
+
this._profiler = undefined;
|
|
28
|
+
this._chunkTimer = undefined;
|
|
29
|
+
this._activeRootSpanIds = new Set();
|
|
30
|
+
this._rootSpanTimeouts = new Map();
|
|
31
|
+
this._profilerId = undefined;
|
|
32
|
+
this._isRunning = false;
|
|
33
|
+
this._sessionSampled = false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Initialize the profiler with client and session sampling decision computed by the integration.
|
|
38
|
+
*/
|
|
39
|
+
initialize(client, sessionSampled) {
|
|
40
|
+
// One Profiler ID per profiling session (user session)
|
|
41
|
+
this._profilerId = uuid4();
|
|
42
|
+
|
|
43
|
+
DEBUG_BUILD && debug.log("[Profiling] Initializing profiler (lifecycle='trace').");
|
|
44
|
+
|
|
45
|
+
this._client = client;
|
|
46
|
+
this._sessionSampled = sessionSampled;
|
|
47
|
+
|
|
48
|
+
client.on('spanStart', span => {
|
|
49
|
+
if (!this._sessionSampled) {
|
|
50
|
+
DEBUG_BUILD && debug.log('[Profiling] Session not sampled because of negative sampling decision.');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (span !== getRootSpan(span)) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// Only count sampled root spans
|
|
57
|
+
if (!span.isRecording()) {
|
|
58
|
+
DEBUG_BUILD && debug.log('[Profiling] Discarding profile because root span was not sampled.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Matching root spans with profiles
|
|
63
|
+
getGlobalScope().setContext('profile', {
|
|
64
|
+
profiler_id: this._profilerId,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const spanId = span.spanContext().spanId;
|
|
68
|
+
if (!spanId) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (this._activeRootSpanIds.has(spanId)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
this._activeRootSpanIds.add(spanId);
|
|
76
|
+
const rootSpanCount = this._activeRootSpanIds.size;
|
|
77
|
+
|
|
78
|
+
const timeout = setTimeout(() => {
|
|
79
|
+
this._onRootSpanTimeout(spanId);
|
|
80
|
+
}, MAX_ROOT_SPAN_PROFILE_MS);
|
|
81
|
+
this._rootSpanTimeouts.set(spanId, timeout);
|
|
82
|
+
|
|
83
|
+
if (rootSpanCount === 1) {
|
|
84
|
+
DEBUG_BUILD &&
|
|
85
|
+
debug.log(
|
|
86
|
+
`[Profiling] Root span with ID ${spanId} started. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`,
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
this.start();
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
client.on('spanEnd', span => {
|
|
94
|
+
if (!this._sessionSampled) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const spanId = span.spanContext().spanId;
|
|
99
|
+
if (!spanId || !this._activeRootSpanIds.has(spanId)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
this._activeRootSpanIds.delete(spanId);
|
|
104
|
+
const rootSpanCount = this._activeRootSpanIds.size;
|
|
105
|
+
|
|
106
|
+
DEBUG_BUILD &&
|
|
107
|
+
debug.log(
|
|
108
|
+
`[Profiling] Root span with ID ${spanId} ended. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`,
|
|
109
|
+
);
|
|
110
|
+
if (rootSpanCount === 0) {
|
|
111
|
+
this._collectCurrentChunk().catch(e => {
|
|
112
|
+
DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `spanEnd`:', e);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
this.stop();
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Handle an already-active root span at integration setup time.
|
|
122
|
+
*/
|
|
123
|
+
notifyRootSpanActive(rootSpan) {
|
|
124
|
+
if (!this._sessionSampled) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const spanId = rootSpan.spanContext().spanId;
|
|
129
|
+
if (!spanId || this._activeRootSpanIds.has(spanId)) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
this._activeRootSpanIds.add(spanId);
|
|
134
|
+
|
|
135
|
+
const rootSpanCount = this._activeRootSpanIds.size;
|
|
136
|
+
|
|
137
|
+
if (rootSpanCount === 1) {
|
|
138
|
+
DEBUG_BUILD &&
|
|
139
|
+
debug.log('[Profiling] Detected already active root span during setup. Active root spans now:', rootSpanCount);
|
|
140
|
+
|
|
141
|
+
this.start();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Start profiling if not already running.
|
|
147
|
+
*/
|
|
148
|
+
start() {
|
|
149
|
+
if (this._isRunning) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
this._isRunning = true;
|
|
153
|
+
|
|
154
|
+
DEBUG_BUILD && debug.log('[Profiling] Started profiling with profile ID:', this._profilerId);
|
|
155
|
+
|
|
156
|
+
this._startProfilerInstance();
|
|
157
|
+
|
|
158
|
+
if (!this._profiler) {
|
|
159
|
+
DEBUG_BUILD && debug.log('[Profiling] Stopping trace lifecycle profiling.');
|
|
160
|
+
this._resetProfilerInfo();
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
this._startPeriodicChunking();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Stop profiling; final chunk will be collected and sent.
|
|
169
|
+
*/
|
|
170
|
+
stop() {
|
|
171
|
+
if (!this._isRunning) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
this._isRunning = false;
|
|
176
|
+
if (this._chunkTimer) {
|
|
177
|
+
clearTimeout(this._chunkTimer);
|
|
178
|
+
this._chunkTimer = undefined;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
this._clearAllRootSpanTimeouts();
|
|
182
|
+
|
|
183
|
+
// Collect whatever was currently recording
|
|
184
|
+
this._collectCurrentChunk().catch(e => {
|
|
185
|
+
DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `stop()`:', e);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Resets profiling information from scope and resets running state
|
|
191
|
+
*/
|
|
192
|
+
_resetProfilerInfo() {
|
|
193
|
+
this._isRunning = false;
|
|
194
|
+
getGlobalScope().setContext('profile', {});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Clear and reset all per-root-span timeouts.
|
|
199
|
+
*/
|
|
200
|
+
_clearAllRootSpanTimeouts() {
|
|
201
|
+
this._rootSpanTimeouts.forEach(timeout => clearTimeout(timeout));
|
|
202
|
+
this._rootSpanTimeouts.clear();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Start a profiler instance if needed.
|
|
207
|
+
*/
|
|
208
|
+
_startProfilerInstance() {
|
|
209
|
+
if (this._profiler?.stopped === false) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
const profiler = startJSSelfProfile();
|
|
213
|
+
if (!profiler) {
|
|
214
|
+
DEBUG_BUILD && debug.log('[Profiling] Failed to start JS Profiler in trace lifecycle.');
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
this._profiler = profiler;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Schedule the next 60s chunk while running.
|
|
222
|
+
* Each tick collects a chunk and restarts the profiler.
|
|
223
|
+
* A chunk should be closed when there are no active root spans anymore OR when the maximum chunk interval is reached.
|
|
224
|
+
*/
|
|
225
|
+
_startPeriodicChunking() {
|
|
226
|
+
if (!this._isRunning) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
this._chunkTimer = setTimeout(() => {
|
|
231
|
+
this._collectCurrentChunk().catch(e => {
|
|
232
|
+
DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk during periodic chunking:', e);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
if (this._isRunning) {
|
|
236
|
+
this._startProfilerInstance();
|
|
237
|
+
|
|
238
|
+
if (!this._profiler) {
|
|
239
|
+
// If restart failed, stop scheduling further chunks and reset context.
|
|
240
|
+
this._resetProfilerInfo();
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
this._startPeriodicChunking();
|
|
245
|
+
}
|
|
246
|
+
}, CHUNK_INTERVAL_MS);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Handle timeout for a specific root span ID to avoid indefinitely running profiler if `spanEnd` never fires.
|
|
251
|
+
* If this was the last active root span, collect the current chunk and stop profiling.
|
|
252
|
+
*/
|
|
253
|
+
_onRootSpanTimeout(rootSpanId) {
|
|
254
|
+
// If span already ended, ignore
|
|
255
|
+
if (!this._rootSpanTimeouts.has(rootSpanId)) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
this._rootSpanTimeouts.delete(rootSpanId);
|
|
259
|
+
|
|
260
|
+
if (!this._activeRootSpanIds.has(rootSpanId)) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
DEBUG_BUILD &&
|
|
265
|
+
debug.log(
|
|
266
|
+
`[Profiling] Reached 5-minute timeout for root span ${rootSpanId}. You likely started a manual root span that never called \`.end()\`.`,
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
this._activeRootSpanIds.delete(rootSpanId);
|
|
270
|
+
|
|
271
|
+
const rootSpanCount = this._activeRootSpanIds.size;
|
|
272
|
+
if (rootSpanCount === 0) {
|
|
273
|
+
this.stop();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Stop the current profiler, convert and send a profile chunk.
|
|
279
|
+
*/
|
|
280
|
+
async _collectCurrentChunk() {
|
|
281
|
+
const prevProfiler = this._profiler;
|
|
282
|
+
this._profiler = undefined;
|
|
283
|
+
|
|
284
|
+
if (!prevProfiler) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
try {
|
|
289
|
+
const profile = await prevProfiler.stop();
|
|
290
|
+
|
|
291
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
292
|
+
const chunk = createProfileChunkPayload(profile, this._client, this._profilerId);
|
|
293
|
+
|
|
294
|
+
// Validate chunk before sending
|
|
295
|
+
const validationReturn = validateProfileChunk(chunk);
|
|
296
|
+
if ('reason' in validationReturn) {
|
|
297
|
+
DEBUG_BUILD &&
|
|
298
|
+
debug.log(
|
|
299
|
+
'[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):',
|
|
300
|
+
validationReturn.reason,
|
|
301
|
+
);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
this._sendProfileChunk(chunk);
|
|
306
|
+
|
|
307
|
+
DEBUG_BUILD && debug.log('[Profiling] Collected browser profile chunk.');
|
|
308
|
+
} catch (e) {
|
|
309
|
+
DEBUG_BUILD && debug.log('[Profiling] Error while stopping JS Profiler for chunk:', e);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Send a profile chunk as a standalone envelope.
|
|
315
|
+
*/
|
|
316
|
+
_sendProfileChunk(chunk) {
|
|
317
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
318
|
+
const client = this._client;
|
|
319
|
+
|
|
320
|
+
const sdkInfo = getSdkMetadataForEnvelopeHeader(client.getSdkMetadata?.());
|
|
321
|
+
const dsn = client.getDsn();
|
|
322
|
+
const tunnel = client.getOptions().tunnel;
|
|
323
|
+
|
|
324
|
+
const envelope = createEnvelope(
|
|
325
|
+
{
|
|
326
|
+
event_id: uuid4(),
|
|
327
|
+
sent_at: new Date().toISOString(),
|
|
328
|
+
...(sdkInfo && { sdk: sdkInfo }),
|
|
329
|
+
...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),
|
|
330
|
+
},
|
|
331
|
+
[[{ type: 'profile_chunk' }, chunk]],
|
|
332
|
+
);
|
|
333
|
+
|
|
334
|
+
client.sendEnvelope(envelope).then(null, reason => {
|
|
335
|
+
DEBUG_BUILD && debug.error('Error while sending profile chunk envelope:', reason);
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export { BrowserTraceLifecycleProfiler };
|
|
341
|
+
//# sourceMappingURL=traceLifecycleProfiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceLifecycleProfiler.js","sources":["../../../../../../src/profiling/lifecycleMode/traceLifecycleProfiler.ts"],"sourcesContent":["import type { Client, ProfileChunk, Span } from '@sentry/core';\nimport {\n type ProfileChunkEnvelope,\n createEnvelope,\n debug,\n dsnToString,\n getGlobalScope,\n getRootSpan,\n getSdkMetadataForEnvelopeHeader,\n uuid4,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport type { JSSelfProfiler } from '../jsSelfProfiling';\nimport { createProfileChunkPayload, startJSSelfProfile, validateProfileChunk } from '../utils';\n\nconst CHUNK_INTERVAL_MS = 60_000; // 1 minute\n// Maximum length for trace lifecycle profiling per root span (e.g. if spanEnd never fires)\nconst MAX_ROOT_SPAN_PROFILE_MS = 300_000; // 5 minutes\n\n/**\n * Browser trace-lifecycle profiler (UI Profiling / Profiling V2):\n * - Starts when the first sampled root span starts\n * - Stops when the last sampled root span ends\n * - While running, periodically stops and restarts the JS self-profiling API to collect chunks\n *\n * Profiles are emitted as standalone `profile_chunk` envelopes either when:\n * - there are no more sampled root spans, or\n * - the 60s chunk timer elapses while profiling is running.\n */\nexport class BrowserTraceLifecycleProfiler {\n private _client: Client | undefined;\n private _profiler: JSSelfProfiler | undefined;\n private _chunkTimer: ReturnType<typeof setTimeout> | undefined;\n // For keeping track of active root spans\n private _activeRootSpanIds: Set<string>;\n private _rootSpanTimeouts: Map<string, ReturnType<typeof setTimeout>>;\n // ID for Profiler session\n private _profilerId: string | undefined;\n private _isRunning: boolean;\n private _sessionSampled: boolean;\n\n public constructor() {\n this._client = undefined;\n this._profiler = undefined;\n this._chunkTimer = undefined;\n this._activeRootSpanIds = new Set<string>();\n this._rootSpanTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n this._profilerId = undefined;\n this._isRunning = false;\n this._sessionSampled = false;\n }\n\n /**\n * Initialize the profiler with client and session sampling decision computed by the integration.\n */\n public initialize(client: Client, sessionSampled: boolean): void {\n // One Profiler ID per profiling session (user session)\n this._profilerId = uuid4();\n\n DEBUG_BUILD && debug.log(\"[Profiling] Initializing profiler (lifecycle='trace').\");\n\n this._client = client;\n this._sessionSampled = sessionSampled;\n\n client.on('spanStart', span => {\n if (!this._sessionSampled) {\n DEBUG_BUILD && debug.log('[Profiling] Session not sampled because of negative sampling decision.');\n return;\n }\n if (span !== getRootSpan(span)) {\n return;\n }\n // Only count sampled root spans\n if (!span.isRecording()) {\n DEBUG_BUILD && debug.log('[Profiling] Discarding profile because root span was not sampled.');\n return;\n }\n\n // Matching root spans with profiles\n getGlobalScope().setContext('profile', {\n profiler_id: this._profilerId,\n });\n\n const spanId = span.spanContext().spanId;\n if (!spanId) {\n return;\n }\n if (this._activeRootSpanIds.has(spanId)) {\n return;\n }\n\n this._activeRootSpanIds.add(spanId);\n const rootSpanCount = this._activeRootSpanIds.size;\n\n const timeout = setTimeout(() => {\n this._onRootSpanTimeout(spanId);\n }, MAX_ROOT_SPAN_PROFILE_MS);\n this._rootSpanTimeouts.set(spanId, timeout);\n\n if (rootSpanCount === 1) {\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Root span with ID ${spanId} started. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`,\n );\n\n this.start();\n }\n });\n\n client.on('spanEnd', span => {\n if (!this._sessionSampled) {\n return;\n }\n\n const spanId = span.spanContext().spanId;\n if (!spanId || !this._activeRootSpanIds.has(spanId)) {\n return;\n }\n\n this._activeRootSpanIds.delete(spanId);\n const rootSpanCount = this._activeRootSpanIds.size;\n\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Root span with ID ${spanId} ended. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`,\n );\n if (rootSpanCount === 0) {\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `spanEnd`:', e);\n });\n\n this.stop();\n }\n });\n }\n\n /**\n * Handle an already-active root span at integration setup time.\n */\n public notifyRootSpanActive(rootSpan: Span): void {\n if (!this._sessionSampled) {\n return;\n }\n\n const spanId = rootSpan.spanContext().spanId;\n if (!spanId || this._activeRootSpanIds.has(spanId)) {\n return;\n }\n\n this._activeRootSpanIds.add(spanId);\n\n const rootSpanCount = this._activeRootSpanIds.size;\n\n if (rootSpanCount === 1) {\n DEBUG_BUILD &&\n debug.log('[Profiling] Detected already active root span during setup. Active root spans now:', rootSpanCount);\n\n this.start();\n }\n }\n\n /**\n * Start profiling if not already running.\n */\n public start(): void {\n if (this._isRunning) {\n return;\n }\n this._isRunning = true;\n\n DEBUG_BUILD && debug.log('[Profiling] Started profiling with profile ID:', this._profilerId);\n\n this._startProfilerInstance();\n\n if (!this._profiler) {\n DEBUG_BUILD && debug.log('[Profiling] Stopping trace lifecycle profiling.');\n this._resetProfilerInfo();\n return;\n }\n\n this._startPeriodicChunking();\n }\n\n /**\n * Stop profiling; final chunk will be collected and sent.\n */\n public stop(): void {\n if (!this._isRunning) {\n return;\n }\n\n this._isRunning = false;\n if (this._chunkTimer) {\n clearTimeout(this._chunkTimer);\n this._chunkTimer = undefined;\n }\n\n this._clearAllRootSpanTimeouts();\n\n // Collect whatever was currently recording\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `stop()`:', e);\n });\n }\n\n /**\n * Resets profiling information from scope and resets running state\n */\n private _resetProfilerInfo(): void {\n this._isRunning = false;\n getGlobalScope().setContext('profile', {});\n }\n\n /**\n * Clear and reset all per-root-span timeouts.\n */\n private _clearAllRootSpanTimeouts(): void {\n this._rootSpanTimeouts.forEach(timeout => clearTimeout(timeout));\n this._rootSpanTimeouts.clear();\n }\n\n /**\n * Start a profiler instance if needed.\n */\n private _startProfilerInstance(): void {\n if (this._profiler?.stopped === false) {\n return;\n }\n const profiler = startJSSelfProfile();\n if (!profiler) {\n DEBUG_BUILD && debug.log('[Profiling] Failed to start JS Profiler in trace lifecycle.');\n return;\n }\n this._profiler = profiler;\n }\n\n /**\n * Schedule the next 60s chunk while running.\n * Each tick collects a chunk and restarts the profiler.\n * A chunk should be closed when there are no active root spans anymore OR when the maximum chunk interval is reached.\n */\n private _startPeriodicChunking(): void {\n if (!this._isRunning) {\n return;\n }\n\n this._chunkTimer = setTimeout(() => {\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk during periodic chunking:', e);\n });\n\n if (this._isRunning) {\n this._startProfilerInstance();\n\n if (!this._profiler) {\n // If restart failed, stop scheduling further chunks and reset context.\n this._resetProfilerInfo();\n return;\n }\n\n this._startPeriodicChunking();\n }\n }, CHUNK_INTERVAL_MS);\n }\n\n /**\n * Handle timeout for a specific root span ID to avoid indefinitely running profiler if `spanEnd` never fires.\n * If this was the last active root span, collect the current chunk and stop profiling.\n */\n private _onRootSpanTimeout(rootSpanId: string): void {\n // If span already ended, ignore\n if (!this._rootSpanTimeouts.has(rootSpanId)) {\n return;\n }\n this._rootSpanTimeouts.delete(rootSpanId);\n\n if (!this._activeRootSpanIds.has(rootSpanId)) {\n return;\n }\n\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Reached 5-minute timeout for root span ${rootSpanId}. You likely started a manual root span that never called \\`.end()\\`.`,\n );\n\n this._activeRootSpanIds.delete(rootSpanId);\n\n const rootSpanCount = this._activeRootSpanIds.size;\n if (rootSpanCount === 0) {\n this.stop();\n }\n }\n\n /**\n * Stop the current profiler, convert and send a profile chunk.\n */\n private async _collectCurrentChunk(): Promise<void> {\n const prevProfiler = this._profiler;\n this._profiler = undefined;\n\n if (!prevProfiler) {\n return;\n }\n\n try {\n const profile = await prevProfiler.stop();\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const chunk = createProfileChunkPayload(profile, this._client!, this._profilerId);\n\n // Validate chunk before sending\n const validationReturn = validateProfileChunk(chunk);\n if ('reason' in validationReturn) {\n DEBUG_BUILD &&\n debug.log(\n '[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):',\n validationReturn.reason,\n );\n return;\n }\n\n this._sendProfileChunk(chunk);\n\n DEBUG_BUILD && debug.log('[Profiling] Collected browser profile chunk.');\n } catch (e) {\n DEBUG_BUILD && debug.log('[Profiling] Error while stopping JS Profiler for chunk:', e);\n }\n }\n\n /**\n * Send a profile chunk as a standalone envelope.\n */\n private _sendProfileChunk(chunk: ProfileChunk): void {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const client = this._client!;\n\n const sdkInfo = getSdkMetadataForEnvelopeHeader(client.getSdkMetadata?.());\n const dsn = client.getDsn();\n const tunnel = client.getOptions().tunnel;\n\n const envelope = createEnvelope<ProfileChunkEnvelope>(\n {\n event_id: uuid4(),\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n },\n [[{ type: 'profile_chunk' }, chunk]],\n );\n\n client.sendEnvelope(envelope).then(null, reason => {\n DEBUG_BUILD && debug.error('Error while sending profile chunk envelope:', reason);\n });\n }\n}\n"],"names":[],"mappings":";;;;AAeA,MAAM,iBAAA,GAAoB,KAAM,CAAA;AAChC;AACA,MAAM,wBAAA,GAA2B,MAAO,CAAA;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,6BAAA,CAA8B;;AAI3C;;AAGA;;AAKA,GAAS,WAAW,GAAG;AACvB,IAAI,IAAI,CAAC,OAAA,GAAU,SAAS;AAC5B,IAAI,IAAI,CAAC,SAAA,GAAY,SAAS;AAC9B,IAAI,IAAI,CAAC,WAAA,GAAc,SAAS;AAChC,IAAI,IAAI,CAAC,kBAAA,GAAqB,IAAI,GAAG,EAAU;AA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AI,MAAM,MAAA,GAAS,IAAI,CAAC,OAAO;;AAE/B,IAAI,MAAM,OAAA,GAAU,+BAA+B,CAAC,MAAM,CAAC,cAAc,IAAI,CAAC;AAC9E,IAAI,MAAM,GAAA,GAAM,MAAM,CAAC,MAAM,EAAE;AAC/B,IAAI,MAAM,SAAS,MAAM,CAAC,UAAU,EAAE,CAAC,MAAM;;AAE7C,IAAI,MAAM,QAAA,GAAW,cAAc;AACnC,MAAM;AACN,QAAQ,QAAQ,EAAE,KAAK,EAAE;AACzB,QAAQ,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACzC,QAAQ,IAAI,OAAA,IAAW,EAAE,GAAG,EAAE,OAAA,EAAS,CAAC;AACxC,QAAQ,IAAI,CAAC,CAAC,MAAA,IAAU,GAAA,IAAO,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAA,EAAG,CAAC;AACzD,OAAO;AACP,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAC;AAC1C,KAAK;;AAEL,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAA,IAAU;AACvD,MAAM,WAAA,IAAe,KAAK,CAAC,KAAK,CAAC,6CAA6C,EAAE,MAAM,CAAC;AACvF,IAAI,CAAC,CAAC;AACN,EAAE;AACF;;;;"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { timestampInSeconds, debug, spanToJSON, uuid4, getCurrentScope } from '@sentry/core';
|
|
2
|
+
import { DEBUG_BUILD } from '../debug-build.js';
|
|
3
|
+
import { WINDOW } from '../helpers.js';
|
|
4
|
+
import { isAutomatedPageLoadSpan, startJSSelfProfile, MAX_PROFILE_DURATION_MS, addProfileToGlobalCache } from './utils.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Wraps startTransaction and stopTransaction with profiling related logic.
|
|
8
|
+
* startProfileForTransaction is called after the call to startTransaction in order to avoid our own code from
|
|
9
|
+
* being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.
|
|
10
|
+
*/
|
|
11
|
+
function startProfileForSpan(span) {
|
|
12
|
+
// Start the profiler and get the profiler instance.
|
|
13
|
+
let startTimestamp;
|
|
14
|
+
if (isAutomatedPageLoadSpan(span)) {
|
|
15
|
+
startTimestamp = timestampInSeconds() * 1000;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const profiler = startJSSelfProfile();
|
|
19
|
+
|
|
20
|
+
// We failed to construct the profiler, so we skip.
|
|
21
|
+
// No need to log anything as this has already been logged in startProfile.
|
|
22
|
+
if (!profiler) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (DEBUG_BUILD) {
|
|
27
|
+
debug.log(`[Profiling] started profiling span: ${spanToJSON(span).description}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// We create "unique" span names to avoid concurrent spans with same names
|
|
31
|
+
// from being ignored by the profiler. From here on, only this span name should be used when
|
|
32
|
+
// calling the profiler methods. Note: we log the original name to the user to avoid confusion.
|
|
33
|
+
const profileId = uuid4();
|
|
34
|
+
|
|
35
|
+
// A couple of important things to note here:
|
|
36
|
+
// `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.
|
|
37
|
+
// Whichever of the two (span.finish/timeout) is first to run, the profiling will be stopped and the gathered profile
|
|
38
|
+
// will be processed when the original span is finished. Since onProfileHandler can be invoked multiple times in the
|
|
39
|
+
// event of an error or user mistake (calling span.finish multiple times), it is important that the behavior of onProfileHandler
|
|
40
|
+
// is idempotent as we do not want any timings or profiles to be overridden by the last call to onProfileHandler.
|
|
41
|
+
// After the original finish method is called, the event will be reported through the integration and delegated to transport.
|
|
42
|
+
let processedProfile = null;
|
|
43
|
+
|
|
44
|
+
getCurrentScope().setContext('profile', {
|
|
45
|
+
profile_id: profileId,
|
|
46
|
+
start_timestamp: startTimestamp,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Idempotent handler for profile stop
|
|
51
|
+
*/
|
|
52
|
+
async function onProfileHandler() {
|
|
53
|
+
// Check if the profile exists and return it the behavior has to be idempotent as users may call span.finish multiple times.
|
|
54
|
+
if (!span) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
// Satisfy the type checker, but profiler will always be defined here.
|
|
58
|
+
if (!profiler) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (processedProfile) {
|
|
62
|
+
if (DEBUG_BUILD) {
|
|
63
|
+
debug.log('[Profiling] profile for:', spanToJSON(span).description, 'already exists, returning early');
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return profiler
|
|
69
|
+
.stop()
|
|
70
|
+
.then((profile) => {
|
|
71
|
+
if (maxDurationTimeoutID) {
|
|
72
|
+
WINDOW.clearTimeout(maxDurationTimeoutID);
|
|
73
|
+
maxDurationTimeoutID = undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (DEBUG_BUILD) {
|
|
77
|
+
debug.log(`[Profiling] stopped profiling of span: ${spanToJSON(span).description}`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// In case of an overlapping span, stopProfiling may return null and silently ignore the overlapping profile.
|
|
81
|
+
if (!profile) {
|
|
82
|
+
if (DEBUG_BUILD) {
|
|
83
|
+
debug.log(
|
|
84
|
+
`[Profiling] profiler returned null profile for: ${spanToJSON(span).description}`,
|
|
85
|
+
'this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started',
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
processedProfile = profile;
|
|
92
|
+
addProfileToGlobalCache(profileId, profile);
|
|
93
|
+
})
|
|
94
|
+
.catch(error => {
|
|
95
|
+
if (DEBUG_BUILD) {
|
|
96
|
+
debug.log('[Profiling] error while stopping profiler:', error);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Enqueue a timeout to prevent profiles from running over max duration.
|
|
102
|
+
let maxDurationTimeoutID = WINDOW.setTimeout(() => {
|
|
103
|
+
if (DEBUG_BUILD) {
|
|
104
|
+
debug.log('[Profiling] max profile duration elapsed, stopping profiling for:', spanToJSON(span).description);
|
|
105
|
+
}
|
|
106
|
+
// If the timeout exceeds, we want to stop profiling, but not finish the span
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
108
|
+
onProfileHandler();
|
|
109
|
+
}, MAX_PROFILE_DURATION_MS);
|
|
110
|
+
|
|
111
|
+
// We need to reference the original end call to avoid creating an infinite loop
|
|
112
|
+
const originalEnd = span.end.bind(span);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Wraps span `end()` with profiling related logic.
|
|
116
|
+
* startProfiling is called after the call to spanStart in order to avoid our own code from
|
|
117
|
+
* being profiled. Because of that same reason, stopProfiling is called before the call to spanEnd.
|
|
118
|
+
*/
|
|
119
|
+
function profilingWrappedSpanEnd() {
|
|
120
|
+
if (!span) {
|
|
121
|
+
return originalEnd();
|
|
122
|
+
}
|
|
123
|
+
// onProfileHandler should always return the same profile even if this is called multiple times.
|
|
124
|
+
// Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.
|
|
125
|
+
void onProfileHandler().then(
|
|
126
|
+
() => {
|
|
127
|
+
originalEnd();
|
|
128
|
+
},
|
|
129
|
+
() => {
|
|
130
|
+
// If onProfileHandler fails, we still want to call the original finish method.
|
|
131
|
+
originalEnd();
|
|
132
|
+
},
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
return span;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
span.end = profilingWrappedSpanEnd;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export { startProfileForSpan };
|
|
142
|
+
//# sourceMappingURL=startProfileForSpan.js.map
|
|
@@ -0,0 +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 { addProfileToGlobalCache, isAutomatedPageLoadSpan, MAX_PROFILE_DURATION_MS, startJSSelfProfile } 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 /**\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":[],"mappings":";;;;;AAOA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,IAAI,EAAc;AACtD;AACA,EAAE,IAAI,cAAc;AACpB,EAAE,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE;AACrC,IAAI,iBAAiB,kBAAkB,EAAC,GAAI,IAAI;AAChD,EAAE;;AAEF,EAAE,MAAM,QAAA,GAAW,kBAAkB,EAAE;;AAEvC;AACA;AACA,EAAE,IAAI,CAAC,QAAQ,EAAE;AACjB,IAAI;AACJ,EAAE;;AAEF,EAAE,IAAI,WAAW,EAAE;AACnB,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,oCAAoC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAAA,CAAA;AACA,EAAA;;AAEA;AACA;AACA;AACA,EAAA,MAAA,SAAA,GAAA,KAAA,EAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,gBAAA,GAAA,IAAA;;AAEA,EAAA,eAAA,EAAA,CAAA,UAAA,CAAA,SAAA,EAAA;AACA,IAAA,UAAA,EAAA,SAAA;AACA,IAAA,eAAA,EAAA,cAAA;AACA,GAAA,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,IAAA,WAAA,EAAA;AACA,QAAA,KAAA,CAAA,GAAA,CAAA,0BAA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