KhushbuP presents an in-depth look at Container Network Metrics Filtering in ACNS for AKS, empowering teams to control Kubernetes network metrics and reduce cost and noise from unnecessary data.

Cut the Noise & Cost with Container Network Metrics Filtering in ACNS for AKS

Author: KhushbuP

Overview

Container Network Metrics Filtering is a new capability in Azure Container Networking Services (ACNS) for Azure Kubernetes Service (AKS), now in Public Preview. This feature enables Kubernetes users to control which network metrics are collected and exported, directly addressing the problems of metrics bloat, excessive operational costs, and dashboard clutter.

Why Excessive Metrics Are a Problem

Modern microservices environments often suffer from collecting large volumes of irrelevant metrics, which leads to:

  • High storage and ingestion costs
  • Cluttered dashboards
  • Operational overhead and slower queries

Using granular filter controls, you can now ensure that only the most relevant metrics are sent to your observability stack.

Key Benefits

  • Fine-Grained Control: Filter by namespace or pod label to target vital services and exclude irrelevant data.
  • Cost Optimization: Lower storage and ingestion costs across monitoring tools like Prometheus and Grafana.
  • Improved Observability: Cleaner dashboards and faster troubleshooting by focusing on high-value, actionable metrics.
  • Dynamic, Zero-Downtime Updates: Change or apply new filters at runtime without restarting Cilium agents or Prometheus collectors.

How It Works

Filtering happens at the Cilium agent level, inside the Linux kernel’s data plane. You define your metrics filters using the ContainerNetworkMetric Custom Resource Definition (CRD), allowing you to include or exclude specific metric types (e.g., DNS lookups, TCP connections, dropped flow metrics).

This approach reduces the volume of metrics before they ever leave the node, ensuring the data sent to your observability tools is already curated.

Example: Filtering Flow Metrics to Reduce Noise

Below is a sample ContainerNetworkMetric CRD that includes only dropped flows from the traffic/http namespace and excludes all flows from traffic/fortio pods:

apiVersion: acn.azure.com/v1alpha1
kind: ContainerNetworkMetric
metadata:
  name: container-network-metric
spec:
  filters:
    - metric: flow
      includeFilters:
        # Include only DROPPED flows from traffic namespace
        verdict:
          - "dropped"
        from:
          namespacedPod:
            - "traffic/http"
      excludeFilters:
        # Exclude traffic/fortio flows to reduce noise
        from:
          namespacedPod:
            - "traffic/fortio"

Getting Started

  1. Enable ACNS: Ensure ACNS is enabled on your AKS cluster.
  2. Define Your Filters: Create and apply your ContainerNetworkMetric CRD according to your include/exclude logic. See the how-to guide for details.
  3. Validate: Use ConfigMap inspection and Cilium agent logs to verify active filters.
  4. See Results: Observe metrics volume reduction, clearer dashboards, and lower ingestion costs.

For more information, visit the Metrics Filtering Guide.

Conclusion

Container Network Metrics Filtering in ACNS for AKS provides powerful, Kubernetes-native controls for network observability, helping teams cut through monitoring noise while optimizing cost and operational efficiency.

This post appeared first on “Microsoft Tech Community”. Read the entire article here