有时,由于同步延迟,新的指标需要时间出现在“基于日志的指标”下。
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddApplicationInsightsTelemetry(builder.Configuration["ApplicationInsights:InstrumentationKey"]);
builder.Services.AddControllers();
builder.Services.AddSingleton<TelemetryClient>();
var app = builder.Build();
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ApplicationInsights": {
"InstrumentationKey": "<Instrumentation>"
}
}
我的应用程序见解是***图表