admin管理员组文章数量:1416924
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
1 Answer
Reset to default 0The 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
本文标签: Can39t add a metric from ApplicationInsights to the chart in AzureStack Overflow
版权声明:本文标题:Can't add a metric from ApplicationInsights to the chart in Azure - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744765032a2623987.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论