未为在服务矩阵Linux群集上部署的.Net核心应用程序生成应用程序见解

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

我有一个.Net核心应用程序,该应用程序部署在服务矩阵Linux群集上。在应用程序中配置了应用程序见解。

Startup.cs

public void ConfigureServices(IServiceCollection services)
        {            
            ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions aiOptions
                = new ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions
                {
                    EnableAdaptiveSampling = false,

                    EnableQuickPulseMetricStream = false,

                    InstrumentationKey = "xxx"
                };

services.AddApplicationInsightsTelemetry(aiOptions);

我有一个controller类,该类具有一些操作方法并记录信息。

[HttpPost]
public ActionResult actionMethod(...)
       {
            TraceLine("------------------------------------");
            //some code
       }

private static void TraceLine(string msg)
        {
            msg = $">> {DateTime.UtcNow.ToString("o")}: {msg}";
            Log.Information(msg);
        }

我正在使用在appsettings.json和Program.cs中配置的Serilog

[当我通过邮递员直接从本地(甚至没有将其托管在本地SF群集上)点击操作方法时,我会看到生成了应用洞察力并将其推向蔚蓝。

azure app insights snapshot

但是当我遇到部署在Azure服务结构上的操作方法时,看不到任何见解。

我在这里想念什么?

非常感谢您的帮助!

azure .net-core azure-service-fabric azure-application-insights
1个回答
0
投票

嗯,我们需要在这里检查几件事:

1)托管在云上的集群的部署参数文件中的应用洞察URL和检测密钥(Cloud.xml

2)检查Cloud.xml之后,最好的方法是访问日志文件并检查实际问题是什么。

有描述here,它解释了如何发现日志文件的存储位置。

您可以使用RDP访问机器,这在here中进行了说明。

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