0% found this document useful (0 votes)
3 views4 pages

14 Grafana

Grafana is an open-source visualization and monitoring tool that creates dashboards from various data sources like Prometheus and MySQL. Key features include custom dashboards, multi-data source support, alerting, user management with RBAC, and plugins. The notes cover installation methods using Docker and Helm, configuring data sources, creating dashboards, alerting setup, user management, troubleshooting, and useful commands.

Uploaded by

ValiS1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

14 Grafana

Grafana is an open-source visualization and monitoring tool that creates dashboards from various data sources like Prometheus and MySQL. Key features include custom dashboards, multi-data source support, alerting, user management with RBAC, and plugins. The notes cover installation methods using Docker and Helm, configuring data sources, creating dashboards, alerting setup, user management, troubleshooting, and useful commands.

Uploaded by

ValiS1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Here are concise **Grafana notes** for quick reference.

---

# **Grafana Notes**

## **1. What is Grafana?**

Grafana is an **open-source** visualization and monitoring tool used to create dashboards from
**various data sources** like **Prometheus, InfluxDB, MySQL, Elasticsearch**, and more.

---

## **2. Key Features of Grafana**

✅ **Custom Dashboards** – Visualize metrics with charts, graphs, and tables.

✅ **Multi-Data Source Support** – Connects to **Prometheus, InfluxDB, Loki, MySQL,


Elasticsearch**, etc.

✅ **Alerting** – Sends alerts via **Slack, Email, Webhooks, PagerDuty**, etc.

✅ **User Management** – Supports **RBAC (Role-Based Access Control)**.

✅ **Plugins** – Extend functionality using community plugins.

---

## **3. Installing Grafana**

### **Using Docker**

```sh

docker run -d --name=grafana -p 3000:3000 grafana/grafana

```

- Access Grafana at **`http://localhost:3000`**

- Default credentials: **admin/admin**

### **Using Helm (Kubernetes)**


```sh

helm repo add grafana https://grafana.github.io/helm-charts

helm install my-grafana grafana/grafana

```

- Get the admin password:

```sh

kubectl get secret my-grafana -o jsonpath="{.data.admin-password}" | base64 --decode

```

---

## **4. Configuring Data Sources**

Grafana supports **multiple data sources**.

- **Prometheus**:

- Go to **Configuration → Data Sources**

- Select **Prometheus** and enter the URL (e.g., `http://prometheus:9090`)

- Click **Save & Test**

- **MySQL/PostgreSQL**:

- Enter database credentials (host, username, password)

- Specify the SQL query for visualization

---

## **5. Creating Dashboards and Panels**

- **Dashboards**: A collection of visualizations.

- **Panels**: Individual charts or graphs inside a dashboard.

### **Adding a Panel**

1. Go to **Dashboards → Create → New Dashboard**

2. Click **Add a new panel**


3. Select **Query**, choose **data source** (e.g., Prometheus)

4. Enter a query (e.g., `rate(node_cpu_seconds_total[5m])`)

5. Click **Apply** to save

---

## **6. Grafana Alerting**

Grafana supports alerts for monitoring critical metrics.

### **Creating an Alert Rule**

1. Open a **Panel → Edit**

2. Go to **Alert → Create Alert Rule**

3. Set a condition (e.g., **CPU usage > 80%**)

4. Define **Notification Channels** (Slack, Email, Webhook)

5. Click **Save & Apply**

---

## **7. User Management & RBAC**

Grafana supports **Role-Based Access Control (RBAC)**:

- **Admin** – Full access to create/edit dashboards and manage users.

- **Editor** – Can create and edit dashboards but cannot manage users.

- **Viewer** – Can only view dashboards.

### **Adding Users**

- Go to **Configuration → Users → Invite Users**

- Assign a **role** (Admin/Editor/Viewer)

---

## **8. Grafana Logs and Troubleshooting**


- View logs:

```sh

docker logs grafana

journalctl -u grafana

```

- Check data source connection:

- **Settings → Data Sources → Test Connection**

- Common issues:

- **Dashboard not loading** → Check **Data Source URL**

- **Authentication failed** → Reset password using `grafana-cli admin reset-admin-password


newpassword`

---

## **9. Useful Grafana Commands**

| Command | Description |

|---------|------------|

| `systemctl start grafana-server` | Start Grafana service (Linux) |

| `grafana-cli plugins install <plugin-name>` | Install a Grafana plugin |

| `grafana-cli admin reset-admin-password <newpassword>` | Reset the admin password |

| `kubectl get svc -n monitoring` | Get Grafana service in Kubernetes |

---

These **Grafana notes** provide a **quick reference** for installation, configuration, and
monitoring. Let me know if you need **more details or examples!** 🚀

You might also like