summaryrefslogtreecommitdiff
path: root/grafana
diff options
context:
space:
mode:
Diffstat (limited to 'grafana')
-rw-r--r--grafana/README.md23
-rw-r--r--grafana/docker-compose.yml21
-rw-r--r--grafana/prometheus.yml16
3 files changed, 60 insertions, 0 deletions
diff --git a/grafana/README.md b/grafana/README.md
new file mode 100644
index 0000000..4e0a53d
--- /dev/null
+++ b/grafana/README.md
@@ -0,0 +1,23 @@
+# Grafana + Prometheus
+
+Metrics visualization dashboard with Prometheus as the data source.
+
+## Setup
+
+1. Edit `prometheus.yml` to add your scrape targets.
+
+2. Start:
+ ```
+ docker compose up -d
+ ```
+
+## Access
+
+- Grafana: `http://<host>:3000`
+ - Default login: `admin` / `admin` (change on first login)
+
+## What to Configure
+
+- **`prometheus.yml`** — Add your scrape targets (node_exporter, nginx_exporter, etc.) before starting. The file currently contains example targets.
+- **Grafana** — On first login, add Prometheus as a data source at `http://prometheus:9090`.
+- **Data persistence** — Both `prometheus_data` and `grafana_data` are Docker volumes. They persist across restarts and stack upgrades.
diff --git a/grafana/docker-compose.yml b/grafana/docker-compose.yml
new file mode 100644
index 0000000..f9be4fd
--- /dev/null
+++ b/grafana/docker-compose.yml
@@ -0,0 +1,21 @@
+services:
+ prometheus:
+ image: prom/prometheus
+ container_name: prometheus
+ restart: unless-stopped
+ volumes:
+ - ./prometheus.yml:/etc/prometheus/prometheus.yml
+ - prometheus_data:/prometheus
+
+ grafana:
+ image: grafana/grafana
+ container_name: grafana
+ restart: unless-stopped
+ ports:
+ - "3000:3000"
+ volumes:
+ - grafana_data:/var/lib/grafana
+
+volumes:
+ prometheus_data:
+ grafana_data:
diff --git a/grafana/prometheus.yml b/grafana/prometheus.yml
new file mode 100644
index 0000000..2198130
--- /dev/null
+++ b/grafana/prometheus.yml
@@ -0,0 +1,16 @@
+global:
+ scrape_interval: 15s
+
+scrape_configs:
+ # Add your own scrape targets. Examples:
+ # - job_name: node_exporter
+ # static_configs:
+ # - targets: ['<your-server-ip>:9100']
+ #
+ # - job_name: nginx_exporter
+ # static_configs:
+ # - targets: ['<your-server-ip>:9113']
+ #
+ # - job_name: pihole
+ # static_configs:
+ # - targets: ['<your-pihole-ip>:9617']