Different sentry options in UseSentry() and Init() + where are the docs? #2340
-
Hi, I'm a bit confused. First. I use sentry in a .net WebApi which is .net 7 based and using some ASP.NET Core packages First question here. Maybe I already messed up here some things. Is there maybe already a duplication of integrating two different Sentry SDK packages via nuget packages which leads to my other following issues? Second question. Somhow the SentryOptions available in the Update: Ah in Last Question. Seems I can't find all the available options in the documentation. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Our packages are layered. Initialization and options follows suit.
There's a similar hierarchy for other package types, such as In most cases - you should only ever initialize once, and from the highest level package that you are using. For ASP.NET Core, call The only valid reason to use You said:
Everything is at runtime, so I presume you mean after the app is initialized and receiving web requests. It's not a good idea to try to change the configuration at this point. If you have some specific reason to do so, please let me know so we can evaluate an alternative.
Yeah, we do our best to keep on top of docs, but it's certainly possible we've missed some along the way.
That was added in #363, and it looks like indeed we forgot to add docs at that time. I'll make a note to do so. (FWIW, it's a rarely used option.) Thanks for the feedback! |
Beta Was this translation helpful? Give feedback.
Our packages are layered. Initialization and options follows suit.
Sentry
is the base package.SentrySdk.Init
.SentryOptions
.Sentry.Extensions.Logging
depends onSentry
.ILoggingBuilder.AddSentry
. It will initializeSentry
internally.SentryLoggingOptions
, which extendsSentryOptions
.Sentry.AspNetCore
depends onSentry.Extensions.Logging
.IWebHostBuilder.UseSentry
. It will initializeSentry.Extensions.Logging
andSentry
internally.SentryAspNetCoreOptions
, which extendsSentryLoggingOptions
.There's a similar hiera…