From e9afc963d7a2ac0cb743a81fc5b4e9d8b5a45742 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 15 May 2024 16:26:36 -0800 Subject: [PATCH 1/7] feat: add explainer on continuous profiling and show how to enable it --- docs/platforms/apple/common/profiling/index.mdx | 16 ++++++++++++++++ .../basic-config/apple.mdx | 2 ++ 2 files changed, 18 insertions(+) diff --git a/docs/platforms/apple/common/profiling/index.mdx b/docs/platforms/apple/common/profiling/index.mdx index edd4e6acdf488..995ba1fda7b72 100644 --- a/docs/platforms/apple/common/profiling/index.mdx +++ b/docs/platforms/apple/common/profiling/index.mdx @@ -90,3 +90,19 @@ To set up launch profiling, use the `enableAppLaunchProfiling` option and config If you use `SentryOptions.tracesSampler` or `SentryOptions.profilesSampler`, it will be invoked after you call `SentrySDK.startWithOptions`, with `SentryTransactionContext.forNextAppLaunch` set to `true` indicating that it's evaluating a launch profile sampling decision. If instead you simply set `SentryOptions.tracesSampleRate` and `SentryOptions.profilesSampleRate`, those numerical rates will be used directly. Currently, launch profiles are attached to a special performance transaction operation called `app.launch` and displayed in the product simply as `launch`. + +## Continuous Profiling + + + +This feature is experimental and may have bugs. + + + +The current profiling implementation stops the profiler automatically after 30 seconds, if you do not stop it earlier. Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit to how long the profiler may run. + +Whereas profiles previously only ran in tandem with a performance transaction that you'd either start manually with `SentrySDK.startTransaction` or with an automatic transaction, now you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. Launch profiling is another way to start it, by simply setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`. + +These new APIs do not offer any sampling functionality–every call to start the profiler will start it, and the same goes for launch profiles if you've configured that. If you are interested in reducing the amount of profiles that run, you must take care to do it at the callsites. + +Continuous profiling has implications for your org's billing structure. You must be enrolled in AM3 billing to see this data on your dashboard. \ No newline at end of file diff --git a/platform-includes/getting-started-config/basic-config/apple.mdx b/platform-includes/getting-started-config/basic-config/apple.mdx index 4ac36f9cca4ec..5ab78cf843812 100644 --- a/platform-includes/getting-started-config/basic-config/apple.mdx +++ b/platform-includes/getting-started-config/basic-config/apple.mdx @@ -16,6 +16,7 @@ SentrySDK.start { options in options.enableTimeToFullDisplayTracing = true options.swiftAsyncStacktraces = true options.enableAppLaunchProfiling = true + options.enableContinuousProfiling = true } ``` @@ -31,6 +32,7 @@ SentrySDK.start { options in options.enableTimeToFullDisplayTracing = YES; options.swiftAsyncStacktraces = YES; options.enableAppLaunchProfiling = YES; + options.enableContinuousProfiling = YES; }]; ``` From 86d86851b58ca4ffd9541cb9e75507d2246c86a0 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Fri, 14 Jun 2024 09:08:11 -0800 Subject: [PATCH 2/7] Apply suggestions from code review Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/apple/common/profiling/index.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/platforms/apple/common/profiling/index.mdx b/docs/platforms/apple/common/profiling/index.mdx index 995ba1fda7b72..3d4db88d0bcde 100644 --- a/docs/platforms/apple/common/profiling/index.mdx +++ b/docs/platforms/apple/common/profiling/index.mdx @@ -99,10 +99,10 @@ This feature is experimental and may have bugs. -The current profiling implementation stops the profiler automatically after 30 seconds, if you do not stop it earlier. Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit to how long the profiler may run. +The current profiling implementation stops the profiler automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit to how long the profiler may run. -Whereas profiles previously only ran in tandem with a performance transaction that you'd either start manually with `SentrySDK.startTransaction` or with an automatic transaction, now you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. Launch profiling is another way to start it, by simply setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`. +Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `SentrySDK.startTransaction`. Now, you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`. -These new APIs do not offer any sampling functionality–every call to start the profiler will start it, and the same goes for launch profiles if you've configured that. If you are interested in reducing the amount of profiles that run, you must take care to do it at the callsites. +These new APIs do not offer any sampling functionality—every call to start the profiler will start it, and the same goes for launch profiles if you've configured that. If you are interested in reducing the amount of profiles that run, you must take care to do it at the callsites. -Continuous profiling has implications for your org's billing structure. You must be enrolled in AM3 billing to see this data on your dashboard. \ No newline at end of file +Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024. \ No newline at end of file From c79cab2d47f7453f2ac3b1da351c9e8164a11c3d Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 29 Jul 2024 14:35:37 -0800 Subject: [PATCH 3/7] demonstrate how to enable continuous profiling --- docs/platforms/apple/common/features/experimental-features.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/platforms/apple/common/features/experimental-features.mdx b/docs/platforms/apple/common/features/experimental-features.mdx index c66608064fe5d..05ae918fdf4d1 100644 --- a/docs/platforms/apple/common/features/experimental-features.mdx +++ b/docs/platforms/apple/common/features/experimental-features.mdx @@ -27,6 +27,7 @@ SentrySDK.start { options in options.enableTimeToFullDisplayTracing = true options.enableAppLaunchProfiling = true options.swiftAsyncStacktraces = true + options.profilesSampleRate = nil // enable continuous profiling mode } ``` @@ -40,6 +41,7 @@ SentrySDK.start { options in options.enableTimeToFullDisplayTracing = YES; options.enableAppLaunchProfiling = YES; options.swiftAsyncStacktraces = YES; // only applies to async code in Swift + options.profilesSampleRate = nil; // enable continuous profiling mode }]; ``` From eab27e591192fd1ba77b1d8691222f667fdfad7e Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Wed, 31 Jul 2024 16:12:15 -0800 Subject: [PATCH 4/7] update explanations and usage examples --- docs/platforms/apple/common/features/experimental-features.mdx | 1 + docs/platforms/apple/common/profiling/index.mdx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/platforms/apple/common/features/experimental-features.mdx b/docs/platforms/apple/common/features/experimental-features.mdx index 05ae918fdf4d1..2437f63e22923 100644 --- a/docs/platforms/apple/common/features/experimental-features.mdx +++ b/docs/platforms/apple/common/features/experimental-features.mdx @@ -11,6 +11,7 @@ Do you want to try some new experimental features? On the latest version of the - Enable App Launch Profiling to get detailed profiles for your app launches. - If you use Swift concurrency, stitch together stack traces of your async code with the `swiftAsyncStacktraces` option. Note that you can enable this in your Objective-C project, but only async code written in Swift will be stitched together. +- Enable Continuous Profiling to get full coverage of your app's execution. Experimental features are still a work-in-progress and may have bugs. We diff --git a/docs/platforms/apple/common/profiling/index.mdx b/docs/platforms/apple/common/profiling/index.mdx index bd2e6c4d03cb6..050471df717ef 100644 --- a/docs/platforms/apple/common/profiling/index.mdx +++ b/docs/platforms/apple/common/profiling/index.mdx @@ -109,7 +109,7 @@ This feature is experimental and may have bugs. The current profiling implementation stops the profiler automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit to how long the profiler may run. -Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `SentrySDK.startTransaction`. Now, you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`. +Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `SentrySDK.startTransaction`. Now, you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`. Continuous profiling mode is enabled by default, requiring no changes to `SentryOptions` when you start the SDK to opt in. If you had previously set `SentryOptions.profilesSampleRate` or `SentryOptions.profilesSampler` to use transaction-based profiling, then remove those lines of code from your configuration. These new APIs do not offer any sampling functionality—every call to start the profiler will start it, and the same goes for launch profiles if you've configured that. If you are interested in reducing the amount of profiles that run, you must take care to do it at the callsites. From 790a58522128bedc03c696ade09702283ffefc6c Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 26 Aug 2024 12:00:41 -0800 Subject: [PATCH 5/7] Update docs/platforms/apple/common/features/experimental-features.mdx Co-authored-by: Karl Heinz Struggl --- docs/platforms/apple/common/features/experimental-features.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/apple/common/features/experimental-features.mdx b/docs/platforms/apple/common/features/experimental-features.mdx index 2437f63e22923..6ee713e6dac55 100644 --- a/docs/platforms/apple/common/features/experimental-features.mdx +++ b/docs/platforms/apple/common/features/experimental-features.mdx @@ -9,9 +9,9 @@ Do you want to try some new experimental features? On the latest version of the - Enable Time to Full Display (TTFD) to gain insight into how long it takes your view controller to launch and load all of its content. - Enable App Launch Profiling to get detailed profiles for your app launches. +- Enable Continuous Profiling to get full coverage of your app's execution. - If you use Swift concurrency, stitch together stack traces of your async code with the `swiftAsyncStacktraces` option. Note that you can enable this in your Objective-C project, but only async code written in Swift will be stitched together. -- Enable Continuous Profiling to get full coverage of your app's execution. Experimental features are still a work-in-progress and may have bugs. We From fe416ffcd2dd4769a8a7d1df7981612bf4422a7c Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 26 Aug 2024 12:11:17 -0800 Subject: [PATCH 6/7] add availability note --- docs/platforms/apple/common/profiling/index.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/platforms/apple/common/profiling/index.mdx b/docs/platforms/apple/common/profiling/index.mdx index 050471df717ef..6eb641902efb7 100644 --- a/docs/platforms/apple/common/profiling/index.mdx +++ b/docs/platforms/apple/common/profiling/index.mdx @@ -107,10 +107,12 @@ This feature is experimental and may have bugs. +_(New in version 8.36.0)_ + The current profiling implementation stops the profiler automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit to how long the profiler may run. Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `SentrySDK.startTransaction`. Now, you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`. Continuous profiling mode is enabled by default, requiring no changes to `SentryOptions` when you start the SDK to opt in. If you had previously set `SentryOptions.profilesSampleRate` or `SentryOptions.profilesSampler` to use transaction-based profiling, then remove those lines of code from your configuration. These new APIs do not offer any sampling functionality—every call to start the profiler will start it, and the same goes for launch profiles if you've configured that. If you are interested in reducing the amount of profiles that run, you must take care to do it at the callsites. -Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024. \ No newline at end of file +Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024. From f5ad24a8b5ca215114a0c17cc1d3100aa69e6ead Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Mon, 26 Aug 2024 13:00:58 -0800 Subject: [PATCH 7/7] Update index.mdx --- docs/platforms/apple/common/profiling/index.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/platforms/apple/common/profiling/index.mdx b/docs/platforms/apple/common/profiling/index.mdx index 6eb641902efb7..eadd657f5c429 100644 --- a/docs/platforms/apple/common/profiling/index.mdx +++ b/docs/platforms/apple/common/profiling/index.mdx @@ -111,7 +111,9 @@ _(New in version 8.36.0)_ The current profiling implementation stops the profiler automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit to how long the profiler may run. -Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `SentrySDK.startTransaction`. Now, you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`. Continuous profiling mode is enabled by default, requiring no changes to `SentryOptions` when you start the SDK to opt in. If you had previously set `SentryOptions.profilesSampleRate` or `SentryOptions.profilesSampler` to use transaction-based profiling, then remove those lines of code from your configuration. +Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `SentrySDK.startTransaction`. Now, you can start and stop the profiler directly with `SentrySDK.startProfiler` and `SentrySDK.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppLaunchProfiling = true` in your call to `SentrySDK.startWithOptions`. + +Continuous profiling mode is enabled by default, requiring no changes to `SentryOptions` when you start the SDK to opt in. If you had previously set `SentryOptions.profilesSampleRate` or `SentryOptions.profilesSampler` to use transaction-based profiling, then remove those lines of code from your configuration. These new APIs do not offer any sampling functionality—every call to start the profiler will start it, and the same goes for launch profiles if you've configured that. If you are interested in reducing the amount of profiles that run, you must take care to do it at the callsites.