From b04485254a0244cbc4380854a89c7cf55fe3de9b Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Wed, 5 Oct 2022 15:52:22 +0200 Subject: [PATCH 1/5] feat(java): Add custom performance metrics doc --- .../custom-performance-metrics/java.mdx | 36 +++++++++++++++++++ .../instrumentation/performance-metrics.mdx | 6 ++-- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/platform-includes/performance/custom-performance-metrics/java.mdx 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 0000000000000..070946296d599 --- /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 3121197656cca..08d618764b4c0 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 From cbdb6faf89e404ce4934966dc4f724520200803d Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Thu, 6 Oct 2022 14:54:59 +0200 Subject: [PATCH 2/5] feat(android): Add doc for automatic performance metrics --- .../performance/automatic-performance-metrics/android.mdx | 4 ++++ .../performance/instrumentation/performance-metrics.mdx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/platform-includes/performance/automatic-performance-metrics/android.mdx 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 0000000000000..6c72d9be81d09 --- /dev/null +++ b/src/platform-includes/performance/automatic-performance-metrics/android.mdx @@ -0,0 +1,4 @@ +If configured, the Android SDK can automatically collect the following performance metrics: + +* Cold and Warm app start time, see [App Start instrumentation](/platforms/android/performance/instrumentation/automatic-instrumentation/#app-start-instrumentation). +* Frozen and slow frame rendering, details can be found on the [Slow and Frozen Frames page](/platforms/android/performance/instrumentation/automatic-instrumentation/#slow-and-frozen-frames). diff --git a/src/platforms/common/performance/instrumentation/performance-metrics.mdx b/src/platforms/common/performance/instrumentation/performance-metrics.mdx index 08d618764b4c0..b92b28975778f 100644 --- a/src/platforms/common/performance/instrumentation/performance-metrics.mdx +++ b/src/platforms/common/performance/instrumentation/performance-metrics.mdx @@ -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. - + From d9c9a6d042085a3344d3dde9170fc8d05561af57 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Thu, 6 Oct 2022 18:58:54 +0200 Subject: [PATCH 3/5] Update src/platform-includes/performance/automatic-performance-metrics/android.mdx Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> --- .../performance/automatic-performance-metrics/android.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform-includes/performance/automatic-performance-metrics/android.mdx b/src/platform-includes/performance/automatic-performance-metrics/android.mdx index 6c72d9be81d09..87e58fcaf14a6 100644 --- a/src/platform-includes/performance/automatic-performance-metrics/android.mdx +++ b/src/platform-includes/performance/automatic-performance-metrics/android.mdx @@ -1,4 +1,4 @@ If configured, the Android SDK can automatically collect the following performance metrics: -* Cold and Warm app start time, see [App Start instrumentation](/platforms/android/performance/instrumentation/automatic-instrumentation/#app-start-instrumentation). -* Frozen and slow frame rendering, details can be found on the [Slow and Frozen Frames page](/platforms/android/performance/instrumentation/automatic-instrumentation/#slow-and-frozen-frames). +* 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). From 183cd43b62533cfd7e71c6df6c0e6021747d9cc7 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Thu, 6 Oct 2022 19:03:22 +0200 Subject: [PATCH 4/5] Update src/platform-includes/performance/automatic-performance-metrics/android.mdx Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> --- .../performance/automatic-performance-metrics/android.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform-includes/performance/automatic-performance-metrics/android.mdx b/src/platform-includes/performance/automatic-performance-metrics/android.mdx index 87e58fcaf14a6..040bd4ff22010 100644 --- a/src/platform-includes/performance/automatic-performance-metrics/android.mdx +++ b/src/platform-includes/performance/automatic-performance-metrics/android.mdx @@ -1,4 +1,4 @@ -If configured, the Android SDK can automatically collect the following performance metrics: +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). From a133490a4db48ed709f848b5a4c4f2a3fe1a3a90 Mon Sep 17 00:00:00 2001 From: Markus Hintersteiner Date: Mon, 10 Oct 2022 16:44:56 +0200 Subject: [PATCH 5/5] Update src/platform-includes/performance/automatic-performance-metrics/android.mdx Co-authored-by: Philipp Hofmann --- .../performance/automatic-performance-metrics/android.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform-includes/performance/automatic-performance-metrics/android.mdx b/src/platform-includes/performance/automatic-performance-metrics/android.mdx index 040bd4ff22010..2aa6c87b42c42 100644 --- a/src/platform-includes/performance/automatic-performance-metrics/android.mdx +++ b/src/platform-includes/performance/automatic-performance-metrics/android.mdx @@ -1,4 +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). +* 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).