An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
Custom metrics in Application Insights are not published to azure.applicationinsights namespace when using OpenTelemetry Azure Monitor exporter
I am using OpenTelemetry Metrics together with Azure.Monitor.OpenTelemetry.Exporter to export custom metrics to Application Insights.
According to the documentation:
When you send metrics by using OpenTelemetry, the system automatically stores these metrics in both the metrics store and logs. You can find these metrics in the
customMetricstable in Application Insights and in Metrics Explorer under the Custom Metric Namespace calledazure.applicationinsights.
In my case, the metrics are successfully ingested into the customMetrics table, but they do not appear in Metrics Explorer under the azure.applicationinsights namespace.
Expected behavior
Custom metrics should:
- be available in the
customMetricstable (this works), and - appear in Metrics Explorer under the
azure.applicationinsightsnamespace (this does not work).
Actual behavior:
- Metrics are present in the
customMetricstable. - Metrics are not available in Metrics Explorer under the
azure.applicationinsightsnamespace.
Configuration
services
.AddMetrics()
.AddOpenTelemetry()
.ConfigureResource(resource =>
{
resource.AddService(serviceName: environment.Name);
})
.WithMetrics(metrics => metrics
.AddMeter(meterName)
.AddAzureMonitorMetricExporter(options =>
{
options.ConnectionString = connectionString;
}));
Usage
var histogram = _meter.CreateHistogram<double>(name, unit);
histogram.Record(value, new TagList { ... });
Could you help determine why these metrics are exported to the customMetrics table but are not being promoted to the azure.applicationinsights metric namespace in Metrics Explorer? Is there any additional configuration or limitation that would cause this behavior?
**
Library name and version**
Azure.Monitor.OpenTelemetry.Exporter 1.6.0
Environment
.NET SDK 10.0.300
Runtime: Microsoft.AspNetCore.App 10.0.8
OS Platform: Windows
Application Insights: workspace-based, Custom metrics with dimensions enabled