From a554ff8ab96612f78ed7a525f9822e6777283b58 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Mon, 14 Oct 2024 19:56:10 -0400 Subject: [PATCH] remove imports for dotnet --- docs/platforms/dotnet/common/migration/index.mdx | 3 --- docs/platforms/dotnet/common/tracing/index.mdx | 2 -- docs/platforms/dotnet/common/user-feedback/index.mdx | 2 -- docs/platforms/dotnet/guides/aspnet/index.mdx | 1 - .../guides/aspnet/tracing/included-instrumentation.mdx | 2 -- .../tracing/instrumentation/automatic-instrumentation.mdx | 1 - docs/platforms/dotnet/guides/entityframework/index.mdx | 1 - docs/platforms/dotnet/guides/uwp/index.mdx | 1 - docs/platforms/dotnet/guides/winforms/index.mdx | 1 - docs/platforms/dotnet/guides/winui/index.mdx | 2 -- docs/platforms/unity/user-feedback/index.mdx | 2 -- platform-includes/capture-error/dotnet.mdx | 2 -- platform-includes/capture-message/dotnet.mdx | 4 ---- .../configuration/before-send-transaction/dotnet.mdx | 4 +--- .../configuration/before-send-transaction/powershell.mdx | 5 +---- platform-includes/configuration/before-send/dotnet.mdx | 2 -- platform-includes/configuration/config-intro/dotnet.mdx | 2 -- .../configuration/config-intro/dotnet.xamarin.mdx | 2 -- platform-includes/configuration/sample-rate/dotnet.mdx | 4 ---- .../distributed-tracing/custom-instrumentation/dotnet.mdx | 2 -- .../enriching-events/attachment-init-with-bytes/dotnet.mdx | 4 ---- .../enriching-events/attachment-init-with-path/dotnet.mdx | 4 ---- .../enriching-events/attachment-init-with-path/unity.mdx | 2 -- .../enriching-events/attachment-max-size/dotnet.mdx | 2 -- .../enriching-events/attachment-upload/dotnet.mdx | 2 -- .../enriching-events/attachment-upload/unity.mdx | 2 -- .../breadcrumbs/before-breadcrumb/dotnet.mdx | 4 ---- .../breadcrumbs/breadcrumbs-example/dotnet.mdx | 4 ---- .../enriching-events/event-processors/dotnet.mdx | 1 - .../enriching-events/scopes/configure-scope/dotnet.mdx | 2 -- .../enriching-events/scopes/scope-callback-param/dotnet.mdx | 2 -- platform-includes/enriching-events/set-context/dotnet.mdx | 4 ---- platform-includes/enriching-events/set-context/unity.mdx | 2 -- platform-includes/enriching-events/set-tag/dotnet.mdx | 4 ---- platform-includes/enriching-events/set-tag/dotnet.nlog.mdx | 4 ---- .../enriching-events/set-transaction-name/dotnet.mdx | 2 -- .../enriching-events/set-transaction-name/unity.mdx | 2 -- platform-includes/enriching-events/set-user/dotnet.mdx | 4 ---- platform-includes/enriching-events/set-user/dotnet.nlog.mdx | 4 ---- platform-includes/enriching-events/unset-user/dotnet.mdx | 4 ---- platform-includes/getting-started-config/dotnet.aspnet.mdx | 1 - platform-includes/getting-started-config/dotnet.mdx | 2 -- platform-includes/getting-started-config/dotnet.xamarin.mdx | 2 -- platform-includes/getting-started-verify/dotnet.mdx | 4 ---- platform-includes/getting-started-verify/unity.mdx | 1 - .../performance/always-inherit-sampling-decision/dotnet.mdx | 2 -- .../performance/configure-sample-rate/dotnet.mdx | 2 -- .../performance/custom-sampling-context/dotnet.mdx | 2 -- .../performance/force-sampling-decision/dotnet.mdx | 2 -- .../performance/retrieve-transaction/dotnet.mdx | 2 -- .../performance/traces-sampler-as-sampler/dotnet.mdx | 2 -- platform-includes/sensitive-data/set-tag/dotnet.mdx | 4 +--- platform-includes/sensitive-data/set-user/dotnet.mdx | 2 -- platform-includes/set-extra/dotnet.mdx | 4 ---- platform-includes/set-level/dotnet.mdx | 4 ---- platform-includes/set-level/unity.mdx | 2 -- 56 files changed, 3 insertions(+), 139 deletions(-) diff --git a/docs/platforms/dotnet/common/migration/index.mdx b/docs/platforms/dotnet/common/migration/index.mdx index 34a2d65f02689b..61b3455539f1d0 100644 --- a/docs/platforms/dotnet/common/migration/index.mdx +++ b/docs/platforms/dotnet/common/migration/index.mdx @@ -398,8 +398,6 @@ Changed how to initialize Sentry: ```csharp -using Sentry; - // Initialize with DSN SentrySdk.Init("___PUBLIC_DSN___"); @@ -414,7 +412,6 @@ For ASP.NET (classic) integration, add `Sentry.AspNet` package and initialize it ```csharp -using Sentry; using Sentry.AspNet; SentrySdk.Init(o => diff --git a/docs/platforms/dotnet/common/tracing/index.mdx b/docs/platforms/dotnet/common/tracing/index.mdx index d5ecc62de29b3c..3e546f2bbeefb9 100644 --- a/docs/platforms/dotnet/common/tracing/index.mdx +++ b/docs/platforms/dotnet/common/tracing/index.mdx @@ -22,8 +22,6 @@ First, enable tracing and configure the sample rate for transactions. Set the sa The two options are meant to be mutually exclusive. If you set both, will take precedence. ```csharp {diff} -using Sentry; - + // Add this to the SDK initialization callback + // Example uniform sample rate: capture 100% of transactions + options.TracesSampleRate = 1.0; diff --git a/docs/platforms/dotnet/common/user-feedback/index.mdx b/docs/platforms/dotnet/common/user-feedback/index.mdx index 0100239d85904b..c3ee3df48b1c1c 100644 --- a/docs/platforms/dotnet/common/user-feedback/index.mdx +++ b/docs/platforms/dotnet/common/user-feedback/index.mdx @@ -17,8 +17,6 @@ User Feedback for **[ASP.NET](/platforms/dotnet/guides/aspnet/user-feedback/#int You can create a form to collect the user input in your preferred framework, and use the SDK's API to send the information to Sentry. You can also use the widget, as described below. If you'd prefer an alternative to the widget or do not have a JavaScript frontend, you can use this API: ```csharp {tabTitle:C#} -using Sentry; - var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback."); SentrySdk.CaptureUserFeedback(eventId, "user@example.com", "It broke.", "The User"); diff --git a/docs/platforms/dotnet/guides/aspnet/index.mdx b/docs/platforms/dotnet/guides/aspnet/index.mdx index f93a2b74e013c1..68afbbb811d244 100644 --- a/docs/platforms/dotnet/guides/aspnet/index.mdx +++ b/docs/platforms/dotnet/guides/aspnet/index.mdx @@ -37,7 +37,6 @@ You configure the SDK in the `Global.asax.cs`: ```csharp {"onboardingOptions": {"performance": "21-24, 34-43"}} using System; using System.Web; -using Sentry; using Sentry.AspNet; using Sentry.EntityFramework; // If you also installed Sentry.EntityFramework using Sentry.Extensibility; diff --git a/docs/platforms/dotnet/guides/aspnet/tracing/included-instrumentation.mdx b/docs/platforms/dotnet/guides/aspnet/tracing/included-instrumentation.mdx index f24e3ddbfe10fd..cfa08436a50d1b 100644 --- a/docs/platforms/dotnet/guides/aspnet/tracing/included-instrumentation.mdx +++ b/docs/platforms/dotnet/guides/aspnet/tracing/included-instrumentation.mdx @@ -18,7 +18,6 @@ using System; using System.Configuration; using System.Web.Mvc; using System.Web.Routing; -using Sentry; using Sentry.AspNet; namespace AspNetMvc @@ -87,7 +86,6 @@ Transactions created by this integration are automatically added to the current ```csharp using System; using System.Web.Mvc; -using Sentry; public class HomeController : Controller { diff --git a/docs/platforms/dotnet/guides/aspnetcore/tracing/instrumentation/automatic-instrumentation.mdx b/docs/platforms/dotnet/guides/aspnetcore/tracing/instrumentation/automatic-instrumentation.mdx index d20538d4508a33..92bf14b84a9e45 100644 --- a/docs/platforms/dotnet/guides/aspnetcore/tracing/instrumentation/automatic-instrumentation.mdx +++ b/docs/platforms/dotnet/guides/aspnetcore/tracing/instrumentation/automatic-instrumentation.mdx @@ -32,7 +32,6 @@ Transactions created by this integration are automatically added to the current ```csharp using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using Sentry; public class HomeController : Controller { diff --git a/docs/platforms/dotnet/guides/entityframework/index.mdx b/docs/platforms/dotnet/guides/entityframework/index.mdx index 7f816b7dd6833b..c461d2c19e385c 100644 --- a/docs/platforms/dotnet/guides/entityframework/index.mdx +++ b/docs/platforms/dotnet/guides/entityframework/index.mdx @@ -48,7 +48,6 @@ For example, configuring an ASP.NET app with _global.asax_: ```csharp {filename:global.asax} {"onboardingOptions": {"performance": "16-18, 27-36"}} using System; using System.Configuration; -using Sentry; using Sentry.AspNet; public class MvcApplication : System.Web.HttpApplication diff --git a/docs/platforms/dotnet/guides/uwp/index.mdx b/docs/platforms/dotnet/guides/uwp/index.mdx index 2deb090284fc33..ac0b502fad23ac 100644 --- a/docs/platforms/dotnet/guides/uwp/index.mdx +++ b/docs/platforms/dotnet/guides/uwp/index.mdx @@ -29,7 +29,6 @@ The SDK should be initialized in the constructor of your application class (usua ```csharp {"onboardingOptions": {"performance": "18-21"}} -using Sentry; using Sentry.Protocol; using UnhandledExceptionEventArgs = Windows.UI.Xaml.UnhandledExceptionEventArgs; diff --git a/docs/platforms/dotnet/guides/winforms/index.mdx b/docs/platforms/dotnet/guides/winforms/index.mdx index 86420eb403a96a..1bd099b62fe3d3 100644 --- a/docs/platforms/dotnet/guides/winforms/index.mdx +++ b/docs/platforms/dotnet/guides/winforms/index.mdx @@ -33,7 +33,6 @@ A complete example of the recommended startup is as follows: ```csharp {"onboardingOptions": {"performance": "32-35"}} using System; using System.Windows.Forms; -using Sentry; namespace WindowsFormsApp1 { diff --git a/docs/platforms/dotnet/guides/winui/index.mdx b/docs/platforms/dotnet/guides/winui/index.mdx index 5d2b60a719d7e9..f204fe00979734 100644 --- a/docs/platforms/dotnet/guides/winui/index.mdx +++ b/docs/platforms/dotnet/guides/winui/index.mdx @@ -35,7 +35,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori ```csharp {"onboardingOptions": {"performance": "17-20"}} -using Sentry; using Sentry.Protocol; sealed partial class App : Application @@ -82,7 +81,6 @@ Do not initialize the SDK in the `OnLaunched` event of the application or the `H ```csharp // Add these to your existing using statements. -using Sentry; using Sentry.Protocol; using UnhandledExceptionEventArgs = Microsoft.UI.Xaml.UnhandledExceptionEventArgs; diff --git a/docs/platforms/unity/user-feedback/index.mdx b/docs/platforms/unity/user-feedback/index.mdx index be0df50a5f7748..e9fc782b8c0eb6 100644 --- a/docs/platforms/unity/user-feedback/index.mdx +++ b/docs/platforms/unity/user-feedback/index.mdx @@ -17,8 +17,6 @@ User Feedback for **[ASP.NET](/platforms/dotnet/guides/aspnet/user-feedback/#int You can create a form to collect the user input in your preferred framework, and use the SDK's API to send the information to Sentry. You can also use the widget, as described below. If you'd prefer an alternative to the widget or do not have a JavaScript frontend, you can use this API: ```csharp {tabTitle:C#} -using Sentry; - var eventId = SentrySdk.CaptureMessage("An event that will receive user feedback."); SentrySdk.CaptureUserFeedback(eventId, "user@example.com", "It broke.", "The User"); diff --git a/platform-includes/capture-error/dotnet.mdx b/platform-includes/capture-error/dotnet.mdx index 826ca5ec71c54c..ecd15a9067573c 100644 --- a/platform-includes/capture-error/dotnet.mdx +++ b/platform-includes/capture-error/dotnet.mdx @@ -1,8 +1,6 @@ In C# you can capture any exception object that you caught: ```csharp -using Sentry; - try { AFunctionThatMightFail(); diff --git a/platform-includes/capture-message/dotnet.mdx b/platform-includes/capture-message/dotnet.mdx index 71374067cd53a0..1a3999acff6421 100644 --- a/platform-includes/capture-message/dotnet.mdx +++ b/platform-includes/capture-message/dotnet.mdx @@ -1,11 +1,7 @@ ```csharp -using Sentry; - SentrySdk.CaptureMessage("Something went wrong"); ``` ```fsharp -open Sentry - SentrySdk.CaptureMessage("Something went wrong") ``` diff --git a/platform-includes/configuration/before-send-transaction/dotnet.mdx b/platform-includes/configuration/before-send-transaction/dotnet.mdx index bd9ab2cafead91..b76585ef2a0280 100644 --- a/platform-includes/configuration/before-send-transaction/dotnet.mdx +++ b/platform-includes/configuration/before-send-transaction/dotnet.mdx @@ -1,8 +1,6 @@ A `Func` can be used to update the transaction or drop it by returning `null` before it gets sent to Sentry. For example: ```csharp -using Sentry; - // Add this to the SDK initialization callback options.SetBeforeSendTransaction((sentryTransaction, hint) => { @@ -14,4 +12,4 @@ options.SetBeforeSendTransaction((sentryTransaction, hint) => return sentryTransaction; }); -``` \ No newline at end of file +``` diff --git a/platform-includes/configuration/before-send-transaction/powershell.mdx b/platform-includes/configuration/before-send-transaction/powershell.mdx index 5edc3107d0f099..e31a3ff234982a 100644 --- a/platform-includes/configuration/before-send-transaction/powershell.mdx +++ b/platform-includes/configuration/before-send-transaction/powershell.mdx @@ -7,7 +7,7 @@ Start-Sentry { # Add this to the SDK initialization callback $_.SetBeforeSendTransaction([System.Func[Sentry.SentryTransaction, Sentry.SentryTransaction]] { param([Sentry.SentryTransaction]$sentryTransaction) - + # Modify the transaction if ($sentryTransaction.Operation -eq 'http.server') { @@ -20,9 +20,6 @@ Start-Sentry { ``` ```csharp -using Sentry; - - options.SetBeforeSendTransaction((sentryTransaction, hint) => { }); diff --git a/platform-includes/configuration/before-send/dotnet.mdx b/platform-includes/configuration/before-send/dotnet.mdx index fb320328d5eaa5..8b866eeb8bb9e8 100644 --- a/platform-includes/configuration/before-send/dotnet.mdx +++ b/platform-includes/configuration/before-send/dotnet.mdx @@ -1,8 +1,6 @@ A `Func` can be used to mutate, discard (return null), or return a completely new event. ```csharp -using Sentry; - // Add this to the SDK initialization callback options.SetBeforeSend((sentryEvent, hint) => { diff --git a/platform-includes/configuration/config-intro/dotnet.mdx b/platform-includes/configuration/config-intro/dotnet.mdx index 278a0942e3caf7..20d395f77e6a9c 100644 --- a/platform-includes/configuration/config-intro/dotnet.mdx +++ b/platform-includes/configuration/config-intro/dotnet.mdx @@ -2,8 +2,6 @@ For example, initialize with `SentrySdk.Init` in your `Program.cs` file: ```csharp -using Sentry; - SentrySdk.Init(options => { // A Sentry Data Source Name (DSN) is required. diff --git a/platform-includes/configuration/config-intro/dotnet.xamarin.mdx b/platform-includes/configuration/config-intro/dotnet.xamarin.mdx index 5d163c086343a8..1a33c8b7deb94c 100644 --- a/platform-includes/configuration/config-intro/dotnet.xamarin.mdx +++ b/platform-includes/configuration/config-intro/dotnet.xamarin.mdx @@ -3,8 +3,6 @@ pass the option object along for modifications: ```csharp -using Sentry; - SentryXamarin.Init(o => { o.Dsn = "___PUBLIC_DSN___"; diff --git a/platform-includes/configuration/sample-rate/dotnet.mdx b/platform-includes/configuration/sample-rate/dotnet.mdx index 22dc632e2a9c97..513e0e52c46760 100644 --- a/platform-includes/configuration/sample-rate/dotnet.mdx +++ b/platform-includes/configuration/sample-rate/dotnet.mdx @@ -1,13 +1,9 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback options.SampleRate = 0.25; ``` ```fsharp -open Sentry - // Add this to the SDK initialization callback options.SampleRate <- 0.25 // Capture 25% ``` diff --git a/platform-includes/distributed-tracing/custom-instrumentation/dotnet.mdx b/platform-includes/distributed-tracing/custom-instrumentation/dotnet.mdx index 560378cef47679..57ce0497035e71 100644 --- a/platform-includes/distributed-tracing/custom-instrumentation/dotnet.mdx +++ b/platform-includes/distributed-tracing/custom-instrumentation/dotnet.mdx @@ -12,7 +12,6 @@ Here's an example using RabbitMQ of how to extract and store incoming tracing in using System.Text; using RabbitMQ.Client; using RabbitMQ.Client.Events; -using Sentry; var factory = new ConnectionFactory() { @@ -62,7 +61,6 @@ If you're not using the `SentryHttpMessageHandler`, you can generate this tracin ```csharp using RabbitMQ.Client; -using Sentry; var factory = new ConnectionFactory() { diff --git a/platform-includes/enriching-events/attachment-init-with-bytes/dotnet.mdx b/platform-includes/enriching-events/attachment-init-with-bytes/dotnet.mdx index fd34bd445f5424..6e0d55dc7cc584 100644 --- a/platform-includes/enriching-events/attachment-init-with-bytes/dotnet.mdx +++ b/platform-includes/enriching-events/attachment-init-with-bytes/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { // Add an in-memory attachment to the current scope @@ -9,8 +7,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> // Add an in-memory attachment to the current scope diff --git a/platform-includes/enriching-events/attachment-init-with-path/dotnet.mdx b/platform-includes/enriching-events/attachment-init-with-path/dotnet.mdx index d28bff5ca16c96..489c0acc2dcfe8 100644 --- a/platform-includes/enriching-events/attachment-init-with-path/dotnet.mdx +++ b/platform-includes/enriching-events/attachment-init-with-path/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { // Add a file attachment to the current scope @@ -9,8 +7,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> // Add a file attachment to the current scope diff --git a/platform-includes/enriching-events/attachment-init-with-path/unity.mdx b/platform-includes/enriching-events/attachment-init-with-path/unity.mdx index dcccc1c5e9ed7b..cde9620a326623 100644 --- a/platform-includes/enriching-events/attachment-init-with-path/unity.mdx +++ b/platform-includes/enriching-events/attachment-init-with-path/unity.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.AddAttachment(Path.Combine(Application.persistentDataPath, "file.log")); diff --git a/platform-includes/enriching-events/attachment-max-size/dotnet.mdx b/platform-includes/enriching-events/attachment-max-size/dotnet.mdx index 300ba826b5ecdc..4bb0d5b229455b 100644 --- a/platform-includes/enriching-events/attachment-max-size/dotnet.mdx +++ b/platform-includes/enriching-events/attachment-max-size/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback options.MaxAttachmentSize = 5 * 1024 * 1024; // 5 MiB ``` diff --git a/platform-includes/enriching-events/attachment-upload/dotnet.mdx b/platform-includes/enriching-events/attachment-upload/dotnet.mdx index d1c6a188f923aa..2d9bcd01a9540e 100644 --- a/platform-includes/enriching-events/attachment-upload/dotnet.mdx +++ b/platform-includes/enriching-events/attachment-upload/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Global Scope SentrySdk.ConfigureScope(scope => { diff --git a/platform-includes/enriching-events/attachment-upload/unity.mdx b/platform-includes/enriching-events/attachment-upload/unity.mdx index 2be67ec606ef71..bf794aff0baa0e 100644 --- a/platform-includes/enriching-events/attachment-upload/unity.mdx +++ b/platform-includes/enriching-events/attachment-upload/unity.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.AddAttachment(Path.Combine(Application.persistentDataPath, "file.log")); diff --git a/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/dotnet.mdx b/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/dotnet.mdx index 847d6b509eb7aa..e2c2eaaf39fbc8 100644 --- a/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/dotnet.mdx +++ b/platform-includes/enriching-events/breadcrumbs/before-breadcrumb/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback options.SetBeforeBreadcrumb(breadcrumb // Ignore breadcrumbs from Spammy logger @@ -10,8 +8,6 @@ options.SetBeforeBreadcrumb(breadcrumb ``` ```fsharp -open Sentry - // Add this to the SDK initialization callback options.SetBeforeBreadcrumb(fun breadcrumb -> // Ignore breadcrumbs from Spammy logger diff --git a/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/dotnet.mdx b/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/dotnet.mdx index 1d931cccf65d4d..c914d199ebe4f4 100644 --- a/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/dotnet.mdx +++ b/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.AddBreadcrumb( message: "Authenticated user " + user.Email, category: "auth", @@ -8,8 +6,6 @@ SentrySdk.AddBreadcrumb( ``` ```fsharp -open Sentry - SentrySdk.AddBreadcrumb( "Authenticated user " + user.Email, "auth", diff --git a/platform-includes/enriching-events/event-processors/dotnet.mdx b/platform-includes/enriching-events/event-processors/dotnet.mdx index b32a909798035b..3b9c68ac64b06a 100644 --- a/platform-includes/enriching-events/event-processors/dotnet.mdx +++ b/platform-includes/enriching-events/event-processors/dotnet.mdx @@ -3,7 +3,6 @@ You can create your own event processors by implementing the `ISentryEventProcessor` interface. You can also create custom processors for transactions by implementing the `ISentryTransactionProcessor`. ```csharp -using Sentry; using Sentry.Extensibility; public class CustomEventProcessor : ISentryEventProcessor diff --git a/platform-includes/enriching-events/scopes/configure-scope/dotnet.mdx b/platform-includes/enriching-events/scopes/configure-scope/dotnet.mdx index 35df8928af5729..e4dae229419027 100644 --- a/platform-includes/enriching-events/scopes/configure-scope/dotnet.mdx +++ b/platform-includes/enriching-events/scopes/configure-scope/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.SetTag("my-tag", "my value"); diff --git a/platform-includes/enriching-events/scopes/scope-callback-param/dotnet.mdx b/platform-includes/enriching-events/scopes/scope-callback-param/dotnet.mdx index 882bca956956b4..6d48a53d8054fd 100644 --- a/platform-includes/enriching-events/scopes/scope-callback-param/dotnet.mdx +++ b/platform-includes/enriching-events/scopes/scope-callback-param/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // will be tagged with my-tag="my value" SentrySdk.CaptureException(new Exception("my error"), scope => { diff --git a/platform-includes/enriching-events/set-context/dotnet.mdx b/platform-includes/enriching-events/set-context/dotnet.mdx index 1057eb18cad1cc..0a81c31706ab94 100644 --- a/platform-includes/enriching-events/set-context/dotnet.mdx +++ b/platform-includes/enriching-events/set-context/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.Contexts["character"] = new @@ -13,8 +11,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope(fun scope -> scope.Contexts["character"] <- {| Name = "Mighty Fighter" diff --git a/platform-includes/enriching-events/set-context/unity.mdx b/platform-includes/enriching-events/set-context/unity.mdx index ef5d3c816a4ec2..89e7df6ff9654a 100644 --- a/platform-includes/enriching-events/set-context/unity.mdx +++ b/platform-includes/enriching-events/set-context/unity.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - class PlayerCharacter { public string Name { get; set; } diff --git a/platform-includes/enriching-events/set-tag/dotnet.mdx b/platform-includes/enriching-events/set-tag/dotnet.mdx index 7a4743ab643f7c..a6a0aee438f103 100644 --- a/platform-includes/enriching-events/set-tag/dotnet.mdx +++ b/platform-includes/enriching-events/set-tag/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.SetTag("page.locale", "de-at"); @@ -8,8 +6,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope(fun scope -> scope.SetTag("page.locale", "de-at") ) diff --git a/platform-includes/enriching-events/set-tag/dotnet.nlog.mdx b/platform-includes/enriching-events/set-tag/dotnet.nlog.mdx index 09acba1e9a7acf..afcbda6bbf2160 100644 --- a/platform-includes/enriching-events/set-tag/dotnet.nlog.mdx +++ b/platform-includes/enriching-events/set-tag/dotnet.nlog.mdx @@ -27,8 +27,6 @@ For more information on how to dynamically set event tags via `NLog.config`, see ``` ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { // You can still use NLog layouts in code to set configured propertes @@ -37,8 +35,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> // You can still use NLog layouts in code to set configured propertes diff --git a/platform-includes/enriching-events/set-transaction-name/dotnet.mdx b/platform-includes/enriching-events/set-transaction-name/dotnet.mdx index 289a7d429a952d..c2d41483849258 100644 --- a/platform-includes/enriching-events/set-transaction-name/dotnet.mdx +++ b/platform-includes/enriching-events/set-transaction-name/dotnet.mdx @@ -1,5 +1,3 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => scope.TransactionName = "UserListViewModel"); ``` diff --git a/platform-includes/enriching-events/set-transaction-name/unity.mdx b/platform-includes/enriching-events/set-transaction-name/unity.mdx index 289a7d429a952d..c2d41483849258 100644 --- a/platform-includes/enriching-events/set-transaction-name/unity.mdx +++ b/platform-includes/enriching-events/set-transaction-name/unity.mdx @@ -1,5 +1,3 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => scope.TransactionName = "UserListViewModel"); ``` diff --git a/platform-includes/enriching-events/set-user/dotnet.mdx b/platform-includes/enriching-events/set-user/dotnet.mdx index 4623d8acc4aa74..32c06fb570f07c 100644 --- a/platform-includes/enriching-events/set-user/dotnet.mdx +++ b/platform-includes/enriching-events/set-user/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.User = new SentryUser @@ -11,8 +9,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> scope.User <- SentryUser(Email = "john.doe@example.com") diff --git a/platform-includes/enriching-events/set-user/dotnet.nlog.mdx b/platform-includes/enriching-events/set-user/dotnet.nlog.mdx index 38fadff9ab0fea..76e2198ef9f9cc 100644 --- a/platform-includes/enriching-events/set-user/dotnet.nlog.mdx +++ b/platform-includes/enriching-events/set-user/dotnet.nlog.mdx @@ -27,8 +27,6 @@ ``` ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.User = new User @@ -39,8 +37,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> scope.User <- User(Email = "john.doe@example.com") diff --git a/platform-includes/enriching-events/unset-user/dotnet.mdx b/platform-includes/enriching-events/unset-user/dotnet.mdx index cb6d3ba38fe7fd..f572efa76eafc3 100644 --- a/platform-includes/enriching-events/unset-user/dotnet.mdx +++ b/platform-includes/enriching-events/unset-user/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.User = new SentryUser(); @@ -8,8 +6,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> scope.User <- SentryUser() diff --git a/platform-includes/getting-started-config/dotnet.aspnet.mdx b/platform-includes/getting-started-config/dotnet.aspnet.mdx index d0b3fe3c2abe65..61b7db8ce1c450 100644 --- a/platform-includes/getting-started-config/dotnet.aspnet.mdx +++ b/platform-includes/getting-started-config/dotnet.aspnet.mdx @@ -5,7 +5,6 @@ using System; using System.Configuration; using System.Web.Mvc; using System.Web.Routing; -using Sentry; using Sentry.AspNet; namespace AspNetMvc diff --git a/platform-includes/getting-started-config/dotnet.mdx b/platform-includes/getting-started-config/dotnet.mdx index 278a0942e3caf7..20d395f77e6a9c 100644 --- a/platform-includes/getting-started-config/dotnet.mdx +++ b/platform-includes/getting-started-config/dotnet.mdx @@ -2,8 +2,6 @@ For example, initialize with `SentrySdk.Init` in your `Program.cs` file: ```csharp -using Sentry; - SentrySdk.Init(options => { // A Sentry Data Source Name (DSN) is required. diff --git a/platform-includes/getting-started-config/dotnet.xamarin.mdx b/platform-includes/getting-started-config/dotnet.xamarin.mdx index 85abdcfbdaf32d..421c52829a366b 100644 --- a/platform-includes/getting-started-config/dotnet.xamarin.mdx +++ b/platform-includes/getting-started-config/dotnet.xamarin.mdx @@ -3,8 +3,6 @@ on MainActivity for Android, and, the top of FinishedLaunching on AppDelegate fo ```csharp -using Sentry; - SentryXamarin.Init(o => { o.AddXamarinFormsIntegration(); diff --git a/platform-includes/getting-started-verify/dotnet.mdx b/platform-includes/getting-started-verify/dotnet.mdx index 9c8ed5aa4239bf..8ade5cdefb0757 100644 --- a/platform-includes/getting-started-verify/dotnet.mdx +++ b/platform-includes/getting-started-verify/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - try { throw null; @@ -12,8 +10,6 @@ catch (Exception ex) ``` ```fsharp -open Sentry - try raise <| NullReferenceException () with ex -> diff --git a/platform-includes/getting-started-verify/unity.mdx b/platform-includes/getting-started-verify/unity.mdx index f3988529f29110..57d32071659195 100644 --- a/platform-includes/getting-started-verify/unity.mdx +++ b/platform-includes/getting-started-verify/unity.mdx @@ -1,5 +1,4 @@ ```csharp -using Sentry; using UnityEngine; public class TestMonoBehaviour : MonoBehaviour diff --git a/platform-includes/performance/always-inherit-sampling-decision/dotnet.mdx b/platform-includes/performance/always-inherit-sampling-decision/dotnet.mdx index bfef261ea66ee2..0df60911e8e66e 100644 --- a/platform-includes/performance/always-inherit-sampling-decision/dotnet.mdx +++ b/platform-includes/performance/always-inherit-sampling-decision/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - sentryOptions.TracesSampler = context => { if (context.TransactionContext.IsParentSampled is true) diff --git a/platform-includes/performance/configure-sample-rate/dotnet.mdx b/platform-includes/performance/configure-sample-rate/dotnet.mdx index efba5b6984258f..3be3d913a41b5a 100644 --- a/platform-includes/performance/configure-sample-rate/dotnet.mdx +++ b/platform-includes/performance/configure-sample-rate/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback // Example uniform sample rate: capture 100% of transactions options.TracesSampleRate = 1.0; diff --git a/platform-includes/performance/custom-sampling-context/dotnet.mdx b/platform-includes/performance/custom-sampling-context/dotnet.mdx index 1a17ee15919b3a..262b06668a7aaa 100644 --- a/platform-includes/performance/custom-sampling-context/dotnet.mdx +++ b/platform-includes/performance/custom-sampling-context/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // The following data will take part in the sampling decision var samplingContext = new Dictionary { diff --git a/platform-includes/performance/force-sampling-decision/dotnet.mdx b/platform-includes/performance/force-sampling-decision/dotnet.mdx index 9bbf25355a9e92..9da3c20ea48223 100644 --- a/platform-includes/performance/force-sampling-decision/dotnet.mdx +++ b/platform-includes/performance/force-sampling-decision/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // IsSampled -> true var transactionContext = new TransactionContext("GET /search", "http", true); diff --git a/platform-includes/performance/retrieve-transaction/dotnet.mdx b/platform-includes/performance/retrieve-transaction/dotnet.mdx index 50b4feed2090f0..6ce6e8603e1b62 100644 --- a/platform-includes/performance/retrieve-transaction/dotnet.mdx +++ b/platform-includes/performance/retrieve-transaction/dotnet.mdx @@ -3,8 +3,6 @@ In cases where you want to attach Spans to an already ongoing Transaction you can use `SentrySdk.GetSpan()`. If there is a running Transaction or Span currently on the scope, this method will return a `SentryTransaction` or `Span`; otherwise, it returns `null`. ```csharp -using Sentry; - var span = SentrySdk.GetSpan(); if (span == null) diff --git a/platform-includes/performance/traces-sampler-as-sampler/dotnet.mdx b/platform-includes/performance/traces-sampler-as-sampler/dotnet.mdx index bda3a4e7bf44bf..6fbca437e0677e 100644 --- a/platform-includes/performance/traces-sampler-as-sampler/dotnet.mdx +++ b/platform-includes/performance/traces-sampler-as-sampler/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - // Add this to the SDK initialization callback // To set a uniform sample rate options.TracesSampleRate = 1.0; diff --git a/platform-includes/sensitive-data/set-tag/dotnet.mdx b/platform-includes/sensitive-data/set-tag/dotnet.mdx index 75f9ba4dd4d3d9..2ef168b1b15f25 100644 --- a/platform-includes/sensitive-data/set-tag/dotnet.mdx +++ b/platform-includes/sensitive-data/set-tag/dotnet.mdx @@ -1,7 +1,5 @@ ```csharp -using Sentry; - -DateTime date = new DateTime(1990,12,08); +var date = new DateTime(1990,12,08); SentrySdk.ConfigureScope(scope => { diff --git a/platform-includes/sensitive-data/set-user/dotnet.mdx b/platform-includes/sensitive-data/set-user/dotnet.mdx index 4bc868d1a150ed..c0dcd522b4a613 100644 --- a/platform-includes/sensitive-data/set-user/dotnet.mdx +++ b/platform-includes/sensitive-data/set-user/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.User.Id = "user.id"; diff --git a/platform-includes/set-extra/dotnet.mdx b/platform-includes/set-extra/dotnet.mdx index 7d64025bea6aed..a721be5b156b6b 100644 --- a/platform-includes/set-extra/dotnet.mdx +++ b/platform-includes/set-extra/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.SetExtra("character.name", "Mighty Fighter"); @@ -8,8 +6,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope(fun scope -> scope.SetExtra("character.name", "Mighty Fighter") ) diff --git a/platform-includes/set-level/dotnet.mdx b/platform-includes/set-level/dotnet.mdx index 628647d55cb593..717cbaaa0ae834 100644 --- a/platform-includes/set-level/dotnet.mdx +++ b/platform-includes/set-level/dotnet.mdx @@ -1,6 +1,4 @@ ```csharp -using Sentry; - SentrySdk.ConfigureScope(scope => { scope.Level = SentryLevel.Warning; @@ -8,8 +6,6 @@ SentrySdk.ConfigureScope(scope => ``` ```fsharp -open Sentry - SentrySdk.ConfigureScope( fun scope -> scope.Level <- SentryLevel.Warning diff --git a/platform-includes/set-level/unity.mdx b/platform-includes/set-level/unity.mdx index 443cfd5f7203dc..23b9e7661c9a3f 100644 --- a/platform-includes/set-level/unity.mdx +++ b/platform-includes/set-level/unity.mdx @@ -1,5 +1,3 @@ ```csharp -using Sentry; - SentrySdk.CaptureException(new Exception(), s => s.Level = SentryLevel.Warning); ```