BetaIT-Hub is in early access — your feedback helps us improve. Use the chat or email [email protected]

Tutorials/MONITORING/Grafana Dashboards: Visualize Your Infrastructure
IntermediateMONITORING5 min read32 views

Grafana Dashboards: Visualize Your Infrastructure

Learn how to install Grafana, connect data sources like Prometheus, and build beautiful monitoring dashboards for your servers and services.

A
adminEliteStaff
Published 65d ago

Grafana Dashboards: Visualize Your Infrastructure

Grafana turns your metrics into actionable dashboards. This guide covers installation, connecting Prometheus as a data source, and building your first dashboard.

Prerequisites

  • A Linux server
  • Prometheus already collecting metrics (or use Grafana's test data)

Step 1: Install Grafana

sudo apt install -y software-properties-common
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
sudo apt update
sudo apt install grafana

sudo systemctl enable grafana-server
sudo systemctl start grafana-server

Access Grafana at http://your-server:3000. Default login: admin / admin.

Step 2: Add Prometheus Data Source

  1. Go to Configuration > Data Sources > Add data source
  2. Select Prometheus
  3. URL: http://localhost:9090 (or your Prometheus address)
  4. Click Save & Test

Step 3: Create Your First Dashboard

  1. Click + > New Dashboard > Add visualization
  2. Select your Prometheus data source
  3. Enter a PromQL query:

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

  1. Set visualization type to Time series
  2. Add a title: "CPU Usage %"

Step 4: Build a Server Overview Dashboard

Add these panels:

Memory Usage:

(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100

Disk Usage:

100 - ((node_filesystem_avail_bytes{mountpoint="/"} / node_filesystem_size_bytes{mountpoint="/"}) * 100)

Network Traffic:

rate(node_network_receive_bytes_total{device="eth0"}[5m]) * 8

Uptime:

(time() - node_boot_time_seconds) / 86400

Step 5: Add Alerts

  1. Open any panel > Alert tab
  2. Set conditions (e.g., CPU > 90% for 5 minutes)
  3. Configure notification channel (email, Slack, PagerDuty)
  4. Save the dashboard

Step 6: Import Community Dashboards

Instead of building from scratch, import pre-built dashboards:

  1. Go to + > Import
  2. Enter a dashboard ID from grafana.com/grafana/dashboards
  3. Popular IDs:
- 1860 — Node Exporter Full - 13946 — Docker monitoring - 12708 — Kubernetes cluster

Tips

  • Use variables to make dashboards dynamic (e.g., dropdown for server selection)
  • Set auto-refresh interval (top right)
  • Use annotations to mark deployments on graphs
  • Organize panels into rows for clean layouts

Conclusion

Grafana is the standard for infrastructure visualization. Start with the pre-built Node Exporter dashboard and customize from there. The key is making your dashboards actionable — every panel should answer a specific question about your infrastructure.

Comments (0)

No comments yet. Be the first to share your thoughts.