diff --git a/src/platform-includes/performance/automatic-performance-metrics/android.mdx b/src/platform-includes/performance/automatic-performance-metrics/android.mdx new file mode 100644 index 00000000000000..2aa6c87b42c42b --- /dev/null +++ b/src/platform-includes/performance/automatic-performance-metrics/android.mdx @@ -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). diff --git a/src/platform-includes/performance/custom-performance-metrics/java.mdx b/src/platform-includes/performance/custom-performance-metrics/java.mdx new file mode 100644 index 00000000000000..070946296d599e --- /dev/null +++ b/src/platform-includes/performance/custom-performance-metrics/java.mdx @@ -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) +``` diff --git a/src/platforms/common/performance/instrumentation/performance-metrics.mdx b/src/platforms/common/performance/instrumentation/performance-metrics.mdx index 3121197656ccaf..b92b28975778ff 100644 --- a/src/platforms/common/performance/instrumentation/performance-metrics.mdx +++ b/src/platforms/common/performance/instrumentation/performance-metrics.mdx @@ -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 @@ -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. - +