This parameter controls whether integrations should capture HTTP request bodies. Configuration system like appsettings.json.Environment variable SENTRY_ENVIRONMENT.Methods that take precedence over IHostingEnvironment are: The value of IHostingEnvironment will only be used if no other method was used. This option is part of the Sentry package. The environment name is automatically populated by reading the frameworks IHostingEnvironment value. Please read retrieving user info for more. The strategy to create the SentryUser can be customized. SendDefaultPiiĪlthough this setting is part of the Sentry package, in the context of ASP.NET Core, it means reporting the user by reading the frameworks HttpContext.User. Please refer to the documentation of these packages to get the options that are defined at those levels.īelow, the options that are specific to Sentry.AspNetCore will be described. ![]() Options and InitializationĪs previously mentioned, this package is a wrapper around and Sentry. ![]() It can greatly improves your Sentry experience. If you wish to change the behavior of how to read the user from the request, you can register a new IUserFactory into the container:Īfter you have configured Sentry in your code, you can also configure the Default claim values like NameIdentifier for the Id will be used. When opting-in to SendDefaultPii, the SDK will automatically read the user from the request by inspecting HttpContext.User. This allows the use of non thread-safe event processors. For example, when registering a Transient dependency, a new instance of the processor is created for each event sent out to Sentry. The lifetime used will be respected by the SDK. That is done by registering your own implementation of some of the exposed abstraction. Much of the behavior of the ASP.NET Core integration with Sentry can be customized by using the frameworks dependency injection system. BeforeSend = event => )Įxample modifying all events before they are sent to avoid server names being reported. When using WebHost.CreateDefaultBuilder, the framework automatically loads appsettings.json and environment variables, binding to SentryAspNetCoreOptions. This means all options for the inner packages are available to be configured through the configuration system. The configuration values bind to SentryAspNetCoreOptions which extends SentryLoggingOptions from the and further extends SentryOptions from the Sentry package. The simplest way to configure the Sentry.AspNetCore package is not by calling SentrySdk.Init directly but rather using the extension method UseSentry to the WebHostBuilder in combination with the framework's configuration system. This means that besides the ASP.NET Core 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 SDK. Event flooding protection (429 retry-after and internal bound queue).Supports configuration system (bind to SentryAspNetCoreOptions).Support for ExceptionProcessors registered with DI.Support for EventProcessors registered with DI.Request payload can be captured if opt-in.Release automatically set ( AssemblyInformationalVersionAttribute, AssemblyVersion or environment variable).Environment is automatically set (IHostingEnvironment).Any event sent will include relevant application log messages.Captures process-wide unhandled exceptions (AppDomain).Captures exceptions handled by the framework UseExceptionHandler and Error page display.Captures unhandled exceptions in the middleware pipeline.Easy ASP.NET Core integration, single line: UseSentry.integration for ASP.NET Core, refer to this guide. ![]() Tracing The process of logging the events that took place during a request, often across multiple services.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |