Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RN Custom Metrics to use Sentry.setMeasurement #12496

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<PlatformContent includePath="performance/automatic-performance-metrics" />
The React Native SDK automatically collects the following performance metrics:

- <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/#app-start-instrumentation"> Cold and warm app start time </PlatformLink>
- <PlatformLink to="/tracing/instrumentation/automatic-instrumentation/#slow-and-frozen-frames"> Slow and frozen frame rendering </PlatformLink>

## Custom Measurements

Expand All @@ -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).

<PlatformContent includePath="performance/custom-performance-metrics" />
```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);
```

<Include name="custom-measurements-units-disclaimer.mdx" />

Expand Down

This file was deleted.

This file was deleted.

Loading