Skip to content
Cloud Efficiency Hub

Duplicate Container Metrics Collection in Container Insights

The short version

AKS clusters can send container metrics to two places: Azure Monitor managed service for Prometheus, which stores metrics in an Azure Monitor workspace, and Container insights, which can write performance and inventory data such as Perf and InsightsMetrics into a Log Analytics workspace.

PointFive Research

Cloud cost research at PointFive

Azure service
Azure Monitor
Category
Other
Reference
CER-0569
Type
Excessive Ingestion or Processing

Explanation

Why the waste happens and who it affects.

Clusters that were onboarded with the full Container insights data set, which is the default streams value in Microsoft's ARM and Bicep onboarding templates and common on older clusters, and that also have Managed Prometheus enabled, pay for largely the same metric signals twice. Some clusters additionally configure Container insights to scrape Prometheus metrics into Log Analytics, which Microsoft calls redundant with Managed Prometheus.

The Log Analytics copy is the expensive one, because metrics are ingested at per-GB log rates. Azure Advisor flags AKS clusters for this with the Switch to Prometheus-based Container Insights recommendation, noting that Managed Prometheus can be up to 80 percent cheaper than log-based metrics and that the Logs and Events cost preset avoids duplicate collection. The portal onboarding default is already Logs and Events, so the waste is concentrated in clusters created by scripts, templates or before the presets existed.

Billing model

The pricing dimensions that drive this cost.

The two collection paths are billed on different meters, so duplicate collection pays both.

Container insights data
Billed as Log Analytics ingestion per GB into tables such as Perf, InsightsMetrics, ContainerInventory, KubePodInventory and ContainerLogV2
Managed Prometheus
No charge for the service or the Azure Monitor workspace; billed on metric ingestion and queries, with 18 months of storage included
Collection presets
Logs and Events collects only ContainerLogV2, KubeEvents and KubePodInventory; Standard and Syslog collect all standard tables; Cost-optimized collects all tables every 5 minutes excluding system namespaces
Default stream group
When the streams parameter is not set in the ARM or Bicep onboarding template, Microsoft-ContainerInsights-Group-Default collects all Container insights streams including Perf and InsightsMetrics

How to detect

5 checks to find it in your estate.

  • Review the Azure Advisor cost recommendation Switch to Prometheus-based Container Insights on microsoft.containerservice/managedclusters resources
  • For clusters with Managed Prometheus enabled, check the Container insights data collection rule streams; Microsoft-ContainerInsights-Group-Default, Microsoft-Perf or Microsoft-InsightsMetrics indicate metrics are also going to Log Analytics
  • Query the Usage table for billable volume of Perf, InsightsMetrics and inventory tables coming from those clusters, and compare with ContainerLogV2 and KubeEvents volume
  • Check whether Container insights is configured to collect Prometheus metrics into the Log Analytics workspace in addition to Managed Prometheus
  • Inventory clusters onboarded from templates or scripts without an explicit streams value or data collection settings file, since templates default to the full stream group

How to fix

5 ways to remove the waste.

  • Keep metrics in Managed Prometheus and change Container insights to the Logs and Events preset, or set the DCR streams to Microsoft-ContainerLogV2, Microsoft-KubeEvents and Microsoft-KubePodInventory, for example with az aks enable-addons --data-collection-settings
  • Stop sending Prometheus metrics to the Log Analytics workspace when Managed Prometheus already scrapes them
  • Where some Log Analytics performance data is still needed, use the Cost-optimized preset or a longer collection frequency and namespace filtering instead of the full default
  • Visualize metrics with Grafana or Prometheus-based views; confirm which Container insights portal views the team relies on before removing the Perf and InsightsMetrics tables
  • Update onboarding scripts and templates to pass explicit data collection settings so new clusters do not default to the full stream group

Documentation

Vendor references for pricing and configuration.