ApplicationInsights-dotnet: EventSourceException whilte processing event "Exception" or "Metric"
Repro Steps
There were couple new issues reported in Application Insights SDK telemetry:
-
AI (Internal): EventSourceException while processing event "Exception": System.Reflection.TargetException:Non-static method requires a target.
-
AI (Internal): EventSourceException while processing event "Metric": System.Reflection.TargetException:Non-static method requires a target.
This issue seems to affect multiple customers.
Version Info
SDK Version : 2.5.1
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 5
- Comments: 30 (21 by maintainers)
Just for convenience a stack dump as requested above:
In addition there was an interesting link to this issue here.
It’s a bug in corefx and affects .NET Core only. We won’t try and work-around it in App Insights. We’ll get it fixed in .NET Core. If it’s a straightforward (low risk) fix, we’ll also push for porting the fix down-level into the LTS branch. Thanks for your help getting the call-stack and narrowing down the issue, @steven-r. This issue can probably be closed now that we understand what causes it and that we’ve decided not to do anything in App Insights.
Is there any suggested work-around for this in the meantime? This happened in our Azure App Service which caused our “Always On” app to stop and not restart, so our background tasks (ASP.NET Core Hosted Service) stopped running.
My thought is to just create an Azure Function App to hit the App Service URL every 10 seconds to ensure its running/restarted. Is that the best option here? It would be nice if “Always On” would restart an app on error but that’s a different topic for a different team.