4

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:

What is the root cause of these exceptions?

Daniel Attfield
  • 2,024
  • 2
  • 24
  • 40
  • 2
    After some investigation, web apps instrumented with App Insights automatically get a continuous webjob created called "ApplicationInsightsProfiler3" - the logs from this webjob matched the exception stack traces above. Reading https://learn.microsoft.com/en-us/azure/azure-monitor/profiler/profiler-troubleshooting says: "You can enable Profiler on a maximum of four web apps that are running in the same service plan." This was the difference - the newly deployed service tipped that plan into having five Profiler-enabled apps. I've now disabled this Profiler webjob on lower-impact apps. – Daniel Attfield Jan 11 '23 at 15:43
  • What is the impact if we don't fix this issue and leave it there? – Thiện Sinh May 24 '23 at 08:54
  • @ThiệnSinh I didn't see any particular impact other than my monitoring being noisier than I'd like. I'd have liked to understand this better, but for some reason this question got marked as "not focused enough" and closed. – Daniel Attfield May 25 '23 at 09:02

0 Answers0