From 4b0485ffc577e4f15eb2db6b303410f71b7c0dd4 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Thu, 8 Feb 2024 22:49:50 +0100 Subject: [PATCH] chore: dotnet profiling tuneups (#9081) * chore: dotnet profiling tuneups * Apply suggestions from code review Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> * fixup --------- Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- .../dotnet/{ => common}/profiling/index.mdx | 19 ++++++++++--------- .../profiling/troubleshooting/index.mdx | 0 docs/product/profiling/getting-started.mdx | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) rename docs/platforms/dotnet/{ => common}/profiling/index.mdx (93%) rename docs/platforms/dotnet/{ => common}/profiling/troubleshooting/index.mdx (100%) diff --git a/docs/platforms/dotnet/profiling/index.mdx b/docs/platforms/dotnet/common/profiling/index.mdx similarity index 93% rename from docs/platforms/dotnet/profiling/index.mdx rename to docs/platforms/dotnet/common/profiling/index.mdx index 91c0a0de7f468..8a85d4cb91a7d 100644 --- a/docs/platforms/dotnet/profiling/index.mdx +++ b/docs/platforms/dotnet/common/profiling/index.mdx @@ -31,12 +31,13 @@ dotnet add package Sentry.Profiling --prerelease Profiling depends on Sentry’s performance monitoring product being enabled beforehand. To enable performance monitoring in the SDK, set the `TracesSampleRate` option to the desired value. -```csharp {tabTitle:iOS/MacCatalyst} +```csharp {tabTitle:Windows/Linux/macOS} SentrySdk.Init(options => { // ... usual setup options omitted for clarity (see Getting Started) ... // Sample rate for your transactions, e.g. value 0.1 means we want to report 10% of transactions. + // Setting 1.0 means all transactions are profiled. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; @@ -44,10 +45,17 @@ SentrySdk.Init(options => // e.g. 0.2 means we want to profile 20 % of the captured transactions. // We recommend adjusting this value in production. options.ProfilesSampleRate = 1.0; + + // Requires NuGet package: Sentry.Profiling + // Note: By default, the profiler is initialized asynchronously. This can be tuned by passing a desired initialization timeout to the constructor. + options.AddIntegration(new ProfilingIntegration( + // During startup, wait up to 500ms to profile the app startup code. This could make launching the app a bit slower so comment it out if your prefer profiling to start asynchronously + TimeSpan.FromMilliseconds(500) + )); }); ``` -```csharp {tabTitle:Windows/Linux/macOS} +```csharp {tabTitle:iOS/MacCatalyst} SentrySdk.Init(options => { // ... usual setup options omitted for clarity (see Getting Started) ... @@ -61,13 +69,6 @@ SentrySdk.Init(options => // e.g. 0.2 means we want to profile 20 % of the captured transactions. // We recommend adjusting this value in production. options.ProfilesSampleRate = 1.0; - - // Requires NuGet package: Sentry.Profiling - // Note: by default, the profiler is initialized asynchronously, this can be tuned by passing an desired initialization timeout to the constructor. - options.AddIntegration(new ProfilingIntegration( - // During startup, wait up to 500ms to profile the app startup code. This could make launching the app a bit slower so comment it out if your prefer profiling to start asynchronously - TimeSpan.FromMilliseconds(500) - )); }); ``` diff --git a/docs/platforms/dotnet/profiling/troubleshooting/index.mdx b/docs/platforms/dotnet/common/profiling/troubleshooting/index.mdx similarity index 100% rename from docs/platforms/dotnet/profiling/troubleshooting/index.mdx rename to docs/platforms/dotnet/common/profiling/troubleshooting/index.mdx diff --git a/docs/product/profiling/getting-started.mdx b/docs/product/profiling/getting-started.mdx index 42c3cde2c7af2..6cf55bc9add57 100644 --- a/docs/product/profiling/getting-started.mdx +++ b/docs/product/profiling/getting-started.mdx @@ -20,7 +20,7 @@ Profiling depends on Sentry's performance monitoring product being enabled befor - [iOS](/platforms/apple/guides/ios/profiling/) - [React Native](/platforms/react-native/profiling/) [beta] - [Flutter](/platforms/flutter/profiling/) [experimental, iOS and macOS only] - - [.NET](/platforms/dotnet/profiling/) [experimental, iOS only] + - [.NET](/platforms/dotnet/guides/maui/profiling/) [experimental, iOS only] - Standalone and server apps - [.NET](/platforms/dotnet/profiling/) [experimental] - [Node.js](/platforms/node/profiling/)