Replies: 2 comments 1 reply
-
@munkii I think Sentry has a few features that are analogous to the things you're using in AppCenter:
Like breadcrumbs, scopes can be used to store other "ambient" context that will be sent with issues and traces... Sentry maintains scope information in a stack data structure. When you call Alternatively, if you wanted to store something in the scope "temporarily", you could push a new clone of the current scope to the stack, store what you want in that scope, capture the event in question and then pop that scope from the stack (to return the scope to the state it was in before you started fiddling with it). Lots of the methods in the SentrySdk include overrides that allow you to do that with minimal ceremony. For example, the CaptureMessage method has accepts an sentry-dotnet/src/Sentry/SentrySdk.cs Lines 471 to 483 in 5ff8acc Note: There's one other subtlety to the scope in Sentry which is that Sentry supports a couple of different scope managers. For UI applications (like WinUI apps) Sentry uses a global scope manager - in that mode the scope stack is basically a singleton. For Server based apps (like ASP.NET Core) Sentry uses an AsyncLocal scope manager where each different AsyncLocal context has it's own scope stack... this means that things you configure on the scope for one web request won't be included as context for events that get captured by other web requests. |
Beta Was this translation helpful? Give feedback.
-
Thanks James. Another thing we use AppCenter events for is to helko make decisions on what parts of the app need more help or work and what features should be left alone. For instance if there is a feature that only 5% of the user base is using we should not be spending a week making changes to it as that is not a good use of our limited resources. To help make those decisions we need to be able get decent usage numbers of different features. Can we do that via breadcrumbing? |
Beta Was this translation helpful? Give feedback.
-
We are currently using Microsoft's AppCenter in our Xamarin Forms application but with our ongoing MAUI migration and AppCenter's upcoming retirement we are looking at Sentry to replace it.
My experience of analytics has been AppCenter or Google Analytics for web and I am trying to best see how our use of AppCenter would fit into Sentry.
We use Analytics.TrackEvent and Analytics.TrackError for handled exceptions. We have calls from all over the code base that pass in an unstructured set of
KeyValuePair<string, string>
that get attached as customProperties in to tracked events. We also export our AppCenter to Azure AppInsights for more detailed querying.Here are some examples of our "TrackedEvents"
These are also tracked as events but we also tag them with customProperties
These don't all seem like issues in the Sentry sense of the word or have i misunderstood "Issues"
It also looks like breadcrumbing would replace our logging of every time we load a ViewModel with "ViewModel - {ViewModelName} Appearing", is that a valid understanding?
The ones that have extra data associated with them; this topic was discussed here, AppCenter retirement - Migration guides and you suggested "Structured Context". These are part of Scopes, would we make a ConfigureScope call just before the SentrySdk.CaptureMessage? Is that "Scope" just for the following call or is there the concept of "descoping" that we need to make before making another call?
I also notice you can add a Sentryuser in ConfigureScope call. Currently we tag all AppCenter evevnts with a custom property of userId which is the Azure Ad B2C object id of our authenticated user. Is this hjow we would do that?
Beta Was this translation helpful? Give feedback.
All reactions