From 30b01e3aac8224ee71f28489949b3bb2e03b4503 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Mon, 12 Feb 2024 18:31:17 +0100 Subject: [PATCH 1/2] Add Sentry.metrics for React Native SDK --- docs/platforms/react-native/metrics/index.mdx | 87 +++++++++++++++++++ .../version-support-note/react-native.mdx | 5 ++ 2 files changed, 92 insertions(+) create mode 100644 docs/platforms/react-native/metrics/index.mdx create mode 100644 platform-includes/metrics/version-support-note/react-native.mdx diff --git a/docs/platforms/react-native/metrics/index.mdx b/docs/platforms/react-native/metrics/index.mdx new file mode 100644 index 0000000000000..954fecfe1d5a5 --- /dev/null +++ b/docs/platforms/react-native/metrics/index.mdx @@ -0,0 +1,87 @@ +--- +title: Set Up Metrics +description: "Learn how to measure the data points you care about by configuring Metrics in your React Native app." +--- + + + +Sentry metrics help you pinpoint and solve issues that impact user experience and app performance by measuring the data points that are important to you. You can track things like processing time, event size, user signups, and conversion rates, then correlate them back to tracing data in order to get deeper insights and solve issues faster. + +## Configure Metrics + + + +## Emit a Counter + +Counters are one of the more basic types of metrics and can be used to count certain event occurrences. + +To emit a counter, do the following: + + + +## Emit a Distribution + +Distributions help you get the most insights from your data by allowing you to obtain aggregations such as `p90`, `min`, `max`, and `avg`. + +To emit a distribution, do the following: + + + +## Emit a Set + +Sets are useful for looking at unique occurrences and counting the unique elements you added. + +To emit a set, do the following: + + + +## Emit a Gauge + +Gauges let you obtain aggregates like `min`, `max`, `avg`, `sum`, and `count`. They can be represented in a more space-efficient way than distributions, but they can't be used to get percentiles. If percentiles aren't important to you, we recommend using gauges. + +To emit a gauge, do the following: + + + +## Supported Performance Metric Units + +You can pass a unit as a optional parameter of the third argument of the `increment`, `distribution`, `set`, and `gauge` methods. + +Units augment metric values by giving meaning to what otherwise might be abstract numbers. Adding units also allows Sentry to offer controls - unit conversions, filters, and so on - based on those units. For values that are unitless, you can supply an empty string or `none`. + +These following units are understood by the Sentry backend, but you can supply any arbitrary units you want. + +### Duration Units + +- `nanosecond` +- `microsecond` +- `millisecond` +- `second` +- `minute` +- `hour` +- `day` +- `week` + +### Information Units + +- `bit` +- `byte` +- `kilobyte` +- `kibibyte` +- `megabyte` +- `mebibyte` +- `gigabyte` +- `gibibyte` +- `terabyte` +- `tebibyte` +- `petabyte` +- `pebibyte` +- `exabyte` +- `exbibyte` + +### Fraction Units + +- `ratio` +- `percent` + +If you want to explore further, you can find details about supported units in our [event ingestion documentation](https://getsentry.github.io/relay/relay_metrics/enum.MetricUnit.html). diff --git a/platform-includes/metrics/version-support-note/react-native.mdx b/platform-includes/metrics/version-support-note/react-native.mdx new file mode 100644 index 0000000000000..3d36fb7503f99 --- /dev/null +++ b/platform-includes/metrics/version-support-note/react-native.mdx @@ -0,0 +1,5 @@ + + +Metrics for React Native are supported with Sentry React Native SDK version `5.19.0` and above. + + From 8c3d2853c0c7821e7c7c9b2a2f7ed86455d469ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:56:48 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Liza Mock --- docs/platforms/react-native/metrics/index.mdx | 8 +++----- .../metrics/version-support-note/react-native.mdx | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/platforms/react-native/metrics/index.mdx b/docs/platforms/react-native/metrics/index.mdx index 954fecfe1d5a5..b3551440ce310 100644 --- a/docs/platforms/react-native/metrics/index.mdx +++ b/docs/platforms/react-native/metrics/index.mdx @@ -45,11 +45,9 @@ To emit a gauge, do the following: ## Supported Performance Metric Units -You can pass a unit as a optional parameter of the third argument of the `increment`, `distribution`, `set`, and `gauge` methods. +Adding a unit as a metric parameter will give meaning to what may otherwise look like abstract numbers. It also allows Sentry to offer controls - unit conversions, filters, and so on - based on the unit you select. You can pass a unit as an optional parameter of the third argument of the `increment`, `distribution`, `set`, and `gauge` methods. If a value has no units, you can supply an empty string or `none`. -Units augment metric values by giving meaning to what otherwise might be abstract numbers. Adding units also allows Sentry to offer controls - unit conversions, filters, and so on - based on those units. For values that are unitless, you can supply an empty string or `none`. - -These following units are understood by the Sentry backend, but you can supply any arbitrary units you want. +The following units are understood by the Sentry backend, but you can add any arbitrary unit you want. ### Duration Units @@ -84,4 +82,4 @@ These following units are understood by the Sentry backend, but you can supply a - `ratio` - `percent` -If you want to explore further, you can find details about supported units in our [event ingestion documentation](https://getsentry.github.io/relay/relay_metrics/enum.MetricUnit.html). +You can find additional details about supported units in our [event ingestion documentation](https://getsentry.github.io/relay/relay_metrics/enum.MetricUnit.html). diff --git a/platform-includes/metrics/version-support-note/react-native.mdx b/platform-includes/metrics/version-support-note/react-native.mdx index 3d36fb7503f99..b5e6e77682a02 100644 --- a/platform-includes/metrics/version-support-note/react-native.mdx +++ b/platform-includes/metrics/version-support-note/react-native.mdx @@ -1,5 +1,5 @@ -Metrics for React Native are supported with Sentry React Native SDK version `5.19.0` and above. +Metrics for React Native are supported in Sentry React Native SDK version `5.19.0` and above.