Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 7 additions & 3 deletions docs/platforms/apple/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ Learn more in the <PlatformLink to="/configuration/graphql-operation-tracking/">

<SdkOption name="enableLogs" type="bool" defaultValue="false">

When enabled, the SDK sends logs to Sentry. You must explicitly set this option to `true` to enable log capturing.
In SDK 9.0.0–9.26.x, set this option to `true` to send logs to Sentry.

Since SDK 9.27.0, this option is deprecated and no longer gates calls to `SentrySDK.logger` or integrations that forward to it. Setting it to `false` doesn't drop those logs. Use <PlatformLink to="/logs/#beforesendlog">`beforeSendLog`</PlatformLink> to filter logs instead.

Learn more about structured logging in the <PlatformLink to="/logs/">logs documentation</PlatformLink>.

Expand Down Expand Up @@ -1289,6 +1291,8 @@ This option is only used when <PlatformIdentifier name="enableSpotlight" /> is s

When enabled, the SDK can send metrics to Sentry. Note that metrics are not collected automatically — you must manually call the `SentrySDK.metrics` API to record counters, gauges, and distributions.

Since SDK 9.27.0, this option is deprecated and no longer gates manual metric capture. To drop metrics, return `nil` from <PlatformIdentifier name="beforeSendMetric" />.

Learn more in the <PlatformLink to="/metrics/">Metrics documentation</PlatformLink>.

</SdkOption>
Expand Down Expand Up @@ -1361,13 +1365,13 @@ When enabled, the SDK uses a more efficient mechanism for detecting watchdog ter

</SdkOption>

<SdkOption name="experimental.enableMetrics" type="bool" defaultValue="true" availableSince="9.4.0" removedSince="9.12.0">
<SdkOption name="experimental.enableMetrics" type="bool" defaultValue="true" availableSince="9.2.0" removedSince="9.12.0">

**Removed in version 9.12.0** — Metrics has graduated to GA. Use the top-level <PlatformIdentifier name="enableMetrics" /> option instead. See [sentry-cocoa#7842](https://github.com/getsentry/sentry-cocoa/pull/7842).

</SdkOption>

<SdkOption name="experimental.beforeSendMetric" type="function" availableSince="9.4.0" removedSince="9.12.0">
<SdkOption name="experimental.beforeSendMetric" type="function" availableSince="9.2.0" removedSince="9.12.0">

**Removed in version 9.12.0** — Metrics has graduated to GA. Use the top-level <PlatformIdentifier name="beforeSendMetric" /> option instead. See [sentry-cocoa#7842](https://github.com/getsentry/sentry-cocoa/pull/7842).

Expand Down
7 changes: 4 additions & 3 deletions docs/platforms/apple/common/features/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ All features listed below are **enabled by default** unless otherwise noted. Som

- <Link to="/product/releases/health/">Release health</Link> tracks crash-free users and sessions
- Session tracking automatically tracks user sessions for release health metrics
- <PlatformLink to="/session-replay/">Session Replay</PlatformLink> (only available on iOS 16+ and tvOS 16+)
- <PlatformLink to="/session-replay/">Session Replay</PlatformLink> (officially supported on iOS)
- Requires SDK version 8.31.1 or later
- tvOS is not officially supported
- Supports the iOS versions supported by the SDK; no iOS 16 requirement
- May run on tvOS and visionOS, which are not officially supported

## Event Enrichment

Expand All @@ -77,7 +78,7 @@ All features listed below are **enabled by default** unless otherwise noted. Som
## Platform-Specific Features

- <PlatformLink to="/configuration/metric-kit/">MetricKit</PlatformLink> integration (only available on iOS 15+ and macOS 12+, requires enabling `enableMetricKit` option)
- Logs capturing (requires <PlatformLink to="/configuration/options/#enableLogs">`enableLogs`</PlatformLink> option, only available on iOS, tvOS, visionOS, and macOS)
- <PlatformLink to="/logs/">Logs</PlatformLink> via `SentrySDK.logger` on all supported Apple platforms, including watchOS. SDK 9.27.0+ doesn't require an enable flag; earlier versions require configuration.

## Data Management

Expand Down
3 changes: 1 addition & 2 deletions docs/platforms/apple/common/logs/cocoalumberjack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies: [

## Configure

Initialize the Sentry SDK with logs enabled, then add `SentryCocoaLumberjackLogger` to CocoaLumberjack:
Initialize the Sentry SDK, then add `SentryCocoaLumberjackLogger` to CocoaLumberjack. SDK 9.27.0+ doesn't require an enable flag for logs forwarded by this integration:

```swift
import Sentry
Expand All @@ -44,7 +44,6 @@ import SentryCocoaLumberjack

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.enableLogs = true
}

// Only logs at .info level and above will be sent to Sentry
Expand Down
3 changes: 1 addition & 2 deletions docs/platforms/apple/common/logs/pulse.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies: [

## Configure

Initialize the Sentry SDK with logs enabled, then start the Pulse integration:
Initialize the Sentry SDK, then start the Pulse integration. SDK 9.27.0+ doesn't require an enable flag for logs forwarded by this integration:

```swift
import Sentry
Expand All @@ -44,7 +44,6 @@ import SentryPulse

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.enableLogs = true
}

SentryPulse.start()
Expand Down
3 changes: 1 addition & 2 deletions docs/platforms/apple/common/logs/swift-log.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies: [

## Configure

Initialize the Sentry SDK with logs enabled, then register `SentryLogHandler` as your SwiftLog bootstrap:
Initialize the Sentry SDK, then register `SentryLogHandler` as your SwiftLog bootstrap. SDK 9.27.0+ doesn't require an enable flag for logs forwarded by this integration:

```swift
import Sentry
Expand All @@ -44,7 +44,6 @@ import SentrySwiftLog

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.enableLogs = true
}

LoggingSystem.bootstrap { _ in
Expand Down
3 changes: 1 addition & 2 deletions docs/platforms/apple/common/logs/swiftybeaver.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies: [

## Configure

Initialize the Sentry SDK with logs enabled, then add `SentryDestination` to SwiftyBeaver:
Initialize the Sentry SDK, then add `SentryDestination` to SwiftyBeaver. SDK 9.27.0+ doesn't require an enable flag for logs forwarded by this integration:

```swift
import Sentry
Expand All @@ -44,7 +44,6 @@ import SentrySwiftyBeaver

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.enableLogs = true
}

let log = SwiftyBeaver.self
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/apple/common/troubleshooting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ sidebar_order: 9000
sidebar_section: configuration
---

## Can I Initialize the SDK From a Background Thread?

Yes, but we recommend initializing the SDK on the main thread as early as possible. When you call `SentrySDK.start` from a background thread, the SDK starts asynchronously on the main thread because some initialization steps, such as collecting view hierarchy information, require it.

Initializing early also helps capture app launch crashes on platforms that support crash reporting.

## "Missing API declaration" after App Store review

Starting May 1, 2024, Apple requires all apps submitted to the App Store to provide a list of privacy-related APIs they use, including the reasons under which they use it. If you received an email from Apple with the message "ITMS-91053: Missing API declaration", your app doesn't fulfill the requirements. To solve this, follow our [Apple Privacy Manifest](/platforms/apple/data-management/apple-privacy-manifest/) guide.
Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/apple/guides/ios/features/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ iOS supports comprehensive error detection:

## Logs

<PlatformLink to="/logs/">Logs capturing</PlatformLink> is available and requires the `enableLogs` option to be enabled.
Send <PlatformLink to="/logs/">logs</PlatformLink> with `SentrySDK.logger`. SDK 9.27.0+ doesn't require an enable flag; earlier versions require configuration.

## Performance Features Available on iOS

Expand All @@ -51,7 +51,7 @@ iOS supports all <PlatformLink to="/tracing/instrumentation/">performance monito

<PlatformLink to="/session-replay/">Session Replay</PlatformLink> records user sessions for visual debugging, helping you understand what happened before, during, and after an error.

- Available on iOS 16+
- Supports the iOS versions supported by the SDK; no iOS 16 requirement
- Requires SDK version 8.31.1 or later
- Enabled by setting `options.sessionReplay.sessionSampleRate` and/or `options.sessionReplay.onErrorSampleRate` to a value greater than `0`

Expand Down
15 changes: 14 additions & 1 deletion docs/platforms/apple/guides/ios/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We recommend installing the SDK with SPM, but we also support alternate [install
https://github.com/getsentry/sentry-cocoa.git
```

The Package has a few products you can depend on, but the recommended one is `Sentry`. For more details see the full docs on using [Swift Package Manager](/platforms/apple/guides/ios/install/swift-package-manager/).
Add one SDK product to your application target: `SentrySPM` to build from source (recommended), or `Sentry` to use the prebuilt static framework. Both use `import Sentry`. See [Swift Package Manager](/platforms/apple/guides/ios/install/swift-package-manager/) for more options.

## Configuration

Expand Down Expand Up @@ -83,6 +83,7 @@ If you're using SwiftUI and your app doesn't implement an app delegate, initiali

```swift
import Sentry
import SwiftUI

@main
struct SwiftUIApp: App {
Expand All @@ -96,5 +97,17 @@ struct SwiftUIApp: App {
options.tracesSampleRate = 1.0
}
}

var body: some Scene {
WindowGroup {
SentryTracedView("Home") {
Text("Hello, world!")
}
}
}
}
```

Keep your existing app content inside `WindowGroup`. See [SwiftUI Instrumentation](/platforms/apple/guides/ios/tracing/instrumentation/swiftui-instrumentation/) for view tracing options.

These snippets configure Error Monitoring and Tracing. Continue with the [quickstart](/platforms/apple/guides/ios/#configure) to add Profiling, Session Replay, Logs, and Application Metrics, upload debug symbols, and verify your setup. Merge additional options into your existing SDK initialization rather than starting the SDK again.
12 changes: 9 additions & 3 deletions docs/platforms/apple/guides/macos/features/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ sidebar_hidden: true
description: "Learn about Sentry's Apple SDK features for macOS."
---

Sentry's Apple SDK for macOS enables automatic reporting of errors and exceptions, and identifies performance issues in your application. The minimum supported macOS version is 10.14. All features listed below are **enabled by default** unless otherwise noted.
Sentry's Apple SDK for macOS enables automatic reporting of errors and exceptions, and identifies performance issues in your application.

SDK 9.25.0 and later require macOS 12 or later. Use an earlier SDK release if your app supports older macOS versions. All features listed below are **enabled by default** unless otherwise noted.

<Alert>

Expand Down Expand Up @@ -54,7 +56,11 @@ For a complete list of all available features, see the <PlatformLink to="/featur

## Performance Monitoring

macOS supports comprehensive <PlatformLink to="/tracing/instrumentation/">performance monitoring</PlatformLink>:
macOS supports <PlatformLink to="/tracing/instrumentation/">performance monitoring</PlatformLink> for operations you instrument in your app.

Start a transaction around the operation you want to measure and bind it to the scope so automatic instrumentation can attach child spans. macOS apps don't automatically create UIKit screen-load transactions. See <PlatformLink to="/tracing/instrumentation/custom-instrumentation/">Custom Instrumentation</PlatformLink> or <PlatformLink to="/tracing/instrumentation/swiftui-instrumentation/">SwiftUI Instrumentation</PlatformLink>.

Automatic child spans include:

- <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/#network-tracking">Network request monitoring</PlatformLink> for HTTP request performance
- <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/#file-io-tracing">File I/O performance tracking</PlatformLink> for file operations
Expand Down Expand Up @@ -87,7 +93,7 @@ For macOS apps using UIKit (Mac Catalyst), the following features are also avail
## Other Features

- Swift Async/Await support for automatically stitching together stack traces of Swift concurrency code
- <PlatformLink to="/logs/">Logs capturing</PlatformLink> available (requires `enableLogs` option)
- <PlatformLink to="/logs/">Logs</PlatformLink> via `SentrySDK.logger` (no enable flag required in SDK 9.27.0+)
- Offline caching when a device is unable to connect; we send a report once we receive another event

## macOS Limitations
Expand Down
6 changes: 3 additions & 3 deletions docs/platforms/apple/guides/tvos/features/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ tvOS has some limitations compared to iOS:

<Alert level="info">

Session Replay works on tvOS 16+, but it is only officially supported on iOS. While the feature may function on tvOS, we cannot guarantee its reliability or provide full support for tvOS-specific issues.
Session Replay may run on tvOS, but it is only officially supported on iOS. While the feature may function on tvOS, we cannot guarantee its reliability or provide full support for tvOS-specific issues.

</Alert>

- Works on tvOS 16+ (not officially supported)
- May run on tvOS (not officially supported)
- Requires SDK version 8.31.1 or later

### Performance Monitoring
Expand Down Expand Up @@ -72,7 +72,7 @@ tvOS supports comprehensive error detection:
- <Link to="/product/releases/health/">Release health</Link> tracks crash-free users and sessions
- Offline caching when a device is unable to connect; we send a report once we receive another event
- Swift Async/Await support for automatically stitching together stack traces of Swift concurrency code
- <PlatformLink to="/logs/">Logs capturing</PlatformLink> available (requires `enableLogs` option)
- <PlatformLink to="/logs/">Logs</PlatformLink> via `SentrySDK.logger` (no enable flag required in SDK 9.27.0+)
- <PlatformLink to="/user-feedback/">User Feedback</PlatformLink> via programmatic API (no UI available)

For configuration options and detailed documentation, see the <PlatformLink to="/configuration/">Configuration</PlatformLink> section.
2 changes: 1 addition & 1 deletion docs/platforms/apple/guides/visionos/features/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ visionOS supports comprehensive error detection:
- <Link to="/product/releases/health/">Release health</Link> tracks crash-free users and sessions
- Offline caching when a device is unable to connect; we send a report once we receive another event
- Swift Async/Await support for automatically stitching together stack traces of Swift concurrency code
- <PlatformLink to="/logs/">Logs capturing</PlatformLink> available (requires `enableLogs` option)
- <PlatformLink to="/logs/">Logs</PlatformLink> via `SentrySDK.logger` (no enable flag required in SDK 9.27.0+)
- <PlatformLink to="/user-feedback/">User Feedback</PlatformLink> via programmatic API (no UI available)

For configuration options and detailed documentation, see the <PlatformLink to="/configuration/">Configuration</PlatformLink> section.
4 changes: 3 additions & 1 deletion docs/platforms/apple/guides/watchos/features/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ watchOS has significant limitations due to platform restrictions:
- View Hierarchy capture not available
- Profiling not available
- MetricKit integration not available
- Logs capturing not available
- Most performance monitoring features not available
- Limited symbolication support

Expand Down Expand Up @@ -59,6 +58,9 @@ Despite the limitations, watchOS still supports several useful features:

### Other Features

- <PlatformLink to="/logs/">Logs</PlatformLink> via `SentrySDK.logger` (no enable flag required in SDK 9.27.0+)
- <PlatformLink to="/metrics/">Application Metrics</PlatformLink> via `SentrySDK.metrics` (stable since SDK 9.12.0)
- <PlatformLink to="/tracing/instrumentation/custom-instrumentation/">Manual tracing</PlatformLink> for operations you instrument in your app
- Swift Async/Await support for automatically stitching together stack traces of Swift concurrency code (when applicable)
- <PlatformLink to="/user-feedback/">User Feedback</PlatformLink> via programmatic API (no UI available)

Expand Down
Loading
Loading