diff --git a/docs/platforms/react-native/tracing/instrumentation/performance-metrics.mdx b/docs/platforms/react-native/tracing/instrumentation/performance-metrics.mdx index 854f3707b84678..57947bbb1be359 100644 --- a/docs/platforms/react-native/tracing/instrumentation/performance-metrics.mdx +++ b/docs/platforms/react-native/tracing/instrumentation/performance-metrics.mdx @@ -6,7 +6,10 @@ sidebar_order: 20 Sentry's SDKs support sending performance metrics data to Sentry. These are numeric values attached to transactions that are aggregated and displayed in Sentry. - +The React Native SDK automatically collects the following performance metrics: + +- Cold and warm app start time +- Slow and frozen frame rendering ## Custom Measurements @@ -20,7 +23,16 @@ To set a performance measurement, you need to supply the following: Sentry supports adding arbitrary custom units, but we recommend using one of the [supported units listed below](./#supported-measurement-units). - +```javascript +// Record amount of memory used +Sentry.setMeasurement("memoryUsed", 123, "byte"); + +// Record time when Footer component renders on page +Sentry.setMeasurement("ui.footerComponent.render", 1.3, "second"); + +// Record amount of times localStorage was read +Sentry.setMeasurement("localStorageRead", 4); +``` diff --git a/platform-includes/performance/automatic-performance-metrics/react-native.mdx b/platform-includes/performance/automatic-performance-metrics/react-native.mdx deleted file mode 100644 index e557200c6886a6..00000000000000 --- a/platform-includes/performance/automatic-performance-metrics/react-native.mdx +++ /dev/null @@ -1,6 +0,0 @@ -If configured, the React Native SDK automatically collects the following performance metrics: - -- Cold and warm app start time - . -- Slow and frozen frame rendering - . diff --git a/platform-includes/performance/custom-performance-metrics/react-native.mdx b/platform-includes/performance/custom-performance-metrics/react-native.mdx deleted file mode 100644 index 11c3c45dd0b52d..00000000000000 --- a/platform-includes/performance/custom-performance-metrics/react-native.mdx +++ /dev/null @@ -1,16 +0,0 @@ -Adding custom measurements is supported in Sentry's React Native SDK version `4.0.0` and above. - -```javascript -import * as Sentry from "@sentry/react-native"; - -const transaction = Sentry.getCurrentScope().getTransaction(); - -// Record amount of memory used -transaction.setMeasurement("memoryUsed", 123, "byte"); - -// Record time when Footer component renders on page -transaction.setMeasurement("ui.footerComponent.render", 1.3, "second"); - -// Record amount of times localStorage was read -transaction.setMeasurement("localStorageRead", 4); -```