diff --git a/docs/platforms/dotnet/guides/aspnet/index.mdx b/docs/platforms/dotnet/guides/aspnet/index.mdx index 12e1e5274d6fbb..9dc391e97ef7b7 100644 --- a/docs/platforms/dotnet/guides/aspnet/index.mdx +++ b/docs/platforms/dotnet/guides/aspnet/index.mdx @@ -34,7 +34,7 @@ as well as your logs as breadcrumbs. The logging integrations also capture event You configure the SDK in the `Global.asax.cs`: -```csharp {"onboardingOptions": {"performance": "22-25, 35-44"}} +```csharp using System; using System.Web; using Sentry.AspNet; @@ -56,9 +56,11 @@ public class MvcApplication : HttpApplication // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance // If you also installed the Sentry.EntityFramework package options.AddEntityFramework(); @@ -69,6 +71,7 @@ public class MvcApplication : HttpApplication // Global error catcher protected void Application_Error() => Server.CaptureLastError(); + // ___PRODUCT_OPTION_START___ performance protected void Application_BeginRequest() { Context.StartSentryTransaction(); @@ -78,6 +81,7 @@ public class MvcApplication : HttpApplication { Context.FinishSentryTransaction(); } + // ___PRODUCT_OPTION_END___ performance protected void Application_End() { diff --git a/docs/platforms/dotnet/guides/aspnetcore/index.mdx b/docs/platforms/dotnet/guides/aspnetcore/index.mdx index 9d1011bb5f27c9..a97db264a34792 100644 --- a/docs/platforms/dotnet/guides/aspnetcore/index.mdx +++ b/docs/platforms/dotnet/guides/aspnetcore/index.mdx @@ -69,7 +69,7 @@ The framework takes configuration settings from `appsettings.json`, environment An example of some of the options that can be configured via `appsettings.json`: -```json {filename:appsettings.json} {"onboardingOptions": {"performance": "10"}} +```json {filename:appsettings.json} "Sentry": { "Dsn": "___PUBLIC_DSN___", "SendDefaultPii": true, @@ -79,7 +79,9 @@ An example of some of the options that can be configured via `appsettings.json`: "AttachStackTrace": true, "Debug": true, "DiagnosticLevel": "Error", + // ___PRODUCT_OPTION_START___ performance "TracesSampleRate": 1.0 + // ___PRODUCT_OPTION_END___ performance }, ``` @@ -107,11 +109,13 @@ ASP.NET Core will automatically read this environment variable and bind it to th Finally, any settings that can be configured via `appsettings.json` or environment variables can also be configured via code. Some settings can only be configured in code, such as the `BeforeSend` callback: -```csharp {"onboardingOptions": {"performance": "4"}} +```csharp .UseSentry(options => { options.SendDefaultPii = true; // Adds request URL and headers, IP and name for users, etc. + // ___PRODUCT_OPTION_START___ performance options.TracesSampleRate = 1.0; // Set this to configure automatic tracing + // ___PRODUCT_OPTION_END___ performance options.SetBeforeSend((@event, hint) => { // Never report server names @@ -121,10 +125,12 @@ Finally, any settings that can be configured via `appsettings.json` or environme }) ``` -```fsharp {"onboardingOptions": {"performance": "3"}} +```fsharp .UseSentry (fun options -> options.SendDefaultPii <- true // Adds request URL and headers, IP and name for users, etc. + // ___PRODUCT_OPTION_START___ performance options.TracesSampleRate <- 1.0 // Set this to configure automatic tracing + // ___PRODUCT_OPTION_END___ performance options.SetBeforeSend(fun event hint -> // Never report server names event.ServerName <- null diff --git a/docs/platforms/dotnet/guides/aws-lambda/index.mdx b/docs/platforms/dotnet/guides/aws-lambda/index.mdx index afd3ad9ccda7bd..82e03fe40923da 100644 --- a/docs/platforms/dotnet/guides/aws-lambda/index.mdx +++ b/docs/platforms/dotnet/guides/aws-lambda/index.mdx @@ -35,7 +35,7 @@ All `ASP.NET Core` configurations are valid here. But one configuration in parti `FlushOnCompletedRequest` ensures all events are flushed out. This is because the general ASP.NET Core hooks for when the process is exiting are not guaranteed to run in a serverless environment. This setting ensures that no event is lost if AWS recycles the process. -```csharp {"onboardingOptions": {"performance": "14-17"}} +```csharp public class LambdaEntryPoint : Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFunction { protected override void Init(IWebHostBuilder builder) @@ -49,10 +49,12 @@ public class LambdaEntryPoint : Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFu o.Debug = true; // Adds request URL and headers, IP and name for users, etc. o.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set TracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production o.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance // Required in Serverless environments options.FlushOnCompletedRequest = true; }) diff --git a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx index bf854386b4fc37..22f681b1dfe8f1 100644 --- a/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx +++ b/docs/platforms/dotnet/guides/azure-functions-worker/index.mdx @@ -33,7 +33,7 @@ This package extends [Sentry.Extensions.Logging](/platforms/dotnet/guides/extens Sentry integration with Azure Functions is done by calling `.UseSentry()` and specifying the options, for example: -```csharp {"onboardingOptions": {"performance": "12-14"}} +```csharp using Sentry.Azure.Functions.Worker; var builder = FunctionsApplication.CreateBuilder(args); @@ -45,9 +45,11 @@ builder.UseSentry(options => options.Debug = true; // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance }); builder.Build().Run(); @@ -59,7 +61,7 @@ If using the ASP.NET Core integration add `UseSentry` to the `ConfigureFunctions -```csharp {"onboardingOptions": {"performance": "13-15"}} +```csharp using Sentry.Azure.Functions.Worker; var host = new HostBuilder() @@ -72,9 +74,11 @@ var host = new HostBuilder() options.Debug = true; // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance }); }) .Build(); diff --git a/docs/platforms/dotnet/guides/blazor-webassembly/index.mdx b/docs/platforms/dotnet/guides/blazor-webassembly/index.mdx index 82a2aa69503883..359c3ead61f016 100644 --- a/docs/platforms/dotnet/guides/blazor-webassembly/index.mdx +++ b/docs/platforms/dotnet/guides/blazor-webassembly/index.mdx @@ -28,7 +28,7 @@ Sentry integration with Blazor WebAssembly is done by calling `.UseSentry()` and -```csharp {"onboardingOptions": {"performance": "9"}} +```csharp var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.UseSentry(options => { @@ -37,7 +37,9 @@ builder.UseSentry(options => options.Debug = true; // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance options.TracesSampleRate = 0.1; + // ___PRODUCT_OPTION_END___ performance }); // Captures logError and higher as events diff --git a/docs/platforms/dotnet/guides/entityframework/index.mdx b/docs/platforms/dotnet/guides/entityframework/index.mdx index c663056b0f3ddd..f93cdd60fd7ca4 100644 --- a/docs/platforms/dotnet/guides/entityframework/index.mdx +++ b/docs/platforms/dotnet/guides/entityframework/index.mdx @@ -45,7 +45,7 @@ Add the Entity Framework 6 support to your project in one step: For example, configuring an ASP.NET app with _global.asax_: -```csharp {filename:global.asax} {"onboardingOptions": {"performance": "17-19, 28-37"}} +```csharp {filename:global.asax} using System; using System.Configuration; using Sentry.AspNet; @@ -62,9 +62,11 @@ public class MvcApplication : System.Web.HttpApplication options.Dsn = ConfigurationManager.AppSettings["SentryDsn"]; // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance // Add the EntityFramework integration options.AddEntityFramework(); }); @@ -73,6 +75,7 @@ public class MvcApplication : System.Web.HttpApplication // Global error catcher protected void Application_Error() => Server.CaptureLastError(); + // ___PRODUCT_OPTION_START___ performance protected void Application_BeginRequest() { Context.StartSentryTransaction(); @@ -83,6 +86,7 @@ public class MvcApplication : System.Web.HttpApplication Context.FinishSentryTransaction(); } + // ___PRODUCT_OPTION_END___ performance public override void Dispose() { _sentrySdk.Dispose(); diff --git a/docs/platforms/dotnet/guides/maui/index.mdx b/docs/platforms/dotnet/guides/maui/index.mdx index 0e077f4dfad8ee..ae6fb9c37896ff 100644 --- a/docs/platforms/dotnet/guides/maui/index.mdx +++ b/docs/platforms/dotnet/guides/maui/index.mdx @@ -45,7 +45,7 @@ This package extends [Sentry.Extensions.Logging](/platforms/dotnet/guides/extens In your `MauiProgram.cs` file, call `UseSentry` on your `MauiAppBuilder`, and include any options you would like to set. The `Dsn` is the only required parameter. -```csharp {"onboardingOptions": {"performance": "22-25"}} +```csharp public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); @@ -67,9 +67,11 @@ public static MauiApp CreateMauiApp() // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set TracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance // Other Sentry options can be set here. }) diff --git a/docs/platforms/dotnet/guides/uwp/index.mdx b/docs/platforms/dotnet/guides/uwp/index.mdx index 9ba11ed09d0163..6f9f4082a4da7e 100644 --- a/docs/platforms/dotnet/guides/uwp/index.mdx +++ b/docs/platforms/dotnet/guides/uwp/index.mdx @@ -28,7 +28,7 @@ The SDK should be initialized in the constructor of your application class (usua -```csharp {"onboardingOptions": {"performance": "20-23"}} +```csharp using Sentry.Protocol; using UnhandledExceptionEventArgs = Windows.UI.Xaml.UnhandledExceptionEventArgs; @@ -48,10 +48,12 @@ sealed partial class App : Application // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance // Enable Global Mode since this is a client app. options.IsGlobalModeEnabled = true; diff --git a/docs/platforms/dotnet/guides/winforms/index.mdx b/docs/platforms/dotnet/guides/winforms/index.mdx index 318cf735a49d2f..479355d6e8d4ab 100644 --- a/docs/platforms/dotnet/guides/winforms/index.mdx +++ b/docs/platforms/dotnet/guides/winforms/index.mdx @@ -30,7 +30,7 @@ You should also set `Application.SetUnhandledExceptionMode(UnhandledExceptionMod A complete example of the recommended startup is as follows: -```csharp {"onboardingOptions": {"performance": "34-37"}} +```csharp using System; using System.Windows.Forms; @@ -64,10 +64,12 @@ namespace WindowsFormsApp1 // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. TracesSampleRate = 1.0, + // ___PRODUCT_OPTION_END___ performance // Enable Global Mode since this is a client app IsGlobalModeEnabled = true, diff --git a/docs/platforms/dotnet/guides/winui/index.mdx b/docs/platforms/dotnet/guides/winui/index.mdx index 77693cb7d3e712..beb9ca8e3f0a35 100644 --- a/docs/platforms/dotnet/guides/winui/index.mdx +++ b/docs/platforms/dotnet/guides/winui/index.mdx @@ -32,7 +32,7 @@ In addition to capturing errors, you can monitor interactions between multiple s Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. -```csharp {"onboardingOptions": {"performance": "19-22"}} +```csharp using Sentry.Protocol; sealed partial class App : Application @@ -50,10 +50,12 @@ sealed partial class App : Application // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set TracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance // Enable Global Mode since this is a client app. options.IsGlobalModeEnabled = true; @@ -80,7 +82,7 @@ Do not initialize the SDK in the `OnLaunched` event of the application or the `H -```csharp {"onboardingOptions": {"performance": "21-24"}} +```csharp // Add these to your existing using statements. using Sentry.Protocol; using UnhandledExceptionEventArgs = Microsoft.UI.Xaml.UnhandledExceptionEventArgs; @@ -100,10 +102,12 @@ sealed partial class App : Application // Adds request URL and headers, IP and name for users, etc. o.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set TracesSampleRate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. o.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance // Enable Global Mode since this is a client app. o.IsGlobalModeEnabled = true; diff --git a/docs/platforms/dotnet/guides/wpf/index.mdx b/docs/platforms/dotnet/guides/wpf/index.mdx index 965afbb99df940..17bcf507ee8436 100644 --- a/docs/platforms/dotnet/guides/wpf/index.mdx +++ b/docs/platforms/dotnet/guides/wpf/index.mdx @@ -30,7 +30,7 @@ The SDK should be initialized in the constructor of your application class (usua The SDK automatically handles `AppDomain.UnhandledException`. On WPF, for production apps (when no debugger is attached), WPF catches exception to show the dialog to the user. You can also configure your app to capture those exceptions before the dialog shows up: -```csharp {"onboardingOptions": {"performance": "18-21"}} +```csharp using System.Windows; public partial class App : Application @@ -48,10 +48,12 @@ public partial class App : Application // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set traces_sample_rate to 1.0 to capture 100% of transactions for tracing. // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance // Enable Global Mode since this is a client app options.IsGlobalModeEnabled = true; diff --git a/docs/platforms/dotnet/guides/xamarin/index.mdx b/docs/platforms/dotnet/guides/xamarin/index.mdx index f5b5c96fc4fe7e..4dd41a94aad029 100644 --- a/docs/platforms/dotnet/guides/xamarin/index.mdx +++ b/docs/platforms/dotnet/guides/xamarin/index.mdx @@ -26,7 +26,7 @@ After you’ve completed setting up a project in Sentry, Sentry will give you a You should initialize the SDK as early as possible, for an example, the start of OnCreate on MainActivity for Android, and, the top of FinishedLaunching on AppDelegate for iOS). -```csharp {"onboardingOptions": {"performance": "10-13"}} +```csharp SentryXamarin.Init(options => { options.AddXamarinFormsIntegration(); @@ -36,10 +36,12 @@ SentryXamarin.Init(options => options.Debug = true; // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // Set TracesSampleRate to 1.0 to capture 100% // of transactions for tracing. // We recommend adjusting this value in production options.TracesSampleRate = 1.0; + // ___PRODUCT_OPTION_END___ performance }); // App code diff --git a/docs/platforms/dotnet/index.mdx b/docs/platforms/dotnet/index.mdx index ec16dde93e1cd8..fc934b9e77678a 100644 --- a/docs/platforms/dotnet/index.mdx +++ b/docs/platforms/dotnet/index.mdx @@ -81,17 +81,21 @@ Install the **NuGet** package to add the Sentry dependency: To capture all errors, even the one during the startup of your application, you should initialize the Sentry .NET SDK as soon as possible. -```csharp {"onboardingOptions": {"performance": "7-8", "profiling": "9-10"}} +```csharp SentrySdk.Init(options => { options.Dsn = "https://eb18e953812b41c3aeb042e666fd3b5c@o447951.ingest.us.sentry.io/5428537"; options.Debug = true; // Adds request URL and headers, IP and name for users, etc. options.SendDefaultPii = true; + // ___PRODUCT_OPTION_START___ performance // A fixed sample rate of 1.0 - 100% of all transactions are getting sent options.TracesSampleRate = 1.0f; + // ___PRODUCT_OPTION_END___ performance + // ___PRODUCT_OPTION_START___ profiling // A sample rate for profiling - this is relative to TracesSampleRate options.ProfilesSampleRate = 1.0f; + // ___PRODUCT_OPTION_END___ profiling }); ```