Skip to content
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
@@ -0,0 +1,18 @@
Adding custom metrics is supported in Sentry's Dart/Flutter SDK version `6.11.0` and above.

```dart
import 'package:sentry/sentry.dart';

final transaction = Sentry.getSpan();

// Record amount of memory used
transaction?.setMeasurement('memoryUsed', 123,
unit: SentryMeasurementUnit.byte);

// Record time when Footer component renders on page
transaction?.setMeasurement('ui.footerComponent.render', 1.3,
unit: SentryMeasurementUnit.second);

// Record amount of times localStorage was read
transaction?.setMeasurement('localStorageRead', 4);
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ sidebar_order: 20
supported:
- javascript
- python
- dart
- flutter
- react-native
notSupported:
- javascript.cordova
- javascript.electron
- react-native
- dotnet
- go
- java
Expand All @@ -16,8 +18,6 @@ notSupported:
- java.spring-boot
- apple
- unity
- dart
- flutter
- rust
- native
- php
Expand All @@ -31,7 +31,7 @@ description: "Learn how to attach performance metrics to your transactions."

Sentry's SDKs support sending performance metrics data to Sentry. These are numeric values attached to transactions that are aggregated and displayed in Sentry.

<PlatformSection notSupported={["python"]}>
<PlatformSection supported={["javascript"]} notSupported={["react-native"]}>

<PlatformContent includePath="performance/automatic-performance-metrics" />

Expand All @@ -51,7 +51,7 @@ To set a performance metric, you need to supply the following:

- name (`string`)
- value (any numeric type - `float`, `integer`, etc.)
- unit (`string`, can be empty or the string `'none'`).
- unit (`string`, Defaults to the string `none` if omitted.)

Sentry supports adding arbitrary custom units, but we recommend using one of the [supported units listed below](./#supported-performance-metric-units).

Expand Down