From af391f016127ea570dd89801a660764a6a7457e9 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:37:48 +0100 Subject: [PATCH 1/2] docs(profiling): Add docs for UI profiling (Browser JS) --- .../profiles/continuous-profiling-api.mdx | 2 +- .../common/configuration/options.mdx | 31 ++++++++++++- .../javascript/guides/astro/index.mdx | 5 +-- .../explore/profiling/getting-started.mdx | 5 ++- .../_default.mdx | 9 ++-- .../javascript.angular.mdx | 9 ++-- .../javascript.astro.mdx | 9 ++-- .../javascript.nextjs.mdx | 9 ++-- .../javascript.nuxt.mdx | 9 ++-- .../javascript.react.mdx | 9 ++-- .../javascript.remix.mdx | 9 ++-- .../javascript.svelte.mdx | 9 ++-- .../javascript.sveltekit.mdx | 9 ++-- .../javascript.vue.mdx | 8 +--- .../browser-profiling/javascript.mdx | 45 +++++++++++++++++-- 15 files changed, 107 insertions(+), 70 deletions(-) diff --git a/develop-docs/sdk/telemetry/profiles/continuous-profiling-api.mdx b/develop-docs/sdk/telemetry/profiles/continuous-profiling-api.mdx index 4304a7a5a0eb1..10e5c8880288a 100644 --- a/develop-docs/sdk/telemetry/profiles/continuous-profiling-api.mdx +++ b/develop-docs/sdk/telemetry/profiles/continuous-profiling-api.mdx @@ -74,7 +74,7 @@ Those are the two modes: - **`'trace'`**: **This mode requires tracing to be enabled.** The profiler starts automatically when there is at least one active root span and stops when there are no active root spans (letting the current chunk completely finish). - Profiling respects **both** `profile_session_sample_rate` and the tracing sampling configuration (`traces_sample_rate` or `traces_sampler`). - `profile_session_sample_rate` is checked first. If the session is not sampled, no profiling will occur. - - If the session is sampled, `traces_sample_rate` / `traces_sampler` is evaluated for each root span to determine if it should be profiled. + - Only if a root span is sampled (this is based on `traces_sample_rate` / `traces_sampler`), profiling will start. Therefore, profile sampling is re-evaluated on each root span. - The profiler runs as long as there is at least one **sampled** root span. If multiple root spans overlap, profiling continues until the last sampled root span finishes. diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index 803953482d120..f8cb98bed7700 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -548,12 +548,41 @@ The sample rate for replays that are recorded when an error happens. This type o ## Profiling Options + + + A number between `0` and `1` that sets the percentage of how many sessions should have profiling enabled. `1.0` enables profiling in every session, `0.5` enables profiling for 50% of the sessions, and `0` enables it for none. The sampling decision is made once at the beginning of a session. This option is required to enable profiling. + + + In a server environment, a profiling session starts when the Sentry SDK is initialized and stops when the service terminates. + Therefore, the sampling decision is re-evaluated on service restart or redeployment. + + + + In a browser environment, a profiling session corresponds to a user session. A user session starts with a + new SDK initialization on page load and ends when the browser tab is closed. + + + + + + +Determines how profiling sessions are controlled. It has two modes: + +- `'manual'` (default): You control when profiling starts and stops using the `startProfiler()` and `stopProfiler()` functions. In this mode, profile sampling is only affected by `profileSessionSampleRate`. Read more about these functions in the profiling API documentation. +- `'trace'`: Profiling starts and stops automatically with transactions, as long as tracing is enabled. The profiler runs as long as there is at least one sampled transaction. In this mode, profiling is affected by both `profileSessionSampleRate` and your tracing sample rate (`tracesSampleRate` or `tracesSampler`). + + + + -A number between `0` and `1`, controlling the percentage chance a given sampled transaction will be profiled. (`0` represents 0% while `1` represents 100%.) Applies equally to all transactions created in the app. This is relative to the tracing sample rate - e.g. `0.5` means 50% of sampled transactions will be profiled. + **Deprecated:** Use `profileSessionSampleRate` instead to configure continuous profiling. + + A number between `0` and `1`, controlling the percentage chance a given sampled transaction will be profiled. (`0` represents 0% while `1` represents 100%.) Applies equally to all transactions created in the app. This is relative to the tracing sample rate - e.g. `0.5` means 50% of sampled transactions will be profiled. + ## Experimental Options diff --git a/docs/platforms/javascript/guides/astro/index.mdx b/docs/platforms/javascript/guides/astro/index.mdx index 7225a95e40047..eae40d9bd6ada 100644 --- a/docs/platforms/javascript/guides/astro/index.mdx +++ b/docs/platforms/javascript/guides/astro/index.mdx @@ -187,9 +187,8 @@ Sentry.init({ // ___PRODUCT_OPTION_END___ performance // ___PRODUCT_OPTION_START___ profiling - // Set sampling rate for profiling - // This is relative to tracesSampleRate - profilesSampleRate: 1.0, + // Define how many user sessions have profiling enabled. + profileSessionSampleRate: 1.0, // ___PRODUCT_OPTION_END___ profiling }); ``` diff --git a/docs/product/explore/profiling/getting-started.mdx b/docs/product/explore/profiling/getting-started.mdx index 30c02752f5d77..1ec9206855778 100644 --- a/docs/product/explore/profiling/getting-started.mdx +++ b/docs/product/explore/profiling/getting-started.mdx @@ -4,7 +4,7 @@ sidebar_order: 2 description: "Get started with Profiling, which allows you to see code-level profiling information for your Sentry apps." --- -Continuous Profiling and UI Profiling are the latest iteration of Sentry’s profiling capabilities, but they are currently only supported in select SDKs as described below. +Continuous Profiling and UI Profiling are the latest iteration of Sentry’s profiling capabilities, but they are currently only supported in select SDKs as described below. Other platforms are supported via the prior transaction-based Profiling product, but these will not benefit from new capabilities introduced by Continuous and UI Profiling (direct start/stop control over the profile lifecycle and removal of duration limits). For more information on the differences between transaction-based Profiling and Continuous/UI Profiling, read [this documentation](/product/explore/profiling/transaction-vs-continuous-profiling). @@ -30,10 +30,11 @@ Continuous Profiling can be used both independently and as a complement to the t -UI Profiling can be used both independently and as a complement to the tracing product. Support for Browser JavaScript is coming soon. +UI Profiling can be used both independently and as a complement to the tracing product. +- [Browser JavaScript](/platforms/javascript/profiling/) [beta] (since version `10.27.0`) - Mobile - [Android](/platforms/android/profiling/#continuous-profiling) - [iOS and macOS](/platforms/apple/guides/ios/profiling/#continuous-profiling) diff --git a/platform-includes/profiling/automatic-instrumentation-setup/_default.mdx b/platform-includes/profiling/automatic-instrumentation-setup/_default.mdx index 730872867b0aa..1cd3c553d7d31 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/_default.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/_default.mdx @@ -16,11 +16,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.angular.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.angular.mdx index 2052ac5aa68fd..422d6bcbf57ef 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.angular.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.angular.mdx @@ -16,11 +16,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.astro.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.astro.mdx index 7a5e311a77582..10fd65101b2a9 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.astro.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.astro.mdx @@ -15,11 +15,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.nextjs.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.nextjs.mdx index 0f37f1508a265..571139a7c9314 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.nextjs.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.nextjs.mdx @@ -15,11 +15,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.nuxt.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.nuxt.mdx index 6818c34e92911..4e2f5e55507d8 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.nuxt.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.nuxt.mdx @@ -15,11 +15,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.react.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.react.mdx index 1834744a430ed..654a49e177fb5 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.react.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.react.mdx @@ -16,11 +16,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.remix.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.remix.mdx index 54ae801d254ad..f2b5f52c37b87 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.remix.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.remix.mdx @@ -16,11 +16,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.svelte.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.svelte.mdx index 45a0aab1bdd89..654e34fadb4c2 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.svelte.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.svelte.mdx @@ -16,11 +16,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.sveltekit.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.sveltekit.mdx index 169635ebd092a..88958bde58799 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.sveltekit.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.sveltekit.mdx @@ -15,11 +15,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx index 317f142787d2c..f12eb3c2a0859 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx @@ -16,11 +16,7 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, + // Set profileSessionSampleRate to 1.0 to enable profiling during every user session. + profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/browser-profiling/javascript.mdx b/platform-includes/profiling/browser-profiling/javascript.mdx index 006027272058a..f1510c60b4072 100644 --- a/platform-includes/profiling/browser-profiling/javascript.mdx +++ b/platform-includes/profiling/browser-profiling/javascript.mdx @@ -14,9 +14,9 @@ Note that since the profiling API is currently only exposed in Chromium, profile To get started with JavaScript browser profiling, you'll need to: -- Install the SDK, minimum version 7.60.0 +- Install the SDK, minimum version `10.27.0` (UI Profiling) or `7.60.0` (deprecated transaction-based Profiling) - Configure the document response header to include `Document-Policy: js-profiling` -- Configure the SDK to use the `BrowserProfilingIntegration` and set `profilesSampleRate` +- Configure the SDK to use the `browserProfilingIntegration` and set `profileSessionSampleRate` (UI Profiling) or `profilesSampleRate` (deprecated transaction-based Profiling) ## Step 1: Install the SDK @@ -48,10 +48,49 @@ Configuration should happen as early as possible in your application's lifecycle -When you enable `browserProfilingIntegration` in your SDK configuration, Chrome will incorrectly attribute regular rendering work as “Profiling Overhead” if you are doing local profiling via the Chrome DevTools Performance panel. To avoid this, disable or remove the integration when profiling with Chrome DevTools. +When you enable `browserProfilingIntegration` in your SDK configuration, Chrome will incorrectly attribute regular rendering work as “Profiling Overhead” if you are doing local profiling via the Chrome DevTools Performance panel. To avoid this, disable or remove the integration when profiling with Chrome DevTools. +## Profiling Modes + +Profiling supports two modes - `manual` and `trace`. The two modes are mutually exclusive, and cannot be used at the same time. + +In `manual` mode, the profiling data collection can be managed via calls to `Sentry.uiProfiler.startProfiler` and `Sentry.uiProfiler.stopProfiler`. You are entirely in the in control of when the profiler runs. + +In `trace` mode, the profiler manages its own start and stop calls, which are based on spans: the profiler continues to run while there is at least one active span, and stops when there are no active spans. + + +### Manual Lifecycle Profiling + +Manual lifecycle profiling is the default mode and enables you to start and stop the profiler manually. + +After enabling the `browserProfilingIntegration` and setting a `profileSessionSampleRate`, you can start and stop the profiler with the following calls: + +```javascript {9} +// All spans (unless those discarded by sampling) will have profiling data attached to them. +Sentry.uiProfiler.startProfiler(); +// Code executed between these two calls will be profiled +Sentry.uiProfiler.stopProfiler(); +``` + +### Trace Lifecycle Profiling + +To enable trace lifecycle profiling, enable tracing and set `profileLifecycle` to `'trace'` in your SDK configuration. + +```javascript {9} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [ + Sentry.browserTracingIntegration(), // Enables tracing + Sentry.browserProfilingIntegration() + ], + tracesSampleRate: 1.0, // Enables tracing + profileSessionSampleRate: 1.0, + profileLifecycle: 'trace', +}); +``` + ## The Difference Between DevTools & Sentry's JavaScript Browser Profiler What does Sentry's JavaScript browser profile offer that Chrome DevTools does not? From 8e73643e5f8f5c81f636993371d29c7e8690d5f2 Mon Sep 17 00:00:00 2001 From: s1gr1d <32902192+s1gr1d@users.noreply.github.com> Date: Tue, 25 Nov 2025 16:28:43 +0100 Subject: [PATCH 2/2] review suggestions --- .../sdk/telemetry/profiles/continuous-profiling-api.mdx | 2 +- docs/platforms/android/profiling/index.mdx | 2 +- docs/platforms/java/common/profiling/index.mdx | 4 ++-- docs/platforms/javascript/common/configuration/options.mdx | 6 +++--- docs/platforms/python/profiling/index.mdx | 2 +- .../automatic-instrumentation-setup/javascript.vue.mdx | 3 ++- .../profiling/browser-profiling/javascript.mdx | 6 +++--- platform-includes/profiling/node-profiling/javascript.mdx | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/develop-docs/sdk/telemetry/profiles/continuous-profiling-api.mdx b/develop-docs/sdk/telemetry/profiles/continuous-profiling-api.mdx index 10e5c8880288a..2eab84371d60d 100644 --- a/develop-docs/sdk/telemetry/profiles/continuous-profiling-api.mdx +++ b/develop-docs/sdk/telemetry/profiles/continuous-profiling-api.mdx @@ -74,7 +74,7 @@ Those are the two modes: - **`'trace'`**: **This mode requires tracing to be enabled.** The profiler starts automatically when there is at least one active root span and stops when there are no active root spans (letting the current chunk completely finish). - Profiling respects **both** `profile_session_sample_rate` and the tracing sampling configuration (`traces_sample_rate` or `traces_sampler`). - `profile_session_sample_rate` is checked first. If the session is not sampled, no profiling will occur. - - Only if a root span is sampled (this is based on `traces_sample_rate` / `traces_sampler`), profiling will start. Therefore, profile sampling is re-evaluated on each root span. + - Only if a root span is sampled (this is based on `traces_sample_rate` / `traces_sampler`), profiling will start. Therefore, profile sampling is re-evaluated for each root span. - The profiler runs as long as there is at least one **sampled** root span. If multiple root spans overlap, profiling continues until the last sampled root span finishes. diff --git a/docs/platforms/android/profiling/index.mdx b/docs/platforms/android/profiling/index.mdx index 4f243fe23ada9..7ec1a4cc161b2 100644 --- a/docs/platforms/android/profiling/index.mdx +++ b/docs/platforms/android/profiling/index.mdx @@ -19,7 +19,7 @@ The transaction-based profiler is available on SDK versions `6.16.0` and higher ## Enabling UI Profiling -UI Profiling supports two modes - `manual` and `trace`. The two modes are mutually exclusive, and cannot be used at the same time. +UI Profiling supports two modes: `manual` and `trace`. These modes are mutually exclusive and cannot be used at the same time. In `manual` mode, the profiling data collection can be managed via calls to `Sentry.profiler.startProfiler` and `Sentry.profiler.stopProfiler`. You are entirely in the in control of when the profiler runs. diff --git a/docs/platforms/java/common/profiling/index.mdx b/docs/platforms/java/common/profiling/index.mdx index 52a38e4b9d0ae..6e6f873d7070d 100644 --- a/docs/platforms/java/common/profiling/index.mdx +++ b/docs/platforms/java/common/profiling/index.mdx @@ -37,7 +37,7 @@ implementation 'io.sentry:sentry-async-profiler:{{@inject packages.version('sent ## Enabling Continuous Profiling -Continuous profiling supports two modes - `manual` and `trace`. The two modes are mutually exclusive, and cannot be used at the same time. +Continuous Profiling supports two modes: `manual` and `trace`. These modes are mutually exclusive and cannot be used at the same time. In `manual` mode, the profiling data collection can be managed via calls to `Sentry.startProfiler()` and `Sentry.stopProfiler()`. You are entirely in control of when the profiler runs. @@ -61,5 +61,5 @@ Continuous profiling for Java is currently supported on: - macOS - Linux -The profiler uses [async-profiler](https://github.com/async-profiler/async-profiler) under the hood to collect profiling data. +The profiler uses [async-profiler](https://github.com/async-profiler/async-profiler) under the hood to collect profiling data. diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index f8cb98bed7700..a27b47d8a0666 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -548,7 +548,7 @@ The sample rate for replays that are recorded when an error happens. This type o ## Profiling Options - + A number between `0` and `1` that sets the percentage of how many sessions should have profiling enabled. `1.0` enables profiling in every session, `0.5` enables profiling for 50% of the sessions, and `0` enables it for none. The sampling decision is made once at the beginning of a session. This option is required to enable profiling. @@ -564,7 +564,7 @@ The sample rate for replays that are recorded when an error happens. This type o - + Determines how profiling sessions are controlled. It has two modes: @@ -576,7 +576,7 @@ Determines how profiling sessions are controlled. It has two modes: - **Deprecated:** Use `profileSessionSampleRate` instead to configure continuous profiling. + **Deprecated:** Use `profileSessionSampleRate` instead to configure continuous profiling from version 10.27.0 onwards. A number between `0` and `1`, controlling the percentage chance a given sampled transaction will be profiled. (`0` represents 0% while `1` represents 100%.) Applies equally to all transactions created in the app. This is relative to the tracing sample rate - e.g. `0.5` means 50% of sampled transactions will be profiled. diff --git a/docs/platforms/python/profiling/index.mdx b/docs/platforms/python/profiling/index.mdx index 06c0fb4594fd8..d559abee02dcd 100644 --- a/docs/platforms/python/profiling/index.mdx +++ b/docs/platforms/python/profiling/index.mdx @@ -20,7 +20,7 @@ Continuous profiling is available starting in SDK version `2.24.1`. -Continuous profiling supports two modes - `manual` and `trace`. The two modes are mutually exclusive, and cannot be used at the same time. +Continuous Profiling supports two modes: `manual` and `trace`. These modes are mutually exclusive and cannot be used at the same time. In `manual` mode, the profiling data collection can be managed via calls to `sentry_sdk.profiler.start_profiler` and `sentry_sdk.profiler.stop_profiler`. You are entirely in control of when the profiler runs. diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx index f12eb3c2a0859..2813d42b70d33 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx @@ -16,7 +16,8 @@ Sentry.init({ // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], - // Set profileSessionSampleRate to 1.0 to enable profiling during every user session. + // Set profileSessionSampleRate to 1.0 to profile during every session. + // The decision, whether to profile or not, is made once per session (when the SDK is initialized). profileSessionSampleRate: 1.0, }); ``` diff --git a/platform-includes/profiling/browser-profiling/javascript.mdx b/platform-includes/profiling/browser-profiling/javascript.mdx index f1510c60b4072..cf860b9adbcf2 100644 --- a/platform-includes/profiling/browser-profiling/javascript.mdx +++ b/platform-includes/profiling/browser-profiling/javascript.mdx @@ -54,11 +54,11 @@ When you enable `browserProfilingIntegration` in your SDK configuration, Chrome ## Profiling Modes -Profiling supports two modes - `manual` and `trace`. The two modes are mutually exclusive, and cannot be used at the same time. +Profiling supports two modes: `manual` and `trace`. These modes are mutually exclusive and cannot be used at the same time. -In `manual` mode, the profiling data collection can be managed via calls to `Sentry.uiProfiler.startProfiler` and `Sentry.uiProfiler.stopProfiler`. You are entirely in the in control of when the profiler runs. +In `manual` mode, you can manage the profiling data collection via calls to `Sentry.uiProfiler.startProfiler` and `Sentry.uiProfiler.stopProfiler`. You have full control over when the profiler runs. -In `trace` mode, the profiler manages its own start and stop calls, which are based on spans: the profiler continues to run while there is at least one active span, and stops when there are no active spans. +In `trace` mode, the profiler manages its own start and stop calls based on spans. It continues to run while at least one span is active, and stops when there are no active spans. ### Manual Lifecycle Profiling diff --git a/platform-includes/profiling/node-profiling/javascript.mdx b/platform-includes/profiling/node-profiling/javascript.mdx index eb2ef86f13b80..9598315f8225e 100644 --- a/platform-includes/profiling/node-profiling/javascript.mdx +++ b/platform-includes/profiling/node-profiling/javascript.mdx @@ -26,7 +26,7 @@ The version of the `@sentry/profiling-node` package must match the version of th ## Enabling Profiling -Profiling supports two modes - `manual` and `trace`. The two modes are mutually exclusive, and cannot be used at the same time. +Profiling supports two modes: `manual` and `trace`. These modes are mutually exclusive and cannot be used at the same time. In `manual` mode, the profiling data collection can be managed via calls to `Sentry.profiler.startProfiler` and `Sentry.profiler.stopProfiler`. You are entirely in the in control of when the profiler runs.