From 7562ee835c5484aeca9e4f67a62986dac17a43a1 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 26 May 2026 10:51:19 +0200 Subject: [PATCH 1/3] docs(android): Add standalone app start tracing docs Document the experimental Android option for sending app starts as standalone transactions and show how to sample app.start transactions independently. Co-authored-by: Cursor --- .../android/configuration/options.mdx | 10 +++ .../automatic-instrumentation.mdx | 77 ++++++++++++++++++- 2 files changed, 86 insertions(+), 1 deletion(-) diff --git a/docs/platforms/android/configuration/options.mdx b/docs/platforms/android/configuration/options.mdx index 656f5dff93aab..2aac6a9746d02 100644 --- a/docs/platforms/android/configuration/options.mdx +++ b/docs/platforms/android/configuration/options.mdx @@ -319,6 +319,16 @@ A function responsible for determining the percentage chance a given transaction + + +When enabled, the SDK sends app start data as a standalone `App Start` transaction with operation `app.start` instead of attaching it as `app.start.cold` or `app.start.warm` child spans to the first Activity `ui.load` transaction. This makes app starts easier to find, sample, and analyze independently. + +AndroidManifest.xml key: `io.sentry.standalone-app-start-tracing.enable`. + +Learn more in the Standalone App Start Tracing documentation. + + + An optional property that controls which downstream services receive tracing data, in the form of a `sentry-trace` and a `baggage` header attached to any outgoing HTTP requests. diff --git a/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx index 1b7026e1ce41c..257d0ed331e16 100644 --- a/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx +++ b/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx @@ -159,6 +159,79 @@ You can opt out of Activity Instrumentation and App Start Instrumentation using Cold and warm start are Mobile Vitals, which you can learn about in the [full documentation](/product/dashboards/sentry-dashboards/mobile/mobile-vitals). +### Standalone App Start Tracing + + + +This feature is experimental. + + + +By default, the SDK attaches app start data as spans to the first Activity `ui.load` transaction. With standalone app start tracing enabled, the SDK sends a dedicated `App Start` transaction with operation `app.start` instead. When an Activity starts, this transaction shares the same trace ID as the Activity `ui.load` transaction. + +Standalone app start tracing can also report app starts that don't launch an Activity, such as starts from broadcast receivers, foreground services, or content providers. If `Application.onCreate` instrumentation isn't available, these transactions may include fewer phase spans. + +To enable standalone app start tracing: + +```xml {filename:AndroidManifest.xml} + + + +``` + +```java {tabTitle:Java} +import io.sentry.android.core.SentryAndroid; + +SentryAndroid.init(this, options -> { + options.setDsn("___PUBLIC_DSN___"); + options.setEnableStandaloneAppStartTracing(true); +}); +``` + +```kotlin {tabTitle:Kotlin} +import io.sentry.android.core.SentryAndroid + +SentryAndroid.init(this) { options -> + options.dsn = "___PUBLIC_DSN___" + options.isEnableStandaloneAppStartTracing = true +} +``` + +Since standalone app start transactions use the `app.start` operation, you can use a custom `tracesSampler` to set a dedicated sample rate for app starts without increasing your overall sample rate: + +```java {tabTitle:Java} +import io.sentry.android.core.SentryAndroid; + +SentryAndroid.init(this, options -> { + options.setDsn("___PUBLIC_DSN___"); + options.setTracesSampleRate(0.1); + options.setEnableStandaloneAppStartTracing(true); + options.setTracesSampler(context -> { + if ("app.start".equals(context.getTransactionContext().getOperation())) { + return 1.0; + } + return null; + }); +}); +``` + +```kotlin {tabTitle:Kotlin} +import io.sentry.SentryOptions.TracesSamplerCallback +import io.sentry.android.core.SentryAndroid + +SentryAndroid.init(this) { options -> + options.dsn = "___PUBLIC_DSN___" + options.tracesSampleRate = 0.1 + options.isEnableStandaloneAppStartTracing = true + options.tracesSampler = TracesSamplerCallback { context -> + if (context.transactionContext.operation == "app.start") { + return@TracesSamplerCallback 1.0 + } + null + } +} +``` + ### Slow and Frozen Frames @@ -352,6 +425,7 @@ To change the timeouts you can: ``` + ```java import io.sentry.android.core.SentryAndroid; @@ -360,6 +434,7 @@ SentryAndroid.init(this, options -> { options.setDeadlineTimeout(0); // disable deadline timeout }); ``` + ```kotlin import io.sentry.android.core.SentryAndroid @@ -436,7 +511,7 @@ When the UI transaction is not finished yet, but the user makes a new interactio _(New in version 6.10.0)_ -By adding a span for each launch of an activity, time to initial display (TTID) provides insight into how long it takes for your activities to launch and draw their first UI frame. The SDK sets the span operation to `ui.load.initial-display` and the span description to the activity's name, followed by `initial display` - for example, `MainActivity initial display`. +By adding a span for each launch of an activity, time to initial display (TTID) provides insight into how long it takes for your activities to launch and draw their first UI frame. The SDK sets the span operation to `ui.load.initial-display` and the span description to the activity's name, followed by `initial display` - for example, `MainActivity initial display`. The span starts when each Activity is launched, which is defined as an application launch for the first Activity, and the `onPause` method of the previous Activity for each subsequent Activity launched. From 12edf819dde9ba596d71243e230b8846bc5aa1f7 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 26 May 2026 10:54:34 +0200 Subject: [PATCH 2/3] docs(android): Fix app start sampler example Use tracesSampler by itself in the standalone app start docs and return explicit sample rates for app.start and other transactions. Co-authored-by: Cursor --- .../tracing/instrumentation/automatic-instrumentation.mdx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx index 257d0ed331e16..3a2514051ff79 100644 --- a/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx +++ b/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx @@ -204,13 +204,12 @@ import io.sentry.android.core.SentryAndroid; SentryAndroid.init(this, options -> { options.setDsn("___PUBLIC_DSN___"); - options.setTracesSampleRate(0.1); options.setEnableStandaloneAppStartTracing(true); options.setTracesSampler(context -> { if ("app.start".equals(context.getTransactionContext().getOperation())) { return 1.0; } - return null; + return 0.1; }); }); ``` @@ -221,13 +220,12 @@ import io.sentry.android.core.SentryAndroid SentryAndroid.init(this) { options -> options.dsn = "___PUBLIC_DSN___" - options.tracesSampleRate = 0.1 options.isEnableStandaloneAppStartTracing = true options.tracesSampler = TracesSamplerCallback { context -> if (context.transactionContext.operation == "app.start") { return@TracesSamplerCallback 1.0 } - null + 0.1 } } ``` From a77580d9eb396295101bf535eec7b8e534674866 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Tue, 26 May 2026 11:04:18 +0200 Subject: [PATCH 3/3] docs(android): Note app start tracing is experimental Call out that standalone app start tracing is experimental in both the Android option reference and instrumentation guide. Co-authored-by: Cursor --- docs/platforms/android/configuration/options.mdx | 2 ++ .../tracing/instrumentation/automatic-instrumentation.mdx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/platforms/android/configuration/options.mdx b/docs/platforms/android/configuration/options.mdx index 2aac6a9746d02..71ed93796eb1d 100644 --- a/docs/platforms/android/configuration/options.mdx +++ b/docs/platforms/android/configuration/options.mdx @@ -321,6 +321,8 @@ A function responsible for determining the percentage chance a given transaction +This option is experimental and may change. + When enabled, the SDK sends app start data as a standalone `App Start` transaction with operation `app.start` instead of attaching it as `app.start.cold` or `app.start.warm` child spans to the first Activity `ui.load` transaction. This makes app starts easier to find, sample, and analyze independently. AndroidManifest.xml key: `io.sentry.standalone-app-start-tracing.enable`. diff --git a/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx index 3a2514051ff79..99acaee9bb2e2 100644 --- a/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx +++ b/docs/platforms/android/tracing/instrumentation/automatic-instrumentation.mdx @@ -163,7 +163,7 @@ Cold and warm start are Mobile Vitals, which you can learn about in the [full do -This feature is experimental. +This feature is experimental and may change.