-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Sentry.metrics for React Native SDK (#9119)
Co-authored-by: Liza Mock <[email protected]>
- Loading branch information
1 parent
a69bd83
commit f0c184e
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
title: Set Up Metrics | ||
description: "Learn how to measure the data points you care about by configuring Metrics in your React Native app." | ||
--- | ||
|
||
<PlatformContent includePath="metrics/version-support-note" /> | ||
|
||
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 | ||
|
||
<PlatformContent includePath="metrics/configure" /> | ||
|
||
## 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: | ||
|
||
<PlatformContent includePath="metrics/counter-snippet" /> | ||
|
||
## 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: | ||
|
||
<PlatformContent includePath="metrics/distribution-snippet" /> | ||
|
||
## 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: | ||
|
||
<PlatformContent includePath="metrics/set-snippet" /> | ||
|
||
## 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: | ||
|
||
<PlatformContent includePath="metrics/gauge-snippet" /> | ||
|
||
## Supported Performance Metric Units | ||
|
||
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`. | ||
|
||
The following units are understood by the Sentry backend, but you can add any arbitrary unit 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` | ||
|
||
You can find additional details about supported units in our [event ingestion documentation](https://getsentry.github.io/relay/relay_metrics/enum.MetricUnit.html). |
5 changes: 5 additions & 0 deletions
5
platform-includes/metrics/version-support-note/react-native.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Note> | ||
|
||
Metrics for React Native are supported in Sentry React Native SDK version `5.19.0` and above. | ||
|
||
</Note> |