From 318e453ca2b6849ea147b531ea5200568f63c98c Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Wed, 14 Oct 2026 22:04:49 +0000 Subject: [PATCH 1/3] feat(docs): Apply new quick start template to Android quick start guide Co-Authored-By: Shannon Anahata --- docs/platforms/android/index.mdx | 168 +++++++++++++++++-------------- 1 file changed, 93 insertions(+), 75 deletions(-) diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index 54974cfc7d4b8d..057187a3063989 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -1,6 +1,6 @@ --- title: Android -description: "Learn how to set up Sentry's Android SDK for error monitoring and performance tracking." +description: "Learn how to set up Sentry's Android SDK, capture your first events, and monitor performance." caseStyle: camelCase supportLevel: production sdk: sentry.java.android @@ -22,30 +22,6 @@ If you don't already have an account and Sentry project established, head over t -## Features - -In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](/product/profiling/). - -Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. - - - - - - - On Android 15 (API level 35) and higher, profiling uses the Android ProfilingManager to capture Perfetto traces. On older devices, the SDK automatically falls back to the legacy profiler. - - - - ## Install Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works. @@ -110,82 +86,124 @@ The wizard will prompt you to log in to Sentry. It'll then automatically do the ## Configure -Configuration is done via the application `AndroidManifest.xml`. Here's an example config which should get you started: +**Error Monitoring** starts working as soon as you initialize the SDK. **Logs** need `io.sentry.logs.enabled` set to `true`; **Application Metrics** are available after initialization and need no extra configuration. You'll learn how to send them in [Send Logs](#send-logs) and [Send Application Metrics](#send-application-metrics-). + +This guide also enables **Tracing**, **Profiling**, and **Session Replay**. The Android SDK also supports **User Feedback**; see Set Up User Feedback to add a feedback form to your app. +Initialize the SDK through your application's `AndroidManifest.xml`. Logs need `io.sentry.logs.enabled` set to `true`; for code-based initialization, use `options.logs.enabled = true` in Kotlin or `options.getLogs().setEnabled(true)` in Java. The snippet also turns on: + +- Tracing: via `tracesSampleRate` +- Profiling: via `profileSessionSampleRate` and `profileLifecycle` +- Session Replay: via `sessionSampleRate` and `onErrorSampleRate` in the Session Replay configuration +- Logs: via `io.sentry.logs.enabled`, described in the Logs setup + +Don't need a feature? Remove its options from the snippet. ```xml {filename:AndroidManifest.xml} - - - + + + + - - - + + - - - - - - - - + + - + + + ``` -## Verify +### Configure the Sentry Android Gradle Plugin + +The Sentry Wizard configures the Gradle plugin, which supports automatic tracing instrumentation and uploads ProGuard/R8 mappings and source context. For manual setup, see the Gradle plugin, ProGuard/R8, and source context guides. -Verify that your app is sending events to Sentry by adding the following snippet, which includes an intentional error. You should see the error reported in Sentry within a few minutes. + -```java -import androidx.appcompat.app.AppCompatActivity; -import android.os.Bundle; -import java.lang.Exception; +On Android 15 (API level 35) and higher, profiling uses the Android ProfilingManager to capture Perfetto traces. On older devices, the SDK automatically falls back to the legacy profiler. + + + +## Send Logs + +Once Logs are enabled in the manifest above, use `Sentry.logger()` to send log messages at different levels. + +```java {tabTitle: Java} import io.sentry.Sentry; -public class MyActivity extends AppCompatActivity { - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - try { - throw new Exception("This is a test."); - } catch (Exception e) { - Sentry.captureException(e); - } - } -} +Sentry.logger().info("Order processed"); +Sentry.logger().error("Payment failed"); ``` -```kotlin -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle +```kotlin {tabTitle: Kotlin} import io.sentry.Sentry -class MyActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - try { - throw Exception("This is a test.") - } catch (e: Exception) { - Sentry.captureException(e) - } - } -} +Sentry.logger().info("Order processed") +Sentry.logger().error("Payment failed") ``` +The documented Timber and Logcat integrations can also send logs when Sentry Logs are enabled. + +See Set Up Logs for all available logging methods and configuration options. + +## Send Application Metrics + +The Android SDK provides counters, gauges, and distributions through `Sentry.metrics()`. Metrics need no separate enable option and are supported in Android SDK version 8.34.0 and later. + +```java {tabTitle: Java} +import io.sentry.Sentry; + +Sentry.metrics().count("button_click", 1.0); +Sentry.metrics().gauge("queue_depth", 42.0); +Sentry.metrics().distribution("response_time", 187.5); +``` + +```kotlin {tabTitle: Kotlin} +import io.sentry.Sentry + +Sentry.metrics().count("button_click", 1.0) +Sentry.metrics().gauge("queue_depth", 42.0) +Sentry.metrics().distribution("response_time", 187.5) +``` + +See Set Up Metrics for all available metric types and configuration options. + +## Verify Your Setup + +Add an intentional error to your application to confirm that Sentry captures it: + +```java {tabTitle: Java} +import io.sentry.Sentry; + +Sentry.captureException(new Exception("This is a test.")); +``` + +```kotlin {tabTitle: Kotlin} +import io.sentry.Sentry + +Sentry.captureException(Exception("This is a test.")) +``` + +### View Captured Data in Sentry + +Open your project in Sentry and find the test error in Issues. + ## Next Steps +At this point, you should have integrated Sentry into your Android application. Here's what to explore next: + - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup -- Learn about the features of Sentry's Android SDK -- Learn how to enhance stack traces of your Sentry errors -- Enrich events with additional context to make debugging simpler -- Diagnose ANRs with profiling and automatic fingerprinting -- Monitor Memory Limiter process deaths on supported Android 17+ devices +- Enhance stack traces to + make error details more readable +- Collect User Feedback from + your users From 3647a7032e441ff310c15c2d9a883822cc064da3 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Wed, 14 Oct 2026 22:17:55 +0000 Subject: [PATCH 2/3] ref(docs): Tighten Android quick start Configure and Logs copy Co-Authored-By: Shannon Anahata --- 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 057187a3063989..a179f73910c11e 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -90,7 +90,9 @@ The wizard will prompt you to log in to Sentry. It'll then automatically do the This guide also enables **Tracing**, **Profiling**, and **Session Replay**. The Android SDK also supports **User Feedback**; see Set Up User Feedback to add a feedback form to your app. -Initialize the SDK through your application's `AndroidManifest.xml`. Logs need `io.sentry.logs.enabled` set to `true`; for code-based initialization, use `options.logs.enabled = true` in Kotlin or `options.getLogs().setEnabled(true)` in Java. The snippet also turns on: +Initialize the SDK through your application's `AndroidManifest.xml`. If you initialize the SDK in code instead, enable Logs with `options.logs.enabled = true` in Kotlin or `options.getLogs().setEnabled(true)` in Java. + +The snippet also turns on: - Tracing: via `tracesSampleRate` - Profiling: via `profileSessionSampleRate` and `profileLifecycle` @@ -152,7 +154,7 @@ Sentry.logger().info("Order processed") Sentry.logger().error("Payment failed") ``` -The documented Timber and Logcat integrations can also send logs when Sentry Logs are enabled. +If you already log with Timber or Logcat, the Timber and Logcat integrations can send those logs to Sentry too. See Set Up Logs for all available logging methods and configuration options. From 3c3c21ab9b45360eac5cd9d16b328652c0f9fb5e Mon Sep 17 00:00:00 2001 From: Shannon Anahata Date: Wed, 28 Oct 2026 17:10:25 -0700 Subject: [PATCH 3/3] fix(docs): Correct Android quick start SDK guidance --- docs/platforms/android/index.mdx | 44 ++++++++++++------- platform-includes/logs/setup/android.mdx | 6 ++- platform-includes/logs/usage/android.mdx | 2 +- .../metrics/requirements/android.mdx | 2 +- 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/docs/platforms/android/index.mdx b/docs/platforms/android/index.mdx index a179f73910c11e..3a1ede9a1963da 100644 --- a/docs/platforms/android/index.mdx +++ b/docs/platforms/android/index.mdx @@ -37,35 +37,35 @@ npx @sentry/wizard@latest -i android ``` ```bash {tabTitle:macOS (Intel/x64)} -downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-darwin-x64" +downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v9.0.0/sentry-wizard-darwin-x64" curl -L $downloadUrl -o sentry-wizard chmod +x sentry-wizard ./sentry-wizard -i android ``` ```bash {tabTitle:macOS (Apple Silicon/arm64)} -downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-darwin-arm64" +downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v9.0.0/sentry-wizard-darwin-arm64" curl -L $downloadUrl -o sentry-wizard chmod +x sentry-wizard ./sentry-wizard -i android ``` ```bash {tabTitle:Linux (x64)} -downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-linux-x64" +downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v9.0.0/sentry-wizard-linux-x64" curl -L $downloadUrl -o sentry-wizard chmod +x sentry-wizard ./sentry-wizard -i android ``` ```bash {tabTitle:Linux (arm64)} -downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-linux-arm64" +downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v9.0.0/sentry-wizard-linux-arm64" curl -L $downloadUrl -o sentry-wizard chmod +x sentry-wizard ./sentry-wizard -i android ``` ```powershell {tabTitle:Windows} -$downloadUrl = "https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-win-x64.exe" +$downloadUrl = "https://github.com/getsentry/sentry-wizard/releases/download/v9.0.0/sentry-wizard-win-x64.exe" Invoke-WebRequest $downloadUrl -OutFile sentry-wizard.exe ./sentry-wizard.exe -i android ``` @@ -78,28 +78,33 @@ If you prefer, you can also set up the SDK man The wizard will prompt you to log in to Sentry. It'll then automatically do the following steps for you: - Update your app's `build.gradle` file with the Sentry Gradle plugin and configure it -- Update your `AndroidManifest.xml` with the default Sentry configuration +- Update your `AndroidManifest.xml` with your DSN, tracing, user-interaction tracing, screenshots, view hierarchies, and default PII collection +- Ask whether to enable automatic Logs collection - Create `sentry.properties` with an auth token to upload proguard mappings (this file is automatically added to `.gitignore`) - Add an example error to your app's Main Activity to verify your Sentry setup +The wizard does not enable Profiling or Session Replay. Follow [Configure](#configure) to add them and adjust the generated configuration, including data collection. + ## Configure -**Error Monitoring** starts working as soon as you initialize the SDK. **Logs** need `io.sentry.logs.enabled` set to `true`; **Application Metrics** are available after initialization and need no extra configuration. You'll learn how to send them in [Send Logs](#send-logs) and [Send Application Metrics](#send-application-metrics-). +**Error Monitoring** starts working as soon as you initialize the SDK. You can also send **Logs** and **Application Metrics** after initialization, as shown in [Send Logs](#send-logs) and [Send Application Metrics](#send-application-metrics-). This guide also enables **Tracing**, **Profiling**, and **Session Replay**. The Android SDK also supports **User Feedback**; see Set Up User Feedback to add a feedback form to your app. -Initialize the SDK through your application's `AndroidManifest.xml`. If you initialize the SDK in code instead, enable Logs with `options.logs.enabled = true` in Kotlin or `options.getLogs().setEnabled(true)` in Java. +Use SDK version **8.58.0 or later** for the full configuration below, including the Data Collection options. Session Replay requires **Android 8.0 (API level 26) or higher**. + +The SDK initializes automatically using your application's `AndroidManifest.xml`. If you ran the wizard, update the existing Sentry entries and add the missing options from the snippet below. Keep a single `io.sentry.dsn` entry. The snippet also turns on: - Tracing: via `tracesSampleRate` - Profiling: via `profileSessionSampleRate` and `profileLifecycle` - Session Replay: via `sessionSampleRate` and `onErrorSampleRate` in the Session Replay configuration -- Logs: via `io.sentry.logs.enabled`, described in the Logs setup +- Automatic Logs collection: via `io.sentry.logs.enabled`, described in the Logs setup -Don't need a feature? Remove its options from the snippet. +Don't need a feature? Remove its options from your app's manifest. The `trace` profiling lifecycle requires tracing: if you disable tracing, also remove the profiling options or configure manual profiling. ```xml {filename:AndroidManifest.xml} @@ -109,11 +114,12 @@ Don't need a feature? Remove its options from the snippet. - + - + + @@ -121,7 +127,7 @@ Don't need a feature? Remove its options from the snippet. - + ``` @@ -132,13 +138,13 @@ The Sentry Wizard configures the Gradle plugin, which supports automatic tracing -On Android 15 (API level 35) and higher, profiling uses the Android ProfilingManager to capture Perfetto traces. On older devices, the SDK automatically falls back to the legacy profiler. +Starting with SDK version 8.51.0, profiling on Android 15 (API level 35) and higher uses the Android ProfilingManager to capture Perfetto traces. On older devices, the SDK automatically falls back to the legacy profiler. ## Send Logs -Once Logs are enabled in the manifest above, use `Sentry.logger()` to send log messages at different levels. +After SDK initialization, use `Sentry.logger()` to send log messages at different levels. ```java {tabTitle: Java} import io.sentry.Sentry; @@ -154,13 +160,17 @@ Sentry.logger().info("Order processed") Sentry.logger().error("Payment failed") ``` -If you already log with Timber or Logcat, the Timber and Logcat integrations can send those logs to Sentry too. +Starting with SDK version **8.59.0**, direct `Sentry.logger()` calls work regardless of the `io.sentry.logs.enabled` setting. On earlier SDK versions, set this option to `true` to send logs through this API. + +To collect logs automatically through the Timber or Logcat integration, keep `io.sentry.logs.enabled` set to `true`. If you initialize the SDK in code instead, set `options.logs.isEnabled = true` in Kotlin or `options.getLogs().setEnabled(true)` in Java. See Set Up Logs for all available logging methods and configuration options. ## Send Application Metrics -The Android SDK provides counters, gauges, and distributions through `Sentry.metrics()`. Metrics need no separate enable option and are supported in Android SDK version 8.34.0 and later. +The Android SDK provides counters, gauges, and distributions through `Sentry.metrics()`. Metrics need no separate enable option. + + ```java {tabTitle: Java} import io.sentry.Sentry; diff --git a/platform-includes/logs/setup/android.mdx b/platform-includes/logs/setup/android.mdx index c96781f39e9cf4..f12f7c3161e4f9 100644 --- a/platform-includes/logs/setup/android.mdx +++ b/platform-includes/logs/setup/android.mdx @@ -1,4 +1,6 @@ -To enable logging, you need to initialize the SDK with the `logs.enabled` option set to `true`. +Starting with SDK version `8.59.0`, direct `Sentry.logger()` calls work after initialization regardless of the `logs.enabled` setting. On earlier SDK versions, set `logs.enabled` to `true` to send logs through this API. + +To collect logs automatically through the Timber or Logcat integration, enable `logs.enabled` in the manifest or when you initialize the SDK in code: ```XML {filename:AndroidManifest.xml} @@ -31,7 +33,7 @@ class MyApplication : Application() { super.onCreate() SentryAndroid.init(this) { options -> options.dsn = "___PUBLIC_DSN___" - options.logs.enabled = true + options.logs.isEnabled = true } } } diff --git a/platform-includes/logs/usage/android.mdx b/platform-includes/logs/usage/android.mdx index 3991f3a7af9590..f5d8a4d99ff385 100644 --- a/platform-includes/logs/usage/android.mdx +++ b/platform-includes/logs/usage/android.mdx @@ -1,4 +1,4 @@ -Once the feature is enabled on the SDK and the SDK is initialized, you can send logs using the `Sentry.logger()` APIs. +After SDK initialization, send logs using the `Sentry.logger()` APIs. On SDK versions earlier than `8.59.0`, first enable `logs.enabled` as described in [Setup](#setup). The `Sentry.logger()` namespace exposes six methods that you can use to log messages at different log levels: `trace`, `debug`, `info`, `warn`, `error`, and `fatal`. diff --git a/platform-includes/metrics/requirements/android.mdx b/platform-includes/metrics/requirements/android.mdx index e3565c85ccff4a..5c566e3854d02d 100644 --- a/platform-includes/metrics/requirements/android.mdx +++ b/platform-includes/metrics/requirements/android.mdx @@ -1 +1 @@ -Metrics are supported in Sentry Android SDK version `8.34.0` and above. +Metrics are supported in Sentry Android SDK version `8.30.0` and above.