c# - Azure web.app AI : Performance counter is not available in the web app supported list

标签 c# azure clr azure-web-app-service

我的 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:性能计数器在网络应用程序支持列表中不可用。计数器为\Process(??APP_WIN32_PROC??)\所有堆中的字节数。

请帮我了解问题所在。

谢谢, 亨里克

最佳答案

Please help me understand what is the problem.

我们可以从System performance counters in Application Insights得到答案.

Azure Web Apps 的性能计数器不可用

Application Insights can show these performance counters if your application is running under IIS on an on-premises host or virtual machine to which you have administrative access.But you can send Azure Diagnostics to Application Insights.

但是我们可以使用Application Insight API来获取数据,我们需要create a Apikey 。我们还可以从 document 获取演示代码。我之前做过一个demo,更详细的信息可以引用另一个SO thread .

关于c# - Azure web.app AI : Performance counter is not available in the web app supported list,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49413314/

相关文章:

Azure 应用服务中的 Azure SQL 身份验证连接字符串?

.net - 我如何知道我的程序在哪个版本的 .NET Framework 上运行?

c# - 如何在 MSIL 中调用正在执行的程序集之外的方法?

c# - "Synchronization Domain"技术状态

c# - 何时/如何对 CRUD 应用程序进行单元测试?

c# - ToString() 方法的意义是什么?

azure - 将 Web 应用程序连接到 Vnet 中的 Azure SQL DB

c# - 创建 Controller 基类(部分)

c# - 配置不同的授权/认证方案

c# - Azure AD 检查身份验证 token 是否有效