Application Insights 遥测显示私有负载均衡器后面的 MVC 4 应用程序为“NA”

问题描述 投票:0回答:1

Stack Overflow 社区您好,

当我的 MVC 4 应用程序部署在私有负载均衡器后面时,我遇到了 Application Insights 遥测问题。在本地,CPU 和内存遥测已成功推送,但当从专用负载均衡器后面的虚拟机运行时,它显示“NA”,如下面的屏幕截图所示:

最初,我怀疑负载均衡器,但持续的请求确实是从虚拟机推送的。

以下是我在 Startup.cs 中配置 Application Insights 的方法:

[assembly: OwinStartup(typeof(DesignHub.WebMvc.Startup))]
public class Startup
{ 
    public void Configuration(IAppBuilder app)
    {
        string appInsightsConnectionString = ConfigurationManager.AppSettings["AppInsightsConnectionString"];

        Configure Application Insights
        if (string.IsNullOrEmpty(appInsightsConnectionString) == false)
        {
            TelemetryConfiguration.Active.ConnectionString = appInsightsConnectionString;
        }
    }
}

我非常感谢任何关于可能导致这种差异的原因以及如何解决它的见解或建议。

感谢您的协助!

c# asp.net-mvc azure asp.net-mvc-4 azure-application-insights
1个回答
0
投票

看起来您需要授予读取计算机级性能计数器值的权限。

我建议您尝试以下故障排除指南:

https://learn.microsoft.com/en-us/troubleshoot/azure/azure-monitor/app-insights/missing-cpu-total-comfilled-memory-metrics

© www.soinside.com 2019 - 2024. All rights reserved.