Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
564b225
docs(java): Update Logs and Metrics configuration for v9
adinauer Oct 14, 2026
4a82c69
Merge branch 'java-v9' into docs/java-android-logs-metrics-v9
adinauer Oct 14, 2026
c3d4d24
chore(java): Create v9 documentation collection branch
adinauer Oct 14, 2026
cb6137b
Merge branch 'java-v9' into docs/java-android-logs-metrics-v9
adinauer Oct 14, 2026
7e1bc79
Merge branch 'master' into java-v9
adinauer Oct 14, 2026
ed7b0aa
Merge branch 'java-v9' into docs/java-android-logs-metrics-v9
adinauer Oct 14, 2026
7e778b8
docs(java): Update OPTIONS request tracing default
adinauer Oct 14, 2026
3bbe018
Merge pull request #19991 from getsentry/master
adinauer Oct 15, 2026
7fb2cd5
Merge branch 'master' into java-v9
sentry-junior[bot] Oct 20, 2026
598a1a9
Merge pull request #20247 from getsentry/master
runningcode Oct 27, 2026
540f95f
Merge branch 'java-v9' into docs/java-android-logs-metrics-v9
adinauer Oct 27, 2026
ed58209
docs(java): Document Hub API removal
adinauer Oct 27, 2026
26d680e
docs(java): Expand Hub migration guidance
adinauer Oct 27, 2026
87a8c5c
docs(java): Correct v9 scope migration guidance
adinauer Oct 27, 2026
4967f52
docs(java): Document removed OpenTelemetry APIs
adinauer Oct 27, 2026
f2a477e
Update platform-includes/getting-started-config/java.spring.mdx
adinauer Oct 29, 2026
02e20cd
docs(java): Update Logs and Metrics configuration for v9 (#19962)
adinauer Oct 29, 2026
68159d8
Merge branch 'java-v9' into docs/java-v9-remove-hub-apis
adinauer Oct 29, 2026
8bdf58b
Merge pull request #20250 from getsentry/docs/java-v9-remove-hub-apis
adinauer Oct 29, 2026
75bb3a9
Merge branch 'java-v9' into docs/java-v9-remove-legacy-opentelemetry
adinauer Oct 29, 2026
118b4d0
Merge pull request #20257 from getsentry/docs/java-v9-remove-legacy-o…
adinauer Oct 29, 2026
d641bfc
Merge branch 'java-v9' into fix/trace-options-requests-default-v9
adinauer Oct 29, 2026
bad5618
Merge pull request #19968 from getsentry/fix/trace-options-requests-d…
adinauer Oct 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/get-started/guides/logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,6 @@ SentryAndroid.init(context) { options ->
options.dsn = "..."
options.environment = "development"
options.tracesSampleRate = 1.0 // 100% of traces
options.logs.enabled = true
}
```

Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/android/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ Controls whether the SDK should propagate the W3C `traceparent` HTTP header alon

</SdkOption>

<SdkOption name="traceOptionsRequests" type="bool" defaultValue="true">
<SdkOption name="traceOptionsRequests" type="bool" defaultValue="false">

Set this boolean to `false` to disable tracing for `OPTIONS` requests. This option's default value will likely be changed in the next major version, meaning you will have to set it to `true` if you want to keep tracing `OPTIONS` requests.
By default, the SDK does not trace `OPTIONS` requests. Set this option to `true` to create transactions for them.

</SdkOption>

Expand Down
12 changes: 8 additions & 4 deletions docs/platforms/android/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp
<!-- Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes) -->
<meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="trace" />
<!-- ___PRODUCT_OPTION_END___ profiling -->
<!-- ___PRODUCT_OPTION_START___ logs -->
<!-- Enable logs to be sent to Sentry -->
<meta-data android:name="io.sentry.logs.enabled" android:value="true" />
<!-- ___PRODUCT_OPTION_END___ logs -->
<!-- ___PRODUCT_OPTION_START___ session-replay -->
<!-- Record session replays for 100% of errors and 10% of sessions -->
<meta-data android:name="io.sentry.session-replay.on-error-sample-rate" android:value="1.0" />
Expand All @@ -142,6 +138,14 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp
</application>
```

<OnboardingOption optionId="logs">
<Alert>

Calls to `Sentry.logger()` send logs without additional configuration. To capture Timber or Logcat output automatically, enable log capture for the applicable <PlatformLink to="/logs/#other-logging-integrations">logging integration</PlatformLink>.

</Alert>
</OnboardingOption>

## Verify

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.
Expand Down
30 changes: 28 additions & 2 deletions docs/platforms/android/integrations/logcat/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ og_image: /og-images/platforms-android-integrations-logcat.png

<Alert level="warning" title="Did you mean logs instead?">

This integration captures Logcat logs as breadcrumbs (great for error context!). But if you need to search and query your logs across your entire application, use <PlatformLink to="/logs/">Sentry Logs</PlatformLink> instead. Logcat logs at or above the `minLevel` are automatically sent as Sentry Logs when enabled. See the <PlatformLink to="/integrations/logcat/#support-with-sentry-logs">Support With Sentry Logs</PlatformLink> section below.
This integration captures Logcat logs as breadcrumbs (great for error context!). But if you need to search and query your logs across your entire application, use <PlatformLink to="/logs/">Sentry Logs</PlatformLink> instead. Logcat logs at or above the `minLevel` are sent as Sentry Logs when Logcat log capture is enabled. See the <PlatformLink to="/integrations/logcat/#support-with-sentry-logs">Support With Sentry Logs</PlatformLink> section below.

</Alert>

Expand Down Expand Up @@ -135,4 +135,30 @@ Sentry Logs for Logcat are supported in Sentry Android SDK version `8.17.0` and

</Alert>

Logcat logs at or above the `minLevel` captured by Sentry are automatically sent as <PlatformLink to="/logs/">Sentry Logs</PlatformLink>, if enabled.
Automatic Sentry Logs capture from Logcat is disabled by default. Enable it in `AndroidManifest.xml`:

```xml {filename:AndroidManifest.xml}
<application>
<meta-data android:name="io.sentry.logcat.log-capture.enabled" android:value="true" />
</application>
```

Or enable it when initializing the SDK:

```java {tabTitle:Java}
import io.sentry.android.core.SentryAndroid;

SentryAndroid.init(this, options -> {
options.setLogcatLogCaptureEnabled(true);
});
```

```kotlin {tabTitle:Kotlin}
import io.sentry.android.core.SentryAndroid

SentryAndroid.init(this) { options ->
options.logcatLogCaptureEnabled = true
}
```

The Android Gradle plugin's `logcat.enabled` option controls Logcat bytecode instrumentation. `logcatLogCaptureEnabled` controls whether the instrumented records are also sent as Sentry Logs.
6 changes: 3 additions & 3 deletions docs/platforms/android/integrations/okhttp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ private final List<String> failedRequestTargets = Collections.singletonList(".*"
private final OkHttpClient client = new OkHttpClient.Builder()
.eventListener(new SentryOkHttpEventListener())
.addInterceptor(new SentryOkHttpInterceptor(
Sentry.getCurrentHub(),
Sentry.getCurrentScopes(),
null,
true,
codeRanges,
Expand Down Expand Up @@ -340,7 +340,7 @@ private final List<String> failedRequestTargets = Collections.singletonList(".*"
private final OkHttpClient client = new OkHttpClient.Builder()
.eventListener(new SentryOkHttpEventListener())
.addInterceptor(new SentryOkHttpInterceptor(
Sentry.getCurrentHub(),
Sentry.getCurrentScopes(),
null,
true,
codeRanges,
Expand Down Expand Up @@ -378,7 +378,7 @@ private final List<String> failedRequestTargets = Collections.singletonList("mya
private final OkHttpClient client = new OkHttpClient.Builder()
.eventListener(new SentryOkHttpEventListener())
.addInterceptor(new SentryOkHttpInterceptor(
Sentry.getCurrentHub(),
Sentry.getCurrentScopes(),
null,
true,
codeRanges,
Expand Down
62 changes: 57 additions & 5 deletions docs/platforms/android/integrations/timber/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "Learn more about the Sentry Timber integration for the Android SDK

<Alert level="warning" title="Did you mean logs instead?">

This integration captures Timber logs as breadcrumbs and error events (great for error context!). But if you need to search and query your logs across your entire application, use <PlatformLink to="/logs/">Sentry Logs</PlatformLink> instead. Timber logs at or above the `minLogsLevel` are automatically sent as Sentry Logs when enabled. See the <PlatformLink to="/integrations/timber/#support-with-sentry-logs">Support With Sentry Logs</PlatformLink> section below.
This integration captures Timber logs as breadcrumbs and error events (great for error context!). But if you need to search and query your logs across your entire application, use <PlatformLink to="/logs/">Sentry Logs</PlatformLink> instead. Timber logs at or above the `minLogsLevel` are sent as Sentry Logs when Timber log capture is enabled. See the <PlatformLink to="/integrations/timber/#support-with-sentry-logs">Support With Sentry Logs</PlatformLink> section below.

</Alert>

Expand Down Expand Up @@ -74,6 +74,8 @@ implementation 'io.sentry:sentry-android-timber:{{@inject packages.version('sent
Configuration should happen as early as possible in your application's lifecycle.

```kotlin
import io.sentry.SentryLevel
import io.sentry.SentryLogLevel
import io.sentry.android.core.SentryAndroid
import io.sentry.android.timber.SentryTimberIntegration
import timber.log.Timber
Expand All @@ -90,7 +92,8 @@ SentryAndroid.init(this) { options ->
SentryTimberIntegration(
minEventLevel = SentryLevel.ERROR,
minBreadcrumbLevel = SentryLevel.INFO,
minLogsLevel = SentryLogLevel.INFO
minLogsLevel = SentryLogLevel.INFO,
logsEnabled = false
)
)
} else {
Expand All @@ -100,9 +103,11 @@ SentryAndroid.init(this) { options ->
```

```java
import io.sentry.SentryLevel;
import io.sentry.SentryLogLevel;
import io.sentry.android.core.SentryAndroid;
import io.sentry.android.timber.SentryTimberIntegration;
import timber.log.Timber
import timber.log.Timber;
// import BuildConfig

SentryAndroid.init(this, options -> {
Expand All @@ -116,7 +121,8 @@ SentryAndroid.init(this, options -> {
new SentryTimberIntegration(
SentryLevel.ERROR,
SentryLevel.INFO,
SentryLogLevel.INFO
SentryLogLevel.INFO,
false
)
);
} else {
Expand Down Expand Up @@ -181,4 +187,50 @@ Sentry Logs for Timber are supported in Sentry Android SDK version `8.17.0` and

</Alert>

Timber logs at or above the `minLogsLevel` captured by Sentry are automatically sent as <PlatformLink to="/logs/">Sentry Logs</PlatformLink>, if enabled.
Automatic Sentry Logs capture from Timber is disabled by default.

For the auto-installed Timber integration, enable capture in `AndroidManifest.xml`:

```xml {filename:AndroidManifest.xml}
<application>
<meta-data android:name="io.sentry.timber.log-capture.enabled" android:value="true" />
</application>
```

Or enable it when initializing the SDK:

```java {tabTitle:Java}
import io.sentry.android.core.SentryAndroid;

SentryAndroid.init(this, options -> {
options.setTimberLogCaptureEnabled(true);
});
```

```kotlin {tabTitle:Kotlin}
import io.sentry.android.core.SentryAndroid

SentryAndroid.init(this) { options ->
options.timberLogCaptureEnabled = true
}
```

When manually adding `SentryTimberIntegration`, pass `true` as its `logsEnabled` argument instead:

```kotlin {tabTitle:Kotlin}
SentryTimberIntegration(
minEventLevel = SentryLevel.ERROR,
minBreadcrumbLevel = SentryLevel.INFO,
minLogsLevel = SentryLogLevel.INFO,
logsEnabled = true
)
```

```java {tabTitle:Java}
new SentryTimberIntegration(
SentryLevel.ERROR,
SentryLevel.INFO,
SentryLogLevel.INFO,
true
);
```
9 changes: 0 additions & 9 deletions docs/platforms/android/manual-setup/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ Configuration is done via the application `AndroidManifest.xml`. Here's an examp
See the Android Session Replay documentation for details: https://docs.sentry.io/platforms/android/session-replay/#screenshot-strategy -->
<!-- <meta-data android:name="io.sentry.session-replay.screenshot-strategy" android:value="canvas" /> -->

<!-- enable logs to be sent to Sentry. Use Sentry.logger() to capture logs or check the available integrations that capture logs automatically: https://docs.sentry.io/platforms/android/logs/#integrations -->
<meta-data android:name="io.sentry.logs.enabled" android:value="true" />

<!-- enable tombstone support for richer Native crashes context. See more at https://docs.sentry.io/platforms/android/configuration/tombstones/ -->
<meta-data android:name="io.sentry.tombstone.enable" android:value="true" />
</application>
Expand Down Expand Up @@ -167,9 +164,6 @@ class MyApplication : Application() {
// See the Android Session Replay documentation for details: https://docs.sentry.io/platforms/android/session-replay/#screenshot-strategy
// options.sessionReplay.screenshotStrategy = ScreenshotStrategyType.CANVAS

// enable logs to be sent to Sentry. Use Sentry.logger() to capture logs or check the available integrations that capture logs automatically: https://docs.sentry.io/platforms/android/logs/#integrations
options.logs.isEnabled = true

// enable tombstone support for richer Native crashes context. See more at https://docs.sentry.io/platforms/android/configuration/tombstones/
options.isTombstoneEnabled = true

Expand Down Expand Up @@ -226,9 +220,6 @@ public class MyApplication extends Application {
// See the Android Session Replay documentation for details: https://docs.sentry.io/platforms/android/session-replay/#screenshot-strategy
// options.getSessionReplay().setScreenshotStrategy(ScreenshotStrategyType.CANVAS);

// enable logs to be sent to Sentry. Use Sentry.logger() to capture logs or check the available integrations that capture logs automatically: https://docs.sentry.io/platforms/android/logs/#integrations
options.getLogs().setEnabled(true);

// enable tombstone support for richer Native crashes context. See more at https://docs.sentry.io/platforms/android/configuration/tombstones/
options.setTombstoneEnabled(true);

Expand Down
73 changes: 73 additions & 0 deletions docs/platforms/android/migration/v8-to-v9.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Migrate from Sentry 8.x to 9.0.0
description: "Learn how to migrate from Sentry Android SDK 8.x to 9.0.0."
sidebar_order: 8890
---

Version 9 removes the deprecated Hub compatibility APIs and the global Logs and Metrics enable options. Migrate remaining Hub references to Scopes, then update your telemetry configuration.

## Removed Hub APIs

Version 8 deprecated Hub and introduced Scopes. Version 9 removes the Hub compatibility layer:

- `IHub` has been removed. Use `IScopes` instead.
- `HubAdapter.getInstance()` has been removed. Use `ScopesAdapter.getInstance()` instead.
- `HubScopesWrapper` has been removed. Use the wrapped `IScopes` instance directly.
- `NoOpHub.getInstance()` has been removed. Use `NoOpScopes.getInstance()` instead.
- `Sentry.getCurrentHub()` and `Sentry.setCurrentHub(...)` have been removed. Use `Sentry.getCurrentScopes()` and `Sentry.setCurrentScopes(...)` instead.
- `IHub.clone()` and `IScopes.clone()` have been removed. Use `forkedScopes(...)` or `forkedCurrentScope(...)` when you need an independent Scopes instance. For temporary scope changes, use `withScope()` or `withIsolationScope()`.

### Remove `popScope()` Calls

`Sentry.popScope()` and `IScopes.popScope()` have been removed. Use `Sentry.withScope()` or `Sentry.withIsolationScope()` for temporary scope changes instead. Both methods restore the previous scopes after the callback finishes.

### Scopes Model

The Scopes model introduced in version 8 is the supported context model in version 9:

- The global scope is attached to all events created by the SDK. To modify it before `SentryAndroid.init()`, call methods directly on `Sentry.getGlobalScope()`, such as `Sentry.getGlobalScope().setTag(...)`.
- The isolation scope attaches data to events within an isolated lifecycle.
- The current scope contains data for the active operation. Child scopes inherit its data, but parent scopes don't receive changes made in a child scope.

On Android, APIs such as `Sentry.configureScope()` and `Sentry.setTag()` use the current scope by default.

## Manual Logs and Metrics

Calls to `Sentry.logger()` and `Sentry.metrics()` no longer require a global enable option. Remove calls to:

- `options.getLogs().setEnabled(...)`
- `options.getMetrics().setEnabled(...)`

The `beforeSendLog` and `beforeSendMetric` callbacks remain available for filtering or modifying telemetry.

## Android Manifest Options

Remove these manifest entries:

```xml {filename:AndroidManifest.xml}
<meta-data android:name="io.sentry.logs.enabled" android:value="true" />
<meta-data android:name="io.sentry.metrics.enabled" android:value="false" />
```

To capture logs from an automatic Android integration, use its integration-specific option instead:

```xml {filename:AndroidManifest.xml}
<meta-data android:name="io.sentry.timber.log-capture.enabled" android:value="true" />
<meta-data android:name="io.sentry.logcat.log-capture.enabled" android:value="true" />
```

The equivalent `SentryAndroidOptions` properties are `timberLogCaptureEnabled` and `logcatLogCaptureEnabled`. Both default to `false`.

## Timber Constructor Changes

Manual `SentryTimberIntegration` and `SentryTimberTree` construction now requires a `logsEnabled` argument. Pass `false` to keep automatic Sentry Logs capture disabled:

```kotlin {tabTitle:Kotlin}
SentryTimberIntegration(logsEnabled = false)
```

```java {tabTitle:Java}
new SentryTimberIntegration(false);
```

Pass `true` only when Timber records should also be sent as Sentry Logs.
4 changes: 2 additions & 2 deletions docs/platforms/java/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ Controls whether the SDK should propagate the W3C `traceparent` HTTP header alon

</SdkOption>

<SdkOption name="traceOptionsRequests" type="boolean" defaultValue="true">
<SdkOption name="traceOptionsRequests" type="boolean" defaultValue="false">

Set this boolean to `false` to disable tracing for `OPTIONS` requests. This options default value will likely be changed in the next major version, meaning you will have to set it to `true` if you want to keep tracing `OPTIONS` requests.
By default, the SDK does not trace `OPTIONS` requests. Set this option to `true` to create transactions for them.

</SdkOption>

Expand Down
Loading
Loading