Small tip on how to enable Application Insights Live Metrics from code.
Application Insights allows to view telemetry like CPU and memory in real time. The feature is called Live Metrics. We also call it Quick Pulse. You’d typically use it when something is happenning with your application. Deploying a new version, investigating an ongoing incident or scaling it out. You can use it free of charge as a traffic to Live Stream endpoint is not counted towards the bill.
The feature is implemented in a NuGet Microsoft.ApplicationInsights.PerfCounterCollector. If you are using ApplicationInsights.config to configure monitoring you need to add a telemetry module and telemetry processor like you’d normally do: