Azure Application Insights出现大量n/a关键跟踪消息求助
问题:Azure上.NET Core应用的Application Insights出现大量n/a关键跟踪消息
我有一个部署在Azure上的.NET Core Web应用,使用Application Insights进行日志记录。发现出现了异常数量的n/a关键跟踪消息,仅1分钟内就有约11000条。请问有人在Application Insights中遇到过这个问题吗?

使用的库
- Microsoft.ApplicationInsights.AspNetCore Version=2.15.0
- Microsoft.ApplicationInsights.DependencyCollector Version=2.15.0
- Microsoft.ApplicationInsights.DiagnosticSourceListener Version=2.15.0
- Microsoft.ApplicationInsights.EventSourceListener Version=2.15.0
- Microsoft.ApplicationInsights.TraceListener Version=2.15.0
- Microsoft.ApplicationInsights.WindowsServer Version=2.15.0
- Microsoft.AspNetCore.Hosting Version=2.2.7
.NET运行时
netcoreapp3.1
Application Insights配置代码
public static IWebHostBuilder UseLoggingWithAppInsights(this IWebHostBuilder builder) { builder.ConfigureServices((context, services) => { services.AddApplicationInsightsTelemetry(applicationInsightsInstrumentKey); }); var provider = services.BuildServiceProvider(); IWebHostEnvironment host = provider.GetService<IWebHostEnvironment>(); IHttpContextAccessor context = provider.GetService<IHttpContextAccessor>(); TelemetryConfiguration.Active.EnableTelemetry(applicationInsightsInstrumentKey, appName, telemetryDetails, telemetrySettings, context, host); TelemetryConfiguration config = provider.GetService<TelemetryConfiguration>() ?? TelemetryConfiguration.CreateDefault(); TelemetryConfiguration.Active.FireTraceToSeeIfActive(); config.FireTraceToSeeIfActive(); builder.ConfigureServices((context, services) => { var instrumentationKey = context.Configuration.GetValue<string>("ApplicationInsights:InstrumentationKey"); if (string.IsNullOrWhiteSpace(TelemetryConfiguration.Active.InstrumentationKey) || TelemetryConfiguration.Active.InstrumentationKey != instrumentationKey) { TelemetryConfiguration.Active.InstrumentationKey = instrumentationKey; } var provider = services.BuildServiceProvider(); Util.StaticApplicationLogging.LoggerFactory = provider.GetRequiredService<ILoggerFactory>(); }); builder.ConfigureLogging((builderContext, loggingBuilder) => { loggingBuilder.AddConfiguration(builderContext.Configuration.GetSection("Logging")); }); return builder; }
内容的提问来源于stack exchange,提问作者endlesscalm
相关产品推荐
相关产品推荐

