App Insights 中的遥测出现时间延迟或刷新?

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

有一个在 Azure 中运行的 asp.net 网站,我也在本地运行 Visual Studio,尝试在日志中的 Azure 门户中显示一些活动。由于某种原因,似乎并非所有请求都被发送。只需单击已部署应用程序中以及本地的几个页面,等待 5,10 和 30 分钟后,我仍然看不到我启动的活动。我向管理员确认我使用的密钥是正确的。我还可以检查什么?

查询日志:
请求 |其中名称包含“my-controller-here”

或者只是浏览过去 4 小时内的请求,我看不到我发起的请求。我看到了一些其他已提出的请求,但与应该看到的内容相差甚远,也没有看到我提出的请求。

在我的应用程序设置文件中:

ApplicationInsights": {
   "InstrumentationKey":"key-val-here"
}

我也尝试过设置
"APPINSIGHTS_INSTRUMENTATIONKEY":"key-val-此处"

azure-application-insights
1个回答
0
投票

App Insights 中遥测的时间延迟或刷新?

  • 是的,根据发送的请求,在 Application Insights 中查看日志时会出现几分钟的延迟。但它不会持续几个小时。

  • appsettings.json
    可以配置为
     InstrumentationKey
    ConnectionString

  • 最初我没有在配置中设置任何日志级别。我已在

    LogInformation
    文件中设置了
    Program.cs
    消息。

builder.Services.AddApplicationInsightsTelemetry();
var app = builder.Build();
app.Logger.LogInformation("Log Info from Program.cs file");
  • 当我运行应用程序时,我可以在本地控制台中看到跟踪,但在 Application Insights - 事务搜索中看不到。

enter image description here

没有日志级别:

enter image description here

日志级别: enter image description here

enter image description here

  • 您的配置可能有问题。设置日志级别后,尝试检查日志。

参考此SOThread设置

appsettings.json
文件中的日志级别。

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