From d284b4b913788ef04fb6a28a8c25af92b795625d Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Wed, 26 Oct 2022 11:41:40 -0700 Subject: [PATCH 1/4] Add .NET Custom Performance Metrics --- .../custom-performance-metrics/dotnet.mdx | 21 +++++++++++++++++++ .../instrumentation/performance-metrics.mdx | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/platform-includes/performance/custom-performance-metrics/dotnet.mdx diff --git a/src/platform-includes/performance/custom-performance-metrics/dotnet.mdx b/src/platform-includes/performance/custom-performance-metrics/dotnet.mdx new file mode 100644 index 0000000000000..8a35d1b30125a --- /dev/null +++ b/src/platform-includes/performance/custom-performance-metrics/dotnet.mdx @@ -0,0 +1,21 @@ +Adding custom metrics is supported in Sentry's .NET SDK, version `3.23.0` and above. + +The following example shows how to set custom metrics on a `transaction`, including how obtain the current `span` and get its `transaction`. +If you already have the `transaction` or `span`, you can use it directly. + +```csharp +var span = SentrySdk.GetSpan(); // or hub.GetSpan() +if (span != null) +{ + var transaction = span.GetTransaction(); + + // Record amount of memory used + transaction.SetMeasurement("memory_used", 64, MeasurementUnit.Information.Megabyte); + + // Record time it took to load user profile + transaction.SetMeasurement("user_profile_loading_time", 1.3, MeasurementUnit.Duration.Second); + + // Record number of times the screen was loaded + transaction.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 b2dba638bbf97..fc3f3a0eec16c 100644 --- a/src/platforms/common/performance/instrumentation/performance-metrics.mdx +++ b/src/platforms/common/performance/instrumentation/performance-metrics.mdx @@ -11,10 +11,10 @@ supported: - java.spring-boot - android - apple + - dotnet notSupported: - javascript.cordova - javascript.electron - - dotnet - go - ruby - unity From a5677ab1df6a116563c745f28e25bf8ed6b0dc8e Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Wed, 26 Oct 2022 11:42:00 -0700 Subject: [PATCH 2/4] Update list of SDKs supporting custom metrics --- src/docs/product/performance/metrics.mdx | 3 +-- src/includes/custom-metrics-supported-sdks.mdx | 7 +++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 src/includes/custom-metrics-supported-sdks.mdx diff --git a/src/docs/product/performance/metrics.mdx b/src/docs/product/performance/metrics.mdx index 2c1eba782a1d3..fd815033c0bb2 100644 --- a/src/docs/product/performance/metrics.mdx +++ b/src/docs/product/performance/metrics.mdx @@ -111,8 +111,7 @@ For example, you might want to set a custom metric to track: You define and configure custom metrics in the SDK. Currently, you can set custom metrics in: -- [JavaScript (version `7.0.0` or higher)](/platforms/javascript/performance/instrumentation/performance-metrics/) -- [Python (version `1.5.12` or higher)](/platforms/python/performance/instrumentation/performance-metrics/) + Custom metrics are accessible to you in [sentry.io](https://sentry.io) when you: diff --git a/src/includes/custom-metrics-supported-sdks.mdx b/src/includes/custom-metrics-supported-sdks.mdx new file mode 100644 index 0000000000000..d2518593b73a8 --- /dev/null +++ b/src/includes/custom-metrics-supported-sdks.mdx @@ -0,0 +1,7 @@ +- [JavaScript (version `7.0.0` or later)](/platforms/javascript/performance/instrumentation/performance-metrics/) +- [Python (version `1.5.12` or later)](/platforms/python/performance/instrumentation/performance-metrics/) +- [Apple (version `7.28.0` or later)](/platforms/apple/performance/instrumentation/performance-metrics/) +- [Android (version `6.5.0` or later)](/platforms/android/performance/instrumentation/performance-metrics/) +- [Dart and Flutter (version `6.11.0` or later)](/platforms/dart/performance/instrumentation/performance-metrics/) +- [Java (version `6.5.0` or later)](/platforms/java/performance/instrumentation/performance-metrics/) +- [.NET (version `3.23.0` or later)](/platforms/dotnet/performance/instrumentation/performance-metrics/) From 4e654312602af3cf8e04e2a1b9dc5a24b7453b97 Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Wed, 26 Oct 2022 11:42:11 -0700 Subject: [PATCH 3/4] Minor edit --- .../dynamic-sampling/current-limitations.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/product/data-management-settings/dynamic-sampling/current-limitations.mdx b/src/docs/product/data-management-settings/dynamic-sampling/current-limitations.mdx index d8b007d3b687b..4d6aa850ebe26 100644 --- a/src/docs/product/data-management-settings/dynamic-sampling/current-limitations.mdx +++ b/src/docs/product/data-management-settings/dynamic-sampling/current-limitations.mdx @@ -16,7 +16,7 @@ The **Dynamic Sampling** feature is currently only available for the following S -If your application relies on any Sentry SDK that isn't specified above, then you won’t be able to use Sentry's **Dynamic Sampling**. +If your application relies on any Sentry SDK that isn't specified above, then you won't be able to use Sentry's **Dynamic Sampling**. ## Trace rules can only select based on the attributes of the initial transaction From 5cb55c9d6e284ffc500ef9a5e6246974b890c7f1 Mon Sep 17 00:00:00 2001 From: Matt Johnson-Pint Date: Thu, 27 Oct 2022 00:28:40 -0700 Subject: [PATCH 4/4] Update custom-metrics-supported-sdks.mdx --- src/includes/custom-metrics-supported-sdks.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/includes/custom-metrics-supported-sdks.mdx b/src/includes/custom-metrics-supported-sdks.mdx index d2518593b73a8..45598133b1fd0 100644 --- a/src/includes/custom-metrics-supported-sdks.mdx +++ b/src/includes/custom-metrics-supported-sdks.mdx @@ -2,6 +2,8 @@ - [Python (version `1.5.12` or later)](/platforms/python/performance/instrumentation/performance-metrics/) - [Apple (version `7.28.0` or later)](/platforms/apple/performance/instrumentation/performance-metrics/) - [Android (version `6.5.0` or later)](/platforms/android/performance/instrumentation/performance-metrics/) -- [Dart and Flutter (version `6.11.0` or later)](/platforms/dart/performance/instrumentation/performance-metrics/) +- [Dart (version `6.11.0` or later)](/platforms/dart/performance/instrumentation/performance-metrics/) +- [Flutter (version `6.11.0` or later)](/platforms/flutter/performance/instrumentation/performance-metrics/) - [Java (version `6.5.0` or later)](/platforms/java/performance/instrumentation/performance-metrics/) +- [React Native (version `4.0.0` or later)](/platforms/react-native/performance/instrumentation/performance-metrics/) - [.NET (version `3.23.0` or later)](/platforms/dotnet/performance/instrumentation/performance-metrics/)