---
title: "MetricKit"
description: "Learn how to subscribe to MetricKit diagnostic reports and send them to Sentry."
url: https://docs.sentry.io/platforms/react-native/configuration/metric-kit/
---

# MetricKit | Sentry for React Native

The [MetricKit](https://developer.apple.com/documentation/metrickit) integration subscribes to [MXHangDiagnostic](https://developer.apple.com/documentation/metrickit/mxhangdiagnostic), [MXDiskWriteExceptionDiagnostic](https://developer.apple.com/documentation/metrickit/mxdiskwriteexceptiondiagnostic), and [MXCPUExceptionDiagnostic](https://developer.apple.com/documentation/metrickit/mxcpuexceptiondiagnostic), which it converts to Sentry events.

This feature is available on React Native SDK version 8.22.0 and up. The SDK supports it on iOS 15 and up and macOS 12 and up, because in these versions MetricKit delivers diagnostic reports immediately, which allows the SDK to apply current data from the scope. It isn't available on Android or tvOS.

Enable this feature by setting the `enableMetricKit` option to `true`:

```javascript
import * as Sentry from "@sentry/react-native";

Sentry.init({
  dsn: "https://<key>@o<orgId>.ingest.sentry.io/<projectId>",
  enableMetricKit: true,
});
```

You can identify MetricKit events by looking at the `mx_hang_diagnostic`, `mx_cpu_exception`, and `mx_disk_write_exception` `mechanism.type`.

## [MetricKit Hangs and App Hangs](https://docs.sentry.io/platforms/react-native/configuration/metric-kit.md#metrickit-hangs-and-app-hangs)

MetricKit hang diagnostics are reported by the operating system and are separate from the app hangs the SDK detects itself with [App Hang Tracking](https://docs.sentry.io/platforms/react-native/configuration/app-hangs.md). Both features can be enabled at the same time, but a single unresponsive period may then be reported twice, once from each source.

If you only want the SDK's own detection, leave `enableMetricKit` disabled. If you want to rely on MetricKit alone, set `enableAppHangTracking` to `false`.

## [Limitations](https://docs.sentry.io/platforms/react-native/configuration/metric-kit.md#limitations)

The SDK has no control over the stack traces provided by MetricKit. Some only offer a couple of frames. If these aren't useful to you, you can drop them in [`beforeSend`](https://docs.sentry.io/platforms/react-native/configuration/filtering.md#filtering-error-events).

To read more about how the underlying integration works, check out the `sentry-cocoa` [documentation](https://docs.sentry.io/platforms/apple/configuration/metric-kit.md).
