I have two code-identical .NET 6 applications running on two separate App Services under two separate App Service Plans on Azure.
The first one I deployed a few months back and seems to be running fine, but my most recently-deployed one (two weeks ago) started throwing exceptions. I'm picking these messages up via Application Insights:
System.Runtime.InteropServices.COMException at
DiagnosticsHub.StandardCollector.Host.Interop.ICollectionSession.Start
Message: ETW resources have been exhausted.
Try shutting down other diagnostic tools (e.g. Sysinternals) or restarting to free these resources.
Followed a few minutes after by:
System.InvalidOperationException at
Microsoft.ServiceProfiler.Collectors.DetailedTraceCollector+<StopCollectingAndSaveTrace>d__38.MoveNext
Message: There is no active profiling session.
These are getting thrown consistently twice a day at varying times.
Everything I've read about ETW suggests:
- It's an operating system-level diagnostic tool
- You can instrument your apps to collect this diagnostic data on-demand using "Collect .NET Profiler Trace" under the App Service's Diagnostic Tools blade (which I'm not currently doing for either application)
What is the root cause of these exceptions?