Skip to content

Commit d96d62c

Browse files
brustolinbruno-garciaphilipphofmannimatwawana
authored
feat(apple): Add docs on Core Data APM (#4815)
Co-authored-by: Bruno Garcia <[email protected]> Co-authored-by: Philipp Hofmann <[email protected]> Co-authored-by: Isabel <[email protected]>
1 parent 095c598 commit d96d62c

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/platforms/apple/common/configuration/swizzling.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ __macOS__
1010
- <PlatformLink to="/enriching-events/breadcrumbs/">Breadcrumbs for touch events</PlatformLink>
1111
- <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#http-instrumentation">Auto instrumentation for HTTP requests</PlatformLink>
1212
- <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#file-io-instrumentation">Auto instrumentation for File I/O operations</PlatformLink>
13+
- <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#core-data-instrumentation">Auto instrumentation for Core Data operations</PlatformLink>
1314
- <PlatformLink to="/performance/connect-services/">Automatically added sentry-trace header to HTTP requests for distributed tracing</PlatformLink>
1415

1516

@@ -19,6 +20,7 @@ __iOS, tvOS and Catalyst__
1920
- <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#uiviewcontroller-instrumentation">Auto instrumentation for UIViewControllers</PlatformLink>
2021
- <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#http-instrumentation">Auto instrumentation for HTTP requests</PlatformLink>
2122
- <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#file-io-instrumentation">Auto instrumentation for File I/O operations</PlatformLink>
23+
- <PlatformLink to="/performance/instrumentation/automatic-instrumentation/#core-data-instrumentation">Auto instrumentation for Core Data operations</PlatformLink>
2224
- <PlatformLink to="/performance/connect-services/">Automatically added sentry-trace header to HTTP requests for distributed tracing</PlatformLink>
2325

2426
Since Cocoa 7.5.0, you can opt out of swizzling using options. When you disable swizzling, the SDK disables the features above:

src/platforms/apple/common/performance/instrumentation/automatic-instrumentation.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,35 @@ SentrySDK.start { options in
132132
[NSString]: https://developer.apple.com/documentation/foundation/nsstring
133133
[NSBundle]: https://developer.apple.com/documentation/foundation/nsbundle
134134
135+
## Core Data Instrumentation
136+
137+
<Alert level="info" title="Important">
138+
139+
This is an experimental feature and requires an opt-in. Experimental features are still a work-in-progress and may have bugs. We recognize the irony.
140+
141+
</Alert>
142+
143+
The Sentry SDK adds spans for Core Data operations to ongoing transactions bound to the scope. Currently, the SDK supports fetch and save operations with [NSManagedObjectContext](https://developer.apple.com/documentation/coredata/nsmanagedobjectcontext).
144+
To enable file I/O instrumentation:
145+
146+
```swift {tabTitle:Swift}
147+
import Sentry
148+
149+
SentrySDK.start { options in
150+
options.dsn = "___PUBLIC_DSN___"
151+
options.enableCoreDataTracking = true
152+
}
153+
```
154+
155+
```objc {tabTitle:Objective-C}
156+
@import Sentry;
157+
158+
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
159+
options.dsn = @"___PUBLIC_DSN___";
160+
options.enableCoreDataTracking = YES;
161+
}];
162+
```
163+
135164
## Opt Out
136165
137166
You can opt out of UIViewController, App Start, Slow and Frozen Frames, and HTTP Instrumentation using options:

0 commit comments

Comments
 (0)