-
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sentry integration with hosted WPF application #1872
Comments
Routing to @getsentry/team-web-sdk-backend for triage. ⏲️ |
Routing to @getsentry/team-mobile for triage. ⏲️ |
Hi. Instead of screenshots, could you please provide some example code of how you initialize Sentry in the application? I know very little about ArcGIS other than what I can google. My guess is that the DSN is either not set, or the Init function hasn't executed. It could also be that you've already disposed the result of the init. |
Many thanks for your reply, Below you can find the class where I initialized the sentry configuration (BaseVM constructor). I did it the same way as in the tipical WPF application. The difference is that in a regular WPF, I do it in the App.xaml.cs, but in ArcGIS there is not such entry point. Therefore, I used the Application.current.DispatcherUnhandledException. However, even though I am sure my code excecutes all the lines related to sending messages to sentry, it just goes through it but does not capture anything (it does not show any error message). The only thing I realized while debugging is this isEnabled flag, in ArcGIS is set to False at the point of message capturing while in the Typical WPF is set to true. Best regards, Andres H.
|
Thanks. Some more questions:
Typically we would want to initialize Sentry as early as possible in the application's lifecycle - not on a particular control or view. |
Thanks again, I really appreciate your help:
|
I see you have |
Also, you should set |
Thanks, I tried with no luck. Maybe the point where I can init sentry is not allowing to configure it properly, but I can't add other entry point more than what ArcGIS allows me. Debug log outputs are not showing anything, it is like it is working but without sending any message to the sentry server. |
Ok. Thanks for checking. You'll probably want that on anyway - we usually recommend global mode for client-based apps. I'm out of the office this week, but perhaps @bruno-garcia or @SimonCropp can investigate further. If not, I'll dig in when I can. If you have some getting started docs to point us at that demonstrate the type of arcgis plug in you're writing, that would help. A minimal complete example we can test with would be even better. And just fair warning, while I don't see any direct reason this shouldn't work, Arcgis isn't specifically an environment we have officially offered support for. So if it turns out there is some kind of special runtime restriction, then we might not necessarily be able to offer a solution. Lastly, it would be good to know what kind of barriers (if any) are established by Arcgis. For example, what would happen if two different plug-ins tried to initialize Sentry with two different DSNs? If they are in process boundaries or some other sort of sandbox, then you might be OK. But if they are sharing a process then it could be last-one-wins. |
@andher1802 I think there are too many moving pieces here. can we get a minimal sample project that reproduces the issue so we can debug into it |
I use Sentry in AutoCAD plugins, it's always in
That is exactly what happens, last one wins. I use a static Logger property in my plugin assembly and log to that which sends those events to Sentry. Don't hijack the host application's exception handling, particularly if you don't know what it is. Lessons learned from AutoCAD. |
Dear @SimonCropp, many thanks for your reply. I will create an example and share it with you. |
Dear @CADbloke, many thanks for your comments. I will take a look into it. I made sure that my error handling function is excecuted, but as you mentioned, I am not sure what is happening behind and how the host application deals with errors. I have created as well a post on the ESRI developers community and I havent got not too many clues about this. However, I think the reply I got is on the same direction you are pointing. https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-addin-integration-with-user-error/m-p/1205148#M8628 . They pointed me out to this reference, which I am currently reading https://github.com/Esri/arcgis-pro-sdk/wiki/ProConcepts-Framework#diagnostic-mode-event-logging. |
Hello, Sorry for not being able to provide the minimum project for recreating the error so far. However, as it is an integration with ArcGIS Pro, you would require to have also ArcGIS Pro Installed to be able to run such projects. Nevertheless, I am still working on integrating those applications with no successful results. However, we have made a recent discovery that could give some hints on this issue and also a potential dependency bug for Sentry. Firstly, we needed to catch the sentry logs as they were not returning anything on my WPF application log. Once we solved that issue by setting an own diagnostic logger, we got the following exception from Sentry.
My current version of the System.Runtime.CompilerServices.Unsafe is 6.0.0 and I have not been able to downgrade due to some other dependencies. However, I have a test dummy WPF application with no ArcGIS involved. This dummy application works when we set the System.Runtime.CompilerServices.Unsafe dependency to version 5.0.0, but it fails when we setted to 6.0.0. Do you think there is any way to get rid of this dependency issues without having to downgrade the CompilerServices.Unsafe. Many thanks. |
See my comments on #1901 for dealing with |
After discussing with my colleagues, we would discourage you from using Sentry in this scenario. Sentry is intended for application developers, not developers of add-ins for those applications. Some previous discussion on this (in regard to the Android SDK, but applies universally) is here: getsentry/sentry-docs#3611 This guidance still needs to be added to our official documentation, but I agree with the reasons stated there. Decisions like whether PII can be sent to Sentry should be up to the app developer, not add-in developers (IMHO). From a technical perspective, the Sentry .NET SDK has a static |
@mattjohnsonpint Darn. Is there no way around this with something like an instance (instead of static) Sentry client? These host applications are things on the scale of Excel, Word etc. A lot of add-ins exist for these types of things, they have stores selling them etc. This limitation basically counts Sentry out as an option for any add-in developer in any application. That's a lot of exclusions for a commercial application. Think WordPress add-ins for an idea of scale. As for the sending PII decision, that is an easy enough option to implement in an add-in. I have implemented it in all of my apps & add-ins. Cheers |
You could explore the approach taken in this sample where there are two different If all the add-ins in an app were following that pattern, it should work (in theory). But since we can't guarantee such things, it's absolutely possible for one add-in to usurp another. The only real safety would be a process boundary. BTW, modern Excel add-ins do provide a process boundary, per these docs:
I don't believe that applies though to the older COM or VSTO style add-ins. I'm really not sure which approach ArcGIS takes. I didn't see anything prominent in the docs, but perhaps I didn't dig deep enough. |
I'm not sure about ArcGis either. I do know that AutoCAD, BricsCAD etc are in-process, the plugin DLL is loaded in process and becomes part of the application's feature set. So, um, yeah. Back to the drawing board. |
Environment
SaaS (https://sentry.io/)
Steps to Reproduce
Hello,
Currently I am developing an ArcGIS Pro (v.2.9) AddIn using the .net SDK (WPF Application) that I would like to integrate my Sentry account for error tracking. I have been trying to configure the Sentry account and everything seems to be OK, but the errors and messages are not being sent back.
I tried with a non-ArgGIS test application and it works. After some debugging, I found that the object that resulted from the configuration of the Sentry.Init has a property named isEnabled that is true on my test application, but it is false in the ArcGIS AddIn. (See debug picture).
My question is: Is the integration with User Error tracking allowed within ArcGIS AddIns? And if so, How do I configure my project to allow this.
Many thanks.
Actual Result
The text was updated successfully, but these errors were encountered: