Grafana Dashboards Monitoring PromQL

Grafana Dashboards: Build Production-Ready Monitoring Panels

MJ
Marcus Jones
SRE Engineer
Aug 25, 2025
18 min read

What You'll Learn

How to use Grafana to visualize metrics from Prometheus, CloudWatch, or Elasticsearch. Best practices for dashboard design, variables, and PromQL panels.

What is Grafana?

While Prometheus is the brain that stores data, Grafana is the beautiful face. It connects to multiple data sources (Prometheus, InfluxDB, AWS CloudWatch, MySQL) and lets you build interactive dashboards with graphs, tables, heatmaps, and alerts.

Connecting Prometheus to Grafana

Grafana uses "Data Sources" to know where to fetch metrics.

  1. Go to Configuration (gear icon) → Data Sources.
  2. Click Add data source and select Prometheus.
  3. Set the URL (e.g., http://prometheus:9090 if running in Docker network).
  4. Click Save & Test.

Creating Your First Dashboard Panel

Let's create a panel to track CPU usage. When you add a new Panel, you'll enter a query. If Prometheus is the data source, you'll write PromQL.

Query Field (Metrics browser):

100 - (avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)

Legend Format:

{{instance}} CPU

This makes the labels look clean, like "web-server-1 CPU" instead of the raw JSON label block.

Template Variables (Dynamic Dashboards)

Instead of hardcoding server names, you can use variables to create a drop-down menu at the top of your dashboard. This lets one dashboard serve hundreds of servers.

Setting Value Purpose
TypeQueryFetches values dynamically from Prometheus
NameserverThe variable used in queries as $server
Querylabel_values(node_uname_info, instance)Gets a list of all server 'instance' IPs/names
Multi-valueTrueAllows selecting multiple servers at once

Once created, update your panel query to use the variable:
rate(node_network_receive_bytes_total{instance=~"$server"}[5m])

The Ultimate Cheat Code: Grafana Dashboard Templates

Don't build everything from scratch! Grafana has a massive community sharing pre-built dashboards.

  1. Go to grafana.com/dashboards
  2. Search for "Node Exporter Full" (ID: 1860) or "Kubernetes Cluster" (ID: 315)
  3. In your Grafana, click + → Import
  4. Paste the ID, select your Prometheus data source, and BOOM — a world-class dashboard in 10 seconds.

Keep Reading

D
DevOps

Docker Networking Demystified: Bridge, Host & Overlay

8 min read Read More
C
Cloud

AWS IAM Roles vs Users vs Policies

10 min read Read More
P
Programming

Understanding Python's GIL & Multiprocessing

14 min read Read More