Azure web.app AI:性能计数器在web应用支持的列表中不可用



我有一个Azure web.app(s3)内存泄漏。为了进行调查,我想将更多PerformanceCounter添加到应用程序洞察中。

但我做不到。

这是我添加的ApplicationInsights.config。(https://stebet.net/monitor-your-net-garbage-collector-using-application-insights/)

<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
<Counters>
<Add PerformanceCounter=".NET CLR Memory(??APP_CLR_PROC??)# Bytes in all Heaps" ReportAs="Bytes in all Heaps" />
</Counters>
</Add>

我将我的新计数器添加到ApplicationInsights.config并部署到azure web.app。在Portal中,我看不到任何数据,并发现错误。

AI:性能计数器在web应用程序支持的列表中不可用。计数器为\Process(?APP_WIN32_PROC?)\所有堆中的字节

请帮我了解问题出在哪里。

谢谢,Henrik

请帮助我了解问题所在。

我们可以从Application Insights中的系统性能计数器中得到答案。

性能计数器对于Azure Web Apps不可用

Application Insights可以显示这些性能计数器,如果您的应用程序在您有管理访问权限的本地主机或虚拟机上的IIS下运行。但是您可以将Azure诊断发送到Application Insights。

但是我们可以使用ApplicationInsight API来获取数据,我们需要创建一个Apikey。我们还可以从文档中获得演示代码。我之前做过一个演示,更多详细信息可以参考另一个SO线程。

最新更新