【发布时间】:2020-07-16 05:10:30
【问题描述】:
我有一个部署在 Service Fabric Linux 集群上的 .Net 核心应用程序。应用洞察在应用中配置。
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);
}
我使用的是 Serilog,在 appsettings.json & Program.cs 中配置
当我通过 Postman 直接从本地点击操作方法(甚至不将其托管在本地 sf 集群上)时,我看到应用洞察力正在生成并推送到 azure。
但是当我点击部署在 Azure 服务结构上的操作方法时,我看不到任何洞察力。
我在这里错过了什么?
非常感谢任何帮助!
【问题讨论】:
标签: azure .net-core azure-service-fabric azure-application-insights