Skip to content

Commit

Permalink
added verify (#10949)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsandfoxes committed Aug 1, 2024
1 parent c3d5a37 commit 70233a5
Show file tree
Hide file tree
Showing 18 changed files with 112 additions and 28 deletions.
6 changes: 6 additions & 0 deletions docs/platforms/dotnet/guides/aspnet/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ Opt-in to send the request body to Sentry:
options.AddAspNet(RequestSize.Always);
```

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Troubleshooting

For information about Troubleshooting, please visit the [troubleshooting](troubleshooting) page.
Expand Down
6 changes: 6 additions & 0 deletions docs/platforms/dotnet/guides/aspnetcore/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ Finally, any settings that can be configured via `appsettings.json` or environme

> Example modifying all events before they are sent to avoid server names being reported.
## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Dependency Injection

Much of the behavior of the ASP.NET Core integration with Sentry can be customized by using the frameworks dependency injection system. That is done by registering your own implementation of some of the exposed abstraction.
Expand Down
8 changes: 7 additions & 1 deletion docs/platforms/dotnet/guides/aws-lambda/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dotnet add package Sentry.AspNetCore -v {{@inject packages.version('sentry.dotne

You can combine this integration with a logging library like `log4net`, `NLog`, or `Serilog` to include both request data as well as your logs as breadcrumbs. The logging ingrations also capture events when an error is logged.

### Configure
## Configure

All `ASP.NET Core` configurations are valid here. But one configuration in particular is relevant.

Expand Down Expand Up @@ -62,6 +62,12 @@ public class LambdaEntryPoint : Amazon.Lambda.AspNetCoreServer.APIGatewayProxyFu

Check out the [Sentry ASP.NET Core](/platforms/dotnet/guides/aspnetcore/) documentation for the complete set of options.

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Samples

- Our [samples on GitHub](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.Aws.Lambda.AspNetCoreServer) demonstrate Sentry on AWS Lambda. (**C#**)
6 changes: 6 additions & 0 deletions docs/platforms/dotnet/guides/azure-functions-worker/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ var host = new HostBuilder()
await host.RunAsync();
```

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Samples

- [Integration with Azure Functions](https://github.com/getsentry/sentry-dotnet/tree/main/src/Sentry.Azure.Functions.Worker) sample demonstrates Sentry with Azure Functions Isolated Worker SDK. (**C#**)
6 changes: 6 additions & 0 deletions docs/platforms/dotnet/guides/blazor-webassembly/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ builder.Logging.AddSentry(o => o.InitializeSdk = false);
await builder.Build().RunAsync();
```

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Samples

- This [integration with Blazor WebAssembly](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.AspNetCore.Blazor.Wasm) sample demonstrates using Sentry with Blazor WebAssembly. (**C#**)
8 changes: 7 additions & 1 deletion docs/platforms/dotnet/guides/entityframework/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ public class MvcApplication : System.Web.HttpApplication
}
```

### Sample
## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Sample

Check out a complete working [sample](https://github.com/getsentry/sentry-dotnet-ef/tree/master/samples/Sentry.Samples.AspNet.Mvc) to see it in action.

Expand Down
8 changes: 7 additions & 1 deletion docs/platforms/dotnet/guides/extensions-logging/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,13 @@ For example, to remove all tags starting with `PROC_`, add a tag filter to your
options.TagFilters.Add("PROC_");
```

### Samples
## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Samples

- A [simple example](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.ME.Logging) using simply the `LoggerFactory`.
- An [example](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.GenericHost) using the _generic host_.
10 changes: 8 additions & 2 deletions docs/platforms/dotnet/guides/google-cloud-functions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,17 @@ public class UserFactoryStartup : FunctionsStartup
}
```

## Options & Initialization
### Options & Initialization

As previously mentioned, this package is a wrapper around [Sentry.Extensions.Logging](/platforms/dotnet/guides/extensions-logging/), [Sentry.AspNetCore](/platforms/dotnet/guides/aspnetcore/) and [Sentry](/platforms/dotnet/). Please refer to the documentation of these packages to get the options that are defined at those levels.

### Samples
## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Samples

- [Google Cloud Functions sample](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.Google.Cloud.Functions)
- For [more samples](https://github.com/getsentry/sentry-dotnet-samples) of the .NET SDKs.
8 changes: 7 additions & 1 deletion docs/platforms/dotnet/guides/log4net/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ Also in the example above, you can find the DSN being set. That will instruct th
This is only one of the ways to initialize the SDK. If you wish to configure the SDK programatically, you could **leave the DSN out** from the appender configuration section. The SDK needs to be initialized only **once** and since other integrations (like ASP.NET) are also able to initialize the SDK, you only need to pass the DSN to one of these integrations.
One common case to not add the DSN to the XML configuration file (which would initialize it via the log4net integration) is to have full access to the [SDK option](/platforms/dotnet/guides/log4net/configuration/options/).

### Sample
## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Sample

For a [sample app.config](https://github.com/getsentry/sentry-dotnet/blob/main/samples/Sentry.Samples.Log4Net/app.config) or a complete working [sample](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.Log4Net) to see it in action.

Expand Down
16 changes: 11 additions & 5 deletions docs/platforms/dotnet/guides/maui/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Install-Package Sentry.Maui -Version {{@inject packages.version('sentry.dotnet.m

This package extends [Sentry.Extensions.Logging](/platforms/dotnet/guides/extensions-logging/). This means that besides the MAUI related features, through this package you'll also get access to all the framework's logging integration and also the features available in the main [Sentry](/platforms/dotnet/) SDK.

### Configure
## Configure

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.

Expand Down Expand Up @@ -78,13 +78,13 @@ public static MauiApp CreateMauiApp()
}
```

## Options
### Options

As previously mentioned, this package is a wrapper around [Sentry.Extensions.Logging](/platforms/dotnet/guides/extensions-logging/) and [Sentry](/platforms/dotnet/). Please refer to the documentation of these packages to get the options that are defined at those levels.

Below, the options that are specific to `Sentry.Maui` will be described.

### IncludeTextInBreadcrumbs
#### IncludeTextInBreadcrumbs

This option controls whether elements that implement the `IText` interface (such as `Button`, `Label`, `Entry`, and others) will have their text included on breadcrumbs. This option is disabled by default.

Expand All @@ -94,7 +94,7 @@ Use caution when enabling, as such values may contain personally identifiable in

</Alert>

### IncludeTitleInBreadcrumbs
#### IncludeTitleInBreadcrumbs

This option contols whether elements that implement the `ITitledElement` interface (such as `Window`, `Page`, and others) will have their titles included on breadcrumbs. This option is disabled by default.

Expand All @@ -104,7 +104,7 @@ Use caution when enabling, as such values may contain personally identifiable in

</Alert>

### IncludeBackgroundingStateInBreadcrumbs
#### IncludeBackgroundingStateInBreadcrumbs

Controls whether the breadcrumb sent for the `Window.Backgrounding` event will include state data from `BackgroundingEventArgs.State`. This option is disabled by default.

Expand All @@ -113,3 +113,9 @@ Controls whether the breadcrumb sent for the `Window.Backgrounding` event will i
Use caution when enabling, as such values may contain personally identifiable information (PII).

</Alert>

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />
8 changes: 7 additions & 1 deletion docs/platforms/dotnet/guides/nlog/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ You can provide a `user` entry matching the following example user. See [Identif
</user>
```

### Samples
## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Samples

- A [simple example](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.NLog).
- Example of [advanced configuration](configuration/advanced-configuration-example)
8 changes: 7 additions & 1 deletion docs/platforms/dotnet/guides/serilog/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ A `LogLevel` which indicates the minimum level a log message has to be sent to S

Whether or not this integration should initialize the SDK. If you intend to call `SentrySdk.Init` yourself you should set this flag to `false`.

### Samples
## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Samples

- A [simple example](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.Serilog).
- An [example with ASP.NET Core](https://github.com/getsentry/sentry-dotnet/tree/main/samples/Sentry.Samples.AspNetCore.Serilog).
6 changes: 6 additions & 0 deletions docs/platforms/dotnet/guides/uwp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,9 @@ sealed partial class App : Application
}
}
```

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />
8 changes: 7 additions & 1 deletion docs/platforms/dotnet/guides/winforms/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ Namespace My
End Namespace
```

### Resources
## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />

## Resources

[Discussion on GitHub `Application.SetUnhandledExceptionMode`](https://github.com/getsentry/sentry-dotnet/issues/176)
6 changes: 6 additions & 0 deletions docs/platforms/dotnet/guides/winui/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,9 @@ sealed partial class App : Application
}
}
```

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />
6 changes: 6 additions & 0 deletions docs/platforms/dotnet/guides/wpf/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@ public partial class App : Application
}
}
```

## Verify

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

<PlatformContent includePath="getting-started-verify" />
15 changes: 2 additions & 13 deletions docs/platforms/dotnet/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ SentrySdk.Init(options =>

## Verify

The SDK will capture unhandled exceptions that are simply thrown or you can handle the error by calling `CaptureException` explicitely.
This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.

```csharp
using Sentry;
try
{
throw null;
}
catch (Exception ex)
{
SentrySdk.CaptureException(ex);
}
```
<PlatformContent includePath="getting-started-verify" />

This file was deleted.

0 comments on commit 70233a5

Please sign in to comment.