Skip to content
Open
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
19 changes: 12 additions & 7 deletions docs/platforms/apple/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ You can also override this option on a per-call basis by passing the `attachAllT

When enabled, the SDK reports SIGTERM signals to Sentry.

It's crucial for developers to understand that the OS sends a SIGTERM to their app as a prelude to a graceful shutdown, before resorting to a SIGKILL. This SIGKILL, which your app can't catch or ignore, is a direct order to terminate your app's process immediately. Developers should be aware that their app can receive a SIGTERM in various scenarios, such as CPU or disk overuse, watchdog terminations, or when the OS updates your app.

It's crucial for developers to understand that the OS sends a SIGTERM to their app as a prelude to a graceful shutdown, before resorting to a SIGKILL. This SIGKILL, which your app can't catch or ignore, is a direct order to terminate your app's process immediately. Developers should be aware that their app can receive a SIGTERM in various scenarios, such as CPU or disk overuse, watchdog terminations, or when the OS updates your app.
Comment thread
itaybre marked this conversation as resolved.

</SdkOption>

Expand Down Expand Up @@ -205,7 +204,6 @@ This option can be overridden using <PlatformIdentifier name="inAppInclude" />.

A block that configures the initial scope when starting the SDK.


```swift
import Sentry

Expand Down Expand Up @@ -301,6 +299,7 @@ Set this boolean to `false` to disable sending of client reports. Client reports
When enabled, the SDK adds breadcrumbs for each network request. This feature uses swizzling, so disabling <PlatformLink to="/configuration/swizzling/">`enableSwizzling`</PlatformLink> also disables this feature.

If you want to enable or disable network tracking for performance monitoring, use <PlatformLink to="/configuration/options/#enableNetworkTracking">`enableNetworkTracking`</PlatformLink> instead.

</SdkOption>

<SdkOption name="enableCaptureFailedRequests" type="bool" defaultValue="true">
Expand Down Expand Up @@ -640,7 +639,6 @@ If <PlatformIdentifier name="tracePropagationTargets" /> is not provided, trace

</SdkOption>


<SdkOption name="strictTraceContinuation" type="Bool" defaultValue="false">

If set to `true`, the SDK will only continue a trace if the organization ID of the incoming trace found in the `baggage` header matches the organization ID of the current Sentry client.
Expand Down Expand Up @@ -673,7 +671,6 @@ Use <PlatformIdentifier name="tracePropagationTargets" /> to control which reque

<SdkOption name="enablePersistingTracesWhenCrashing" type="bool" defaultValue="false" availableSince="8.41.0">


<Alert>

This feature is experimental and may have bugs. It's available from [version 8.41.0](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8410).
Expand Down Expand Up @@ -852,8 +849,6 @@ When enabled, request and response bodies are captured for URLs matching `networ

Requires `options.experimental.enableReplayNetworkDetailsCapturing = true`.



</SdkOption>

<SdkOption name="sessionReplay.networkRequestHeaders" type="array" defaultValue='["Content-Type", "Content-Length", "Accept"]' availableSince="9.12.0">
Expand Down Expand Up @@ -1108,6 +1103,7 @@ Learn more in the <PlatformLink to="/features/experimental-features/">Experiment
<SdkOption name="cacheDirectoryPath" type="string">

The path where the SDK stores data before sending it to Sentry. By default, the SDK uses `NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, true)`, which resolves to:

- `~/Library/Caches/` for non-sandboxed macOS apps
- `~/Library/Containers/{BundleID}/Data/Library/Caches/` for sandboxed macOS apps
- `~/Library/Caches/` (within the app's sandbox) for iOS apps
Expand Down Expand Up @@ -1186,6 +1182,15 @@ Learn more in the <PlatformLink to="/session-replay/configuration/#network-detai

</SdkOption>

<SdkOption name="experimental.enableStandaloneAppStartTracing" type="bool" defaultValue="false" availableSince="9.14.0">

When enabled, the SDK sends app start data as a standalone `app.start` transaction instead of attaching it as spans to the first UIViewController transaction. This makes app starts easier to find, sample, and analyze independently.

Learn more in the <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/#standalone-app-start-tracing">Standalone App Start Tracing</PlatformLink> documentation.

</SdkOption>


<SdkOption name="experimental.enableMetrics" type="bool" defaultValue="true" availableSince="9.4.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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ Enable <PlatformLink to="/profiling/#enable-launch-profiling">App Launch Profili

Enable <PlatformLink to="/profiling/#continuous-profiling">Continuous Profiling</PlatformLink> to get full coverage of your app's execution.

## Performance Features

### Standalone App Start Tracing

Enable <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/#standalone-app-start-tracing">`enableStandaloneAppStartTracing`</PlatformLink> to send app start data as a dedicated transaction instead of attaching it to the first UIViewController transaction. You can use a custom <PlatformLink to="/configuration/options/#tracesSampler">`tracesSampler`</PlatformLink> to set a dedicated sample rate for app start transactions by checking for the `app.start` operation.

## Crash & Error Handling

### Persisting Traces When Crashing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ SentrySDK.start { options in
options.enableAutoPerformanceTracing = false
}
```

```objc {tabTitle:Objective-C}
@import Sentry;

Expand Down Expand Up @@ -166,6 +167,7 @@ The Cocoa SDK creates the following app start spans:
![App Start Transaction](./img/app-start-transaction.png)

Cold and warm start are Mobile Vitals, which you can learn about in the [full documentation](/product/dashboards/sentry-dashboards/mobile/mobile-vitals).

### Prewarmed App Start Tracing

Starting with iOS 15, the operating system might [prewarm](https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence#3894431) your app by creating the process before the user opens it. Starting with SDK version [9.0.0](https://github.com/getsentry/sentry-cocoa/releases/tag/9.0.0), the `enablePreWarmedAppStartTracing` is enabled by default.
Expand Down Expand Up @@ -201,6 +203,70 @@ SentrySDK.start { options in
}];
```

### Standalone App Start Tracing

<Alert>

This feature is experimental and available since [version 9.14.0](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#9140).

</Alert>

By default, the SDK attaches app start data as spans to the first UIViewController transaction. With standalone app start tracing enabled, the SDK sends a dedicated `app.start` transaction instead. This gives app starts their own transaction, making them easier to find, sample, and analyze independently.

![Standalone App Start Transaction](./img/standalone-app-start.png)

To enable standalone app start tracing:

```swift {tabTitle:Swift}
import Sentry

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.experimental.enableStandaloneAppStartTracing = true
}
```

```objc {tabTitle:Objective-C}
@import Sentry;

[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.dsn = @"___PUBLIC_DSN___";
options.experimental.enableStandaloneAppStartTracing = YES;
}];
```

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:

```swift {tabTitle:Swift}
import Sentry

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.experimental.enableStandaloneAppStartTracing = true
options.tracesSampler = { context in
if context.transactionContext.operation == "app.start" {
return 1.0
}
return 0.1
}
}
Comment thread
itaybre marked this conversation as resolved.
```

```objc {tabTitle:Objective-C}
@import Sentry;

[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.dsn = @"___PUBLIC_DSN___";
options.experimental.enableStandaloneAppStartTracing = YES;
options.tracesSampler = ^NSNumber * _Nullable(SentrySamplingContext * context) {
if ([context.transactionContext.operation isEqualToString:@"app.start"]) {
return @1.0;
}
return @0.1;
};
}];
```
Comment thread
itaybre marked this conversation as resolved.

## Slow and Frozen Frames

This feature is available for iOS, tvOS, and Mac Catalyst.
Expand Down Expand Up @@ -361,6 +427,7 @@ Starting with version 8.48.0, the Sentry SDK offers extensions for the types `Da
The method signatures of these extensions resemble those of the original types, but they add a span to the current transaction. These methods can be used even when the Sentry SDK is not enabled—they will fall back to the original methods in that case.

**Behavior:**

- The SDK only creates spans when there is an active transaction on the scope
- Only file URLs are tracked (non-file URLs like HTTP URLs are ignored, as they are handled by network tracing)
- File size is automatically tracked for read and write operations
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading