I explicitly track 4 metrics in my app and they all show up in the Azure Application Insights custom metrics. But this list of metrics also has 3 metrics I did not set:
What are these and where did they come from? I do have Health Checks enabled. Also, the 1st & 3rd of these has numbers while the 2nd is flatlined at 0.
Thanks @Peter Bons's for the Answer.
In addition, Please check the below Workaround.
I have created a sample Application Insights with default settings.
I haven't configured anything neither enabled Application Insights for my App.
Initially I don't see any metrics which you have mentioned.
I have just configured Application Insights from Connected Services in VS and deployed the app to Azure App Service.
Now Iam able to see the HeartbeatState
metric.
AFAIK, HealthReportEntryDuration
and TotalDuration
are related to HealthCheck. Based on the installed packages related to the health check they might have enabled.
My Program.cs
file:
builder.Services.AddApplicationInsightsTelemetry(new Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions
{
ConnectionString = builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]
});
builder.Services.AddHealthChecks()
.AddCheck("SampleCheck", () => HealthCheckResult.Healthy(), tags: new[] { "sample" })
.AddApplicationInsightsPublisher();
As per this MSDoc, totalDuration
comes under Browser metrics.
To collect browser metrics, your application must be instrumented with the Application Insights JavaScript SDK.
so configured JavaScript SDK as well.
Also refer this MSDoc on Monitoring data reference -Azure Monitor for more details.