Can't add a metric from ApplicationInsights to the chart in Azure - Stack Overflow

I have a .NET app hosted in Azure.The app writes a lot of metrics to the ApplicationInsights. To creat

I have a .NET app hosted in Azure.

The app writes a lot of metrics to the ApplicationInsights. To create a chart based on the metrics I choose my-appinsight-instance as a Scope, Log-based metrics as a Metric Namespace. Once I choose the scope and the metric namespace, I can find my metrics in the Metrics input. So far everything works.

Yesterday I added a new metric. The metric is written once per day. It has been written once already and I want to create a new chart with the new metric. I do the same I've done before: I create a new chart inside my dashboard, choose my-appinsight-instance as a Scope, Log-based metrics as a Metric Namespace. But I can't find my new metric in the Metric input. I can find all the other metrics there, but not the new one. I chose the timerange of last 3 days, even though the metric has been written less than 10 hours ago.

Here is a screenshot where you can see that the metric exists in the ApplicationInsights

Why the metric isn't available for the chart?

I have a .NET app hosted in Azure.

The app writes a lot of metrics to the ApplicationInsights. To create a chart based on the metrics I choose my-appinsight-instance as a Scope, Log-based metrics as a Metric Namespace. Once I choose the scope and the metric namespace, I can find my metrics in the Metrics input. So far everything works.

Yesterday I added a new metric. The metric is written once per day. It has been written once already and I want to create a new chart with the new metric. I do the same I've done before: I create a new chart inside my dashboard, choose my-appinsight-instance as a Scope, Log-based metrics as a Metric Namespace. But I can't find my new metric in the Metric input. I can find all the other metrics there, but not the new one. I chose the timerange of last 3 days, even though the metric has been written less than 10 hours ago.

Here is a screenshot where you can see that the metric exists in the ApplicationInsights

Why the metric isn't available for the chart?

Share Improve this question asked Mar 12 at 7:59 Volodymyr V.Volodymyr V. 1473 silver badges13 bronze badges 3
  • Try checking the Logs (Kusto Query) to confirm the metric exists, wait a few more hours for ingestion, and ensure it's promoted as a log-based metric in Application Insights. – Sirra Sneha Commented Mar 12 at 10:40
  • In the screenshot above you can see that the metric exists. By the time I tried to add it to the chart, much more than 3 hours had passed. – Volodymyr V. Commented Mar 12 at 13:37
  • I've tried this, and it's working fine for me ,I can view the chart without any issues. If you're still not seeing the metric, it might be due to a delay in Azure Monitor indexing the new log-based metric for visualization. Even though the metric appears in Application Insights Logs, sometimes it takes longer to be available in the Metrics blade. Also, ensure the correct aggregation (Sum, Count, etc.) is selected and try refreshing the portal. – Sirra Sneha Commented Mar 19 at 12:16
Add a comment  | 

1 Answer 1

Reset to default 0

The reason you're not seeing the new metrics in metrics blade is,

  • Azure Monitor indexing delay: Even if the metric appears in KQL, sometimes it takes longer to be available in the Metrics UI.

  • Try refreshing the Azure Portal, clearing browser cache, or opening it in Incognito mode.

  • Sometimes, new metrics take time to appear under "Log-based metrics" due to a sync delay.

I've created a sample .NET application, configured Application Insights, and can view the chart without any issues.

My program.cs :


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();

appsettings.json:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*",
  "ApplicationInsights": {
    "InstrumentationKey": "<Instrumentation>"
  }
}

Here are the ***charts from my Application Insights


发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744765032a4592407.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信