asp.net - Microsoft Azure 中 ASP.NET Web App 的访问性能计数器

标签 asp.net .net azure database-connection performancecounter

我正在开发一个诊断工具,该工具需要监控作为 Web 应用程序发布到 Azure 的 Web 应用程序端 (asp.net) 的事件/空闲/池数据库连接。从客户端进行监控非常重要,因为我的目标是应用程序负载下连接池的某些问题。

我找到了all the required information在性能计数器类别 .NET Data Provider for SqlServer 中,我能够在本地访问并跟踪所有所需的数据。

不幸的是,当我将代码发布到 Azure 时,出现以下异常:UnauthorizedAccessException: Access to theregistry key 'Global' is returned

System.UnauthorizedAccessException: Access to the registry key 'Global' is denied.
   at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
   at Microsoft.Win32.RegistryKey.GetValue(String name)
   at System.Diagnostics.PerformanceMonitor.GetData(String item)
   at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
   at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String category)
   at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category)
   at System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName)

有什么方法可以访问 Azure 环境中 Web 应用程序实例的性能计数器吗?

最佳答案

来自https://learn.microsoft.com/en-us/azure/application-insights/app-insights-performance-counters :

Performance counters aren't available for Azure Web Apps. But you can send Azure Diagnostics to Application Insights.

云服务或虚拟机将是解决方法 - 不是真正的解决方法,我知道,更像是一个不同的游戏。

你绝对可以使用 http://azureserviceprofiler.com使用应用程序服务,但我不知道您是否获得了您正在寻找的粒度。不过还是很不错的,试试吧。

关于asp.net - Microsoft Azure 中 ASP.NET Web App 的访问性能计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41908445/

相关文章:

json - 使用 AZ CLI 提取应用服务计划 Azure 资源列表

c# - Jquery Easy UI + ASP.NET

javascript - 如何在 ASP.NET 中异步调用 Web 方法(后面的 SharePoint)

c# - 类属性在程序集或命名空间外部只读

c# - SerialPort.Open() 抛出 IOException - 系统资源不足,无法完成请求的服务

windows - 我需要哪些服务才能在 Windows Azure 上运行 Java EE 应用程序?

c# - ASP.Net Web 应用程序中的随机高 JIT 时间

asp.net - 如何判断客户端是电脑端还是手机端?

.net - 如何指定MessageBodyMember是必需的?

json - Azure - 逻辑应用程序到服务总线 - JSON 传输