Monitor Kubernetes Pod Network I/O Traffic in Grafana

Network I/O is one of those metrics that suddenly becomes very important the moment an application slows down. It’s usually the first thing Devs point at before stating one of the following classics: “Is it a DDoS attack?” “Is there abnormal traffic coming in?” “It can’t possibly be my code!”

In this post, we’re going to set up a simple Grafana time series graph so Dev teams can check network usage themselves instead of sending you panic messages in the middle of the day.

Here’s the PromQL query used for the graph:

sort_desc(sum by (pod) (rate(container_network_receive_bytes_total{pod!="",namespace=~"$namespace"}[5m])))

What this actually means:

  • container_network_receive_bytes_total → total network bytes received by a container
  • rate(...[5m]) → calculates how fast those bytes are coming in per second over the last 5 minutes
  • sum by (pod) → aggregates all containers so you see traffic per pod
  • namespace=~"$namespace" → lets you filter dynamically by Grafana variable
  • sort_desc(...) → puts the loudest (a.k.a. busiest) pods at the top





  • Once this is set up, you get a clean time series view of which pods are actually talking the most on the network.

    #grafana #prometheus

    0 Comments