Grafana Setup & Dashboard Creation (Part-5)— Explained by Raees Yaqoob Qazi

 Today, I’m going to talk about Grafana. Grafana is a powerful tool used to create dashboards and visualize data. As DevOps engineers, monitoring is very important, and Grafana makes it easy to understand system performance.

Part-1: https://brillertechnologies.blogspot.com/2025/11/prometheus-and-grafana-projectpart-1-by.html

Part 2: https://brillertechnologies.blogspot.com/2025/11/monitoring-containers-with-cadvisorpart.html

Part 3: https://brillertechnologies.blogspot.com/2025/12/understanding-prometheus-in-simple-way.html

Part 4: https://brillertechnologies.blogspot.com/2025/12/understanding-prometheusmonitoring-made.html

1. Running Grafana Using Docker Compose

First, I use Docker Compose to run Grafana.

Open your docker-compose.yml file:

vim docker-compose.yml

Add the Grafana service:

grafana:
image: grafana/grafana-enterprise
container_name: grafana
restart: unless-stopped
ports:
- "3000:3000"

Save and exit with:
 :wq

Then run:

docker compose up -d

After running this command, your Grafana container will start running in the background.

2. Allow Port 3000 in Your Security Group

If you are running this on a cloud server (AWS, GCP, etc.):

  • Go to the Security Group
  • Allow port 3000

Now open Grafana in your browser:

<your-IP>:3000

3. Grafana Default Login

For the first login:

  • Username: admin
  • Password: admin

After logging in, you can change the password.

4. Connect Prometheus to Grafana

To receive data from Prometheus:

  1. Click Connections in Grafana’s left menu
  2. Search for Prometheus
  3. Add the Prometheus data source
  4. Fill in the details:
  • Name: Prometheus
  • URL: http://<prometheus-ip>:9090

Click Save & Test

If the test is successful, Grafana is now connected to Prometheus.

5. Creating Your First Dashboard

To create a dashboard:

  1. Go to Dashboards
  2. Click + Create
  3. Select Add visualization
  4. Choose the data source → Prometheus

Now enter a query:

  • Metric: container_cpu_load_average_10s
  • Add label filters:
  • Name: notes-todo

Click Apply, and your chart will appear on the dashboard.

This is the manual method for visualization.

6. Using Ready-Made Grafana Templates (Recommended)

For professional-looking dashboards, templates are the best option.

Search on Google:

Prometheus Node Exporter Grafana Dashboard

Open the dashboard you like and copy its Dashboard ID.

Then in Grafana:

  1. Go to Dashboards
  2. Click Import
  3. Paste the Dashboard ID
  4. Select Prometheus as the data source
  5. Click Import

Your complete, beautiful dashboard will appear instantly.

🌐 Online References


Comments

Popular posts from this blog

📘 Understanding Prometheus in a Simple Way-Part 3 (For DevOps Beginners)

My First Python Program: A Simple Calculator