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,4 @@
If configured, the Android SDK automatically collects the following performance metrics:

* Cold and warm app start time - learn more in [App Start Instrumentation](/platforms/android/performance/instrumentation/automatic-instrumentation/#app-start-instrumentation).
* Frozen and slow frame rendering - learn more in [Slow and Frozen Frames](/platforms/android/performance/instrumentation/automatic-instrumentation/#slow-and-frozen-frames).
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Adding custom metrics is supported in Sentry's Java SDK version `6.5.0` and above.

```java {tabTitle:Java}
import io.sentry.ISpan;
import io.sentry.MeasurementUnit;
import io.sentry.Sentry;

final ISpan span = Sentry.getSpan();
if (span != null) {
// Record amount of memory used
span.setMeasurement("memory_used", 64, MeasurementUnit.Information.MEGABYTE);

// Record time it took to load user profile
span.setMeasurement("user_profile_loading_time", 1.3, MeasurementUnit.Duration.SECOND);

// Record number of times the screen was loaded
span.setMeasurement("screen_load_count", 4);
}
```


```kotlin {tabTitle:Kotlin}
import io.sentry.MeasurementUnit
import io.sentry.Sentry

val span = Sentry.getSpan()

// Record amount of memory used
span?.setMeasurement("memory_used", 64, MeasurementUnit.Information.MEGABYTE)

// Record time it took to load user profile
span?.setMeasurement("user_profile_loading_time", 1.3, MeasurementUnit.Duration.SECOND)

// Record number of times the screen was loaded
span?.setMeasurement("screen_load_count", 4)
```
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ supported:
- dart
- flutter
- react-native
- java
- java.spring-boot
- android
notSupported:
- javascript.cordova
- javascript.electron
- dotnet
- go
- java
- android
- ruby
- java.spring-boot
- apple
- unity
- rust
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 supported={["javascript"]} notSupported={["react-native"]}>
<PlatformSection supported={["javascript", "android"]} notSupported={["react-native"]}>

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

Expand Down