基于Service Fabric的ASP.NET Core站点向Application Insights发送性能计数器

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

我有一个托管ASP.NET Core网站的Service Fabric集群。我也使用Application Insights来分析网站的性能。为了在运行时收集指标并将它们转发给Application Insights,我添加了以下行...

AddApplicationInsightsTelemetry("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")

..在以下标准代码的中间,用于在Service Fabric服务实例中设置网站...

    protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners()
    {
        return new ServiceInstanceListener[]
        {
            new ServiceInstanceListener(serviceContext =>
                new HttpSysCommunicationListener(serviceContext, "ServiceEndpoint", (url, listener) =>
                {
                    return new WebHostBuilder()
                                .UseHttpSys()
                                .ConfigureServices(
                                    services => services
                                        .AddSingleton<StatelessServiceContext>(serviceContext)
                                        .AddApplicationInsightsTelemetry("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"))
                                .UseContentRoot(Directory.GetCurrentDirectory())
                                .UseStartup<Startup>()
                                .UseServiceFabricIntegration(listener, ServiceFabricIntegrationOptions.None)
                                .UseUrls(url)
                                .Build();
                }))
        };
    }

查看Application Insights指标,我收到以下错误跟踪消息...

enter image description here

它声明它无法收集3个性能计数器。我不确定如何修复该错误,因为目标群集节点都有这些计数器,正如使用性能监视器检查它们是否存在所证实的那样。此外,正确收集了不同的指标。 Application Insights会列出对网站的请求。所以它主要是工作。

任何人都有想法可能是什么问题?

asp.net azure-application-insights service-fabric-stateless azure-performancecounters
1个回答
0
投票

如果您运行的是Asp.Net核心Web应用程序,则不能使用ASP.NET Perf计数器度量标准。

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