Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ We cover a wide range of DevOps topics in our content library, explore them unde
<td>✔️ <a href="./topics/sonarqube/basics/">Explore</a></td>
<td>✔️ <a href="./topics/sonarqube/practice/">Explore</a></td>
</tr>
<tr>
<td><img height="28" src="https://skillicons.dev/icons?i=grafana" /></td>
<td>Grafana</td>
<td><a href="./topics/grafana/">grafana</a></td>
<td>📖 <a href="https://grafana.com/docs/">View</a></td>
<td>✔️ <a href="./topics/grafana/basics/helloworld/">Explore</a></td>
<td>🏃 <a href="./topics/grafana/practice/">Explore</a></td>
</tr>
</table>

- And **more upcoming topics...⏩** you can star/follow this repository to get more up-to-dated content ⭐
Expand Down
47 changes: 47 additions & 0 deletions topics/grafana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## 1. What is Grafana?

- https://grafana.com/

### Overview

- Grafana is an open-source platform for monitoring and observability that visualizes metrics, logs, and traces from various data sources.

### Official website documentation of Grafana

- https://grafana.com/docs/

## 2. Prerequisites

- N/A

## 3. Installation

### How to install Grafana?

- Installing Grafana: https://grafana.com/docs/grafana/latest/installation/

## 4. Basics of Grafana

### Getting started with Grafana

- Refer to the [Official Grafana getting started documentation](https://grafana.com/docs/grafana/latest/getting-started/) for a comprehensive introduction.

### Grafana Hello World

- Check the [helloworld/](./basics/helloworld/) directory to create a simple Grafana demo (with Prometheus as data source).

## 5. Beyond the Basics

### Hands-On Example

- Explore a practical hands-on example in the [Grafana hands-on](https://grafana.com/tutorials/) for more Grafana concepts

## 6. More

### Grafana learning resource

- N/A

### Recommended Books

- N/A
15 changes: 15 additions & 0 deletions topics/grafana/basics/helloworld/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Install Grafana with Prometheus (Hello World)

## On docker - via Docker compose

- See run `cd installation/docker-compose; ./install.sh`

## On K8s - via Helm (TODO: Move to helm folder?)

- Work in-progress

# Practice with Grafana

- Install Grafana and Prometheus, via [docker-compose](./installation/docker-compose/)
- Add Prometheus as data source in Grafana UI at http://localhost:3000 (admin/admin)
- Create a simple dashboard to visualize Prometheus metrics
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3.8'

services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
command:
- '--config.file=/etc/prometheus/prometheus.yml'
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./provisioning:/etc/grafana/provisioning:ro
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false

volumes:
grafana-data:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e

echo "Starting Grafana and Prometheus..."
docker-compose up -d

echo "Waiting for services to be ready..."
sleep 10

echo "Grafana should be available at http://localhost:3000 (admin/admin)"
echo "Prometheus UI at http://localhost:9090"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
global:
scrape_interval: 15s

scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']

- job_name: 'grafana'
static_configs:
- targets: ['localhost:3000']
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
access: proxy
isDefault: true
editable: false
21 changes: 21 additions & 0 deletions topics/grafana/practice/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Grafana Practice

This directory contains advanced examples for Grafana.

## Example 1: Creating a Dashboard via JSON

- Refer to the official documentation: https://grafana.com/docs/grafana/latest/panels/export-import/

## Example 2: Setting up Alerting

- Learn how to create alert rules: https://grafana.com/docs/grafana/latest/alerting/

## Example 3: Using Templating Variables

- See how to use variables: https://grafana.com/docs/grafana/latest/variables/

## Example 4: Provisioning Dashboards

- Learn how to provision dashboards via files: https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards

Feel free to explore and add your own examples!