From c4d4bc070c0fe5acda7f9d01cc11d25cf9287a58 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Tue, 19 Nov 2024 13:07:27 +0100 Subject: [PATCH 1/8] add instructions to setup Android continuous profiling --- .../android/configuration/options.mdx | 4 ++-- docs/platforms/android/index.mdx | 8 ++++++-- docs/platforms/android/profiling/index.mdx | 20 +++++++++++++++++++ .../apple/common/profiling/index.mdx | 4 ++-- .../explore/profiling/getting-started.mdx | 1 + 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/docs/platforms/android/configuration/options.mdx b/docs/platforms/android/configuration/options.mdx index 69ece2608b43d..5bece1718b135 100644 --- a/docs/platforms/android/configuration/options.mdx +++ b/docs/platforms/android/configuration/options.mdx @@ -306,13 +306,13 @@ Set this boolean to `false` to disable tracing for `OPTIONS` requests. This opti -A number between 0 and 1, controlling the percentage chance a given profile will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies only to sampled transactions created in the app. Either this or must be defined to enable profiling. +A number between 0 and 1, controlling the percentage chance a given profile will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies only to sampled transactions created in the app. Either this or must be defined to enable transaction profiling. Don't set it if you want to use Continuous Profiling. -A function responsible for determining the percentage chance a given profile will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering profiles, by returning 0 for those that are unwanted. Either this or must be defined to enable profiling. +A function responsible for determining the percentage chance a given profile will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering profiles, by returning 0 for those that are unwanted. Either this or must be defined to enable transaction profiling. Don't set it if you want to use Continuous Profiling. diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index 787414f7a18c7..3113a67edd595 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -71,8 +71,6 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp - - ``` @@ -89,11 +87,14 @@ import io.sentry.Sentry; public class MyActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + // Any code running after this line will be profiled until Sentry.stopProfiler() is called. + Sentry.startProfiler(); try { throw new Exception("This is a test."); } catch (Exception e) { Sentry.captureException(e); } + Sentry.stopProfiler(); } } ``` @@ -106,11 +107,14 @@ import io.sentry.Sentry class MyActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + // Any code running after this line will be profiled until Sentry.stopProfiler() is called. + Sentry.startProfiler() try { throw Exception("This is a test.") } catch (e: Exception) { Sentry.captureException(e) } + Sentry.stopProfiler() } } ``` diff --git a/docs/platforms/android/profiling/index.mdx b/docs/platforms/android/profiling/index.mdx index f9196139bc306..733a9fbfa57c6 100644 --- a/docs/platforms/android/profiling/index.mdx +++ b/docs/platforms/android/profiling/index.mdx @@ -64,3 +64,23 @@ The SDK won't run app start profiling the very first time the app runs, as the S The SDK will set the `isForNextAppStart` flag in `TransactionContext` if app start profiling is enabled. + +## Continuous Profiling + + + +This feature is experimental and may have bugs. + + + +_(New in version 8.0.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 `Sentry.startTransaction`. Now, you can start and stop the profiler directly with `Sentry.startProfiler` and `Sentry.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppStartProfiling = true` in your call to `SentryAndroid.init`. + +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 call sites. + +Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024. diff --git a/docs/platforms/apple/common/profiling/index.mdx b/docs/platforms/apple/common/profiling/index.mdx index 52803d47e39b1..ec8bd088de530 100644 --- a/docs/platforms/apple/common/profiling/index.mdx +++ b/docs/platforms/apple/common/profiling/index.mdx @@ -109,10 +109,10 @@ _(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`. +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. +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 call sites. Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024. diff --git a/docs/product/explore/profiling/getting-started.mdx b/docs/product/explore/profiling/getting-started.mdx index fc4764c425c6a..82caf0faa199e 100644 --- a/docs/product/explore/profiling/getting-started.mdx +++ b/docs/product/explore/profiling/getting-started.mdx @@ -36,6 +36,7 @@ Profiling depends on Sentry's performance monitoring product being enabled befor - Mobile + - [Android](/platforms/android/profiling/#continuous-profiling) - [iOS and macOS](/platforms/apple/guides/ios/profiling/#continuous-profiling) - Standalone and server apps - [Node.js](/platforms/javascript/guides/node/profiling/#enable-continuous-profiling) From 231472edbb4d70d4d80df917aadef8e2a1a75389 Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 21 Nov 2024 11:40:15 +0100 Subject: [PATCH 2/8] Apply suggestions from code review Co-authored-by: Alex Krawiec --- docs/platforms/android/index.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index 3113a67edd595..e81babb96aec5 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -87,7 +87,8 @@ import io.sentry.Sentry; public class MyActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - // Any code running after this line will be profiled until Sentry.stopProfiler() is called. + // Any code running after this line will be + //profiled until Sentry.stopProfiler() is called. Sentry.startProfiler(); try { throw new Exception("This is a test."); @@ -107,7 +108,8 @@ import io.sentry.Sentry class MyActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - // Any code running after this line will be profiled until Sentry.stopProfiler() is called. + // Any code running after this line will be + //profiled until Sentry.stopProfiler() is called. Sentry.startProfiler() try { throw Exception("This is a test.") From 7752f7f0495841dab16f9345b65e4033e95e7f67 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Fri, 7 Mar 2025 11:24:56 +0100 Subject: [PATCH 3/8] updated Android continuous profiling docs with new options and APIs --- .../android/configuration/options.mdx | 32 +++++++++++++++++++ docs/platforms/android/index.mdx | 24 ++++++++------ docs/platforms/android/profiling/index.mdx | 6 ++-- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/docs/platforms/android/configuration/options.mdx b/docs/platforms/android/configuration/options.mdx index 424d4d8636027..b48e78880d70c 100644 --- a/docs/platforms/android/configuration/options.mdx +++ b/docs/platforms/android/configuration/options.mdx @@ -320,3 +320,35 @@ A function responsible for determining the percentage chance a given profile wil A boolean value that determines whether the app start process will be profiled. When true, the startup process, including ContentProviders, Application and first Activity creation, will be profiled. Note that or must be defined. + +## Continuous Profiling Options + + + +This feature is experimental and may have bugs. + + + + + +A number between `0` and `1`, controlling the percentage chance the session will be profiled. `0` represents 0% while `1` represents 100%. The default is null (disabled). and must not be set to enable Continuous Profiling. + + + + + +Whether the profiling lifecycle is controlled manually or based on the trace lifecycle. Possible values are: + +- `manual`: **default** Profiler must be started and stopped through `Sentry.startProfileSession()` and `Sentry.stopProfileSession()` APIs +- `trace`: Profiler is started and stopped automatically whenever a sampled trace starts and finishes + + + + + +A boolean value that determines whether the app start process will be profiled. When true, the startup process, including ContentProviders, Application and first Activity creation, will be profiled. Note that must be defined. + +- If profileLifecycle is set to `manual`: profiling is started automatically on startup and stopProfileSession must be called manually whenever the app startup is deemed to be completed +- If profileLifecycle is set to `trace`: profiling is started automatically on startup, and will automatically be stopped when the root span that is associated with app startup ends + + diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index 93cb60660b06c..4cbbe9724f9ab 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -80,8 +80,14 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp - + + + + + + + ``` @@ -98,15 +104,15 @@ import io.sentry.Sentry; public class MyActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - // Any code running after this line will be - //profiled until Sentry.stopProfiler() is called. - Sentry.startProfiler(); + // Any code running after this line will be + //profiled until Sentry.stopProfileSession() is called. + Sentry.startProfileSession(); try { throw new Exception("This is a test."); } catch (Exception e) { Sentry.captureException(e); } - Sentry.stopProfiler(); + Sentry.stopProfileSession(); } } ``` @@ -119,15 +125,15 @@ import io.sentry.Sentry class MyActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - // Any code running after this line will be - //profiled until Sentry.stopProfiler() is called. - Sentry.startProfiler() + // Any code running after this line will be + //profiled until Sentry.stopProfileSession() is called. + Sentry.startProfileSession() try { throw Exception("This is a test.") } catch (e: Exception) { Sentry.captureException(e) } - Sentry.stopProfiler() + Sentry.stopProfileSession() } } ``` diff --git a/docs/platforms/android/profiling/index.mdx b/docs/platforms/android/profiling/index.mdx index c7675fb63521a..983438480b5c8 100644 --- a/docs/platforms/android/profiling/index.mdx +++ b/docs/platforms/android/profiling/index.mdx @@ -81,10 +81,10 @@ _(New in version 8.0.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 `Sentry.startTransaction`. Now, you can start and stop the profiler directly with `Sentry.startProfiler` and `Sentry.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.enableAppStartProfiling = true` in your call to `SentryAndroid.init`. +Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `Sentry.startTransaction`. Now, you can start and stop the profiler directly with `Sentry.startProfileSession` and `Sentry.stopProfileSession`. You can also start a profile at app launch by setting `SentryOptions.startProfilerOnAppStart = true` in your call to `SentryAndroid.init`. -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. +Continuous profiling mode is disabled by default, requiring only the `SentryOptions.profileSessionSampleRate` option to be set 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 call sites. +There are two ways to start the profiler: manually, calling `Sentry.startProfileSession` and `Sentry.stopProfileSession` to start and stop the profiler, or automatically whenever a sampled trace starts and finishes. The latter behaviour is very similar to the current profiling implementation. You can control this behaviour setting `SentryOptions.profileLifecycle` to `manual` or `trace` in your call to `SentryAndroid.init`. 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 d3299e749cc761add7a94d3cb0771164e316cf29 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Wed, 19 Mar 2025 13:30:48 +0100 Subject: [PATCH 4/8] added code sample updated SDK version updated API names --- .../android/configuration/options.mdx | 4 +- docs/platforms/android/index.mdx | 12 ++-- docs/platforms/android/profiling/index.mdx | 64 +++++++++++++++++-- 3 files changed, 68 insertions(+), 12 deletions(-) diff --git a/docs/platforms/android/configuration/options.mdx b/docs/platforms/android/configuration/options.mdx index 4d87ba9decf89..8854596a5a0b8 100644 --- a/docs/platforms/android/configuration/options.mdx +++ b/docs/platforms/android/configuration/options.mdx @@ -339,7 +339,7 @@ A number between `0` and `1`, controlling the percentage chance the session will Whether the profiling lifecycle is controlled manually or based on the trace lifecycle. Possible values are: -- `manual`: **default** Profiler must be started and stopped through `Sentry.startProfileSession()` and `Sentry.stopProfileSession()` APIs +- `manual`: **default** Profiler must be started and stopped through `Sentry.startProfiler()` and `Sentry.stopProfiler()` APIs - `trace`: Profiler is started and stopped automatically whenever a sampled trace starts and finishes @@ -348,7 +348,7 @@ Whether the profiling lifecycle is controlled manually or based on the trace lif A boolean value that determines whether the app start process will be profiled. When true, the startup process, including ContentProviders, Application and first Activity creation, will be profiled. Note that must be defined. -- If profileLifecycle is set to `manual`: profiling is started automatically on startup and stopProfileSession must be called manually whenever the app startup is deemed to be completed +- If profileLifecycle is set to `manual`: profiling is started automatically on startup and stopProfiler must be called manually whenever the app startup is deemed to be completed - If profileLifecycle is set to `trace`: profiling is started automatically on startup, and will automatically be stopped when the root span that is associated with app startup ends diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index 4cbbe9724f9ab..208e11ec66cc1 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -105,14 +105,14 @@ public class MyActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Any code running after this line will be - //profiled until Sentry.stopProfileSession() is called. - Sentry.startProfileSession(); + //profiled until Sentry.stopProfiler() is called. + Sentry.startProfiler(); try { throw new Exception("This is a test."); } catch (Exception e) { Sentry.captureException(e); } - Sentry.stopProfileSession(); + Sentry.stopProfiler(); } } ``` @@ -126,14 +126,14 @@ class MyActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // Any code running after this line will be - //profiled until Sentry.stopProfileSession() is called. - Sentry.startProfileSession() + //profiled until Sentry.stopProfiler() is called. + Sentry.startProfiler() try { throw Exception("This is a test.") } catch (e: Exception) { Sentry.captureException(e) } - Sentry.stopProfileSession() + Sentry.stopProfiler() } } ``` diff --git a/docs/platforms/android/profiling/index.mdx b/docs/platforms/android/profiling/index.mdx index 983438480b5c8..36d943c18601b 100644 --- a/docs/platforms/android/profiling/index.mdx +++ b/docs/platforms/android/profiling/index.mdx @@ -77,14 +77,70 @@ This feature is experimental and may have bugs. -_(New in version 8.0.0)_ +_(New in version 8.5.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 `Sentry.startTransaction`. Now, you can start and stop the profiler directly with `Sentry.startProfileSession` and `Sentry.stopProfileSession`. You can also start a profile at app launch by setting `SentryOptions.startProfilerOnAppStart = true` in your call to `SentryAndroid.init`. +Previously, profiles only ran in tandem with performance transactions that were started either automatically or manually with `Sentry.startTransaction`. Now, you can start and stop the profiler directly with `Sentry.startProfiler` and `Sentry.stopProfiler`. You can also start a profile at app launch by setting `SentryOptions.startProfilerOnAppStart = true` in your call to `SentryAndroid.init`. -Continuous profiling mode is disabled by default, requiring only the `SentryOptions.profileSessionSampleRate` option to be set 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. +Continuous profiling requires only the `SentryOptions.profileSessionSampleRate` option to be set 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. -There are two ways to start the profiler: manually, calling `Sentry.startProfileSession` and `Sentry.stopProfileSession` to start and stop the profiler, or automatically whenever a sampled trace starts and finishes. The latter behaviour is very similar to the current profiling implementation. You can control this behaviour setting `SentryOptions.profileLifecycle` to `manual` or `trace` in your call to `SentryAndroid.init`. +There are two ways to start the profiler: manually, calling `Sentry.startProfiler` and `Sentry.stopProfiler` to start and stop the profiler, or automatically whenever a sampled trace starts and finishes. The latter behaviour is very similar to the current profiling implementation. You can control this behaviour setting `SentryOptions.profileLifecycle` to `manual` or `trace` in your call to `SentryAndroid.init`. Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024. + +```xml {filename:AndroidManifest.xml} + + + + + +``` + +Or, if you are manually instrumenting Sentry: + + +```java {tabTitle:Java} +import io.sentry.android.core.SentryAndroid; + +SentryAndroid.init(this, options -> { + options.setDsn("___PUBLIC_DSN___"); + // Currently under experimental options: + options.getExperimental().setProfileSessionSampleRate(1.0); + // In manual mode, you need to start and stop the profiler manually using Sentry.startProfiler and Sentry.stopProfiler + // In trace mode, the profiler will start and stop automatically whenever a sampled trace starts and finishes + options.getExperimental().setProfileLifecycle(ProfileLifecycle.MANUAL); + // Start profiling automatically as early as possible, to capture app startup + // If profileLifecycle is set to `manual`: stopProfiler must be called manually when the app startup is completed + // If profileLifecycle is set to `trace`: profiling will automatically be stopped when the app start root span ends + options.getExperimental().setStartProfilerOnAppStart(true); +}); +// Start profiling +Sentry.startProfiler(); + +// After all profiling is done, stop the profiler. Profiles can last indefinitely if not stopped. +Sentry.stopProfiler(); +``` + +```kotlin {tabTitle:Kotlin} +import io.sentry.android.core.SentryAndroid +import io.sentry.SentryOptions.TracesSamplerCallback + +SentryAndroid.init(this) { options -> + options.dsn = "___PUBLIC_DSN___" + // Currently under experimental options: + options.experimental.profileSessionSampleRate = 1.0 + // In manual mode, you need to start and stop the profiler manually using Sentry.startProfiler and Sentry.stopProfiler + // In trace mode, the profiler will start and stop automatically whenever a sampled trace starts and finishes + options.experimental.profileLifecycle = ProfileLifecycle.MANUAL + // Start profiling automatically as early as possible, to capture app startup + // If profileLifecycle is set to `manual`: stopProfiler must be called manually when the app startup is completed + // If profileLifecycle is set to `trace`: profiling will automatically be stopped when the app start root span ends + options.experimental.startProfilerOnAppStart = true +} +// Start profiling +Sentry.startProfiler() + +// After all profiling is done, stop the profiler. Profiles can last indefinitely if not stopped. +Sentry.stopProfiler() +``` From 067f3584d8f67c3f1175808b1971da68361c6a44 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Tue, 25 Mar 2025 11:56:56 +0100 Subject: [PATCH 5/8] merged main fixed onboarding Added billing note as an Alert --- docs/platforms/android/profiling/index.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/platforms/android/profiling/index.mdx b/docs/platforms/android/profiling/index.mdx index 36d943c18601b..35059a29df6cd 100644 --- a/docs/platforms/android/profiling/index.mdx +++ b/docs/platforms/android/profiling/index.mdx @@ -87,8 +87,12 @@ Continuous profiling requires only the `SentryOptions.profileSessionSampleRate` There are two ways to start the profiler: manually, calling `Sentry.startProfiler` and `Sentry.stopProfiler` to start and stop the profiler, or automatically whenever a sampled trace starts and finishes. The latter behaviour is very similar to the current profiling implementation. You can control this behaviour setting `SentryOptions.profileLifecycle` to `manual` or `trace` in your call to `SentryAndroid.init`. + + Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024. + + ```xml {filename:AndroidManifest.xml} From 9170c639d9b31e005d5ad3fd4e80413b7c69cbe7 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Tue, 25 Mar 2025 14:22:36 +0100 Subject: [PATCH 6/8] removed profiling code from platform page --- docs/platforms/android/index.mdx | 4 ---- docs/platforms/android/profiling/index.mdx | 1 - 2 files changed, 5 deletions(-) diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index e268a66b3cd9f..172d5fef28234 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -108,15 +108,11 @@ import io.sentry.Sentry; public class MyActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - // Any code running after this line will be - //profiled until Sentry.stopProfiler() is called. - Sentry.startProfiler(); try { throw new Exception("This is a test."); } catch (Exception e) { Sentry.captureException(e); } - Sentry.stopProfiler(); } } ``` diff --git a/docs/platforms/android/profiling/index.mdx b/docs/platforms/android/profiling/index.mdx index 35059a29df6cd..beba0bad91fd6 100644 --- a/docs/platforms/android/profiling/index.mdx +++ b/docs/platforms/android/profiling/index.mdx @@ -128,7 +128,6 @@ Sentry.stopProfiler(); ```kotlin {tabTitle:Kotlin} import io.sentry.android.core.SentryAndroid -import io.sentry.SentryOptions.TracesSamplerCallback SentryAndroid.init(this) { options -> options.dsn = "___PUBLIC_DSN___" From af8d9317ef1f04943d5cedc5ddba0703505a4b19 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Tue, 25 Mar 2025 14:37:14 +0100 Subject: [PATCH 7/8] removed profiling code from platform page --- docs/platforms/android/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index 172d5fef28234..dfb2e9eea34ca 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -83,7 +83,7 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp - + From b141c6dd0dfb905bce4d578a7c7f00b0ed34eba0 Mon Sep 17 00:00:00 2001 From: stefanosiano Date: Tue, 25 Mar 2025 14:38:19 +0100 Subject: [PATCH 8/8] readded profiling code snippet --- docs/platforms/android/index.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index dfb2e9eea34ca..d84d9c6fd86ed 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -108,11 +108,15 @@ import io.sentry.Sentry; public class MyActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + // Any code running after this line will be + //profiled until Sentry.stopProfiler() is called. + Sentry.startProfiler(); try { throw new Exception("This is a test."); } catch (Exception e) { Sentry.captureException(e); } + Sentry.stopProfiler(); } } ```