2

this question is mostly for DevOps experts, in app insights.

So I found I have an issue on my app, it seems some threads are being created and not released, causing the thread count to increase and ending at some point in the "CGI error", which usually happens when you exceed your quota in any resource.

I already identified the exceeded resource is thread count thanks to this Metrics option, which gives you a graphical representation on how it is being consumed (and released when an app restart happens)

enter image description here

I would like to have some details on this, not the grouped information but the actual information that is giving this graph, any lead would help me to understand which place is creating and not releasing threads, a namespace, a class name, anything.

Is there another place where I could get this information in a very detailed way? AppInsight queries seems to lack this metric.

Thanks in advance.

Yogurtu
  • 2,656
  • 3
  • 23
  • 23

1 Answers1

1

AFAIK there is no direct way to do this. The only way that I can see is by adding custom logging inside your application and sending the logs to a Log Analytics Workspace.

Inside your function app in the portal go to 'Diagnostic settings' and connect to your log analytics workspace (if it doesn't exist create one).

Inside the log analytics workspace you will find your custom logs either under a 'Custom Logs' tab or under 'Application Insights' tab, after this find the correct field and parse, something like:

customMetrics 
| extend d=parse_json(customDimensions) 
| extend processSessionId=d.processSessionId

For Azure related topics there is also a decent Q&A platform here: https://learn.microsoft.com/en-us/answers/products/azure?product=all

For KSQL this is a handy page: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/tutorial?pivots=azuremonitor

Hope this helps somewhat

Roelof
  • 63
  • 8