Skip to content
7 changes: 3 additions & 4 deletions src/platforms/apple/common/configuration/metric-kit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ sidebar_order: 20
description: "This feature, once enabled, subscribes to MXDiagnosticPayload data of MetricKit and it to Sentry."
---

<Include name="feature-stage-alpha.mdx" />

Once enabled, this feature subscribes to [MetricKit's](https://developer.apple.com/documentation/metrickit) [MXDiagnosticPayload](https://developer.apple.com/documentation/metrickit/mxdiagnosticpayload) data, converts it to events, and sends it to Sentry. This feature is available on Cocoa 8.0.0 and up.
Once enabled, this feature subscribes to [MetricKit's](https://developer.apple.com/documentation/metrickit) [MXDiagnosticPayload](https://developer.apple.com/documentation/metrickit/mxdiagnosticpayload) data, converts it to events, and sends it to Sentry. This feature is available on Cocoa 8.14.0 and up.

The MetricKit integration subscribes to:

Expand All @@ -15,8 +13,9 @@ The MetricKit integration subscribes to:
- [MXCPUExceptionDiagnostic](https://developer.apple.com/documentation/metrickit/mxcpuexceptiondiagnostic)

The SDK supports this feature from iOS 15 and up and macOS 12 and up because in these versions, MetricKit delivers diagnostic reports immediately, which allows the Sentry SDK to apply current data from the scope.
It is worth noting that the Cocoa SDK has no control over the stacktraces MetricKit provides. Some stacktraces from MetricKit only offer a couple of frames. You can drop such events in <PlatformLink to="/configuration/filtering/#filtering-error-events/">`beforeSend`</PlatformLink> and identify MetricKit events by looking at the `mechanism.type` of the `exception`, which are `mx_hang_diagnostic`, `mx_cpu_exception`, and `mx_disk_write_exception`.

This is an experimental feature requiring opt-in, and can be enabled by setting the `enableMetricKit` option to `true`:
This feature requires opt-in, and can be enabled by setting the `enableMetricKit` option to `true`:

<SignInNote />

Expand Down