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 developers point at before saying 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'll create a simple Grafana Time Series panel so development teams can monitor network usage themselves instead of sending you panic messages halfway through the day.
Use the following PromQL query:
How the Query Works
container_network_receive_bytes_total→ Total number of network bytes received by each container.rate(...[5m])→ Calculates the average number of bytes received per second over the last five minutes.sum by (pod)→ Combines the network traffic from all containers belonging to the same pod.namespace=~"$namespace"→ Filters the results using the namespace selected from your Grafana dashboard variable.sort_desc(...)→ Sorts the results in descending order so the busiest pods appear at the top.
Once configured, you'll have a clear time series graph showing which pods are receiving the most network traffic in the selected namespace.
This makes it much easier to identify unusually busy pods and quickly determine whether network traffic is a likely contributor to application performance issues.
#grafana #prometheus #monitoring
0 Comments