mirror of
https://github.com/Dvorinka/Dash.git
synced 2026-10-28 07:41:27 +00:00
feat(infra): external monitoring stack (Beszel + Prometheus/Grafana)
Homelab monitoring design (docs/specs/2026-10-03-external-monitoring.md): Beszel agents own the two physical hosts, prometheus-pve-exporter covers every LXC/VM via the PVE API with no guest agents, and Grafana supplies graphs. Dash needs zero code changes — JSON-path widgets already carry an Authorization header and can walk Prometheus/Beszel JSON, embed widgets iframe Grafana panels, and monitors + notification transports provide the alerting layer for unmanaged hardware like the CM834 switch. infra/monitoring/ ships compose.yaml, prometheus.yml, pve.yml.example (gitignored real file), and Grafana datasource provisioning. docs/monitoring.md documents deployment and widget recipes. Authored By: TDvorak <[email protected]> Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
3ffc01d710
commit
f2aa9ceba8
9 files changed
+329
No files matched your search
@@ -0,0 +1,65 @@
|
||||
# External monitoring stack — independent of the Dash container.
|
||||
# Run on any host (a small Debian LXC on Proxmox works well):
|
||||
# cp pve.yml.example pve.yml # fill in your PVE API token
|
||||
# docker compose up -d
|
||||
# All state lives in named volumes.
|
||||
name: dash-monitoring
|
||||
|
||||
services:
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
restart: unless-stopped
|
||||
command:
|
||||
- --config.file=/etc/prometheus/prometheus.yml
|
||||
- --storage.tsdb.retention.time=30d
|
||||
- --web.enable-lifecycle # POST /-/reload applies config changes
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- prometheus-data:/prometheus
|
||||
ports:
|
||||
- "9090:9090"
|
||||
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
# LAN convenience for Dash iframe widgets: read-only anonymous access.
|
||||
# Anyone on your network can VIEW dashboards without logging in.
|
||||
# Delete these three lines to require sign-in instead.
|
||||
GF_AUTH_ANONYMOUS_ENABLED: "true"
|
||||
GF_AUTH_ANONYMOUS_ORG_ROLE: Viewer
|
||||
GF_SECURITY_ALLOW_EMBEDDING: "true" # required for iframe embeds
|
||||
GF_USERS_ALLOW_SIGN_UP: "false"
|
||||
volumes:
|
||||
- ./grafana/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml:ro
|
||||
- grafana-data:/var/lib/grafana
|
||||
ports:
|
||||
- "3001:3000"
|
||||
depends_on:
|
||||
- prometheus
|
||||
|
||||
pve-exporter:
|
||||
image: prompve/prometheus-pve-exporter:latest
|
||||
container_name: pve-exporter
|
||||
restart: unless-stopped
|
||||
command: ["--config.file", "/etc/pve.yml"]
|
||||
volumes:
|
||||
- ./pve.yml:/etc/pve.yml:ro
|
||||
ports:
|
||||
- "9221:9221"
|
||||
|
||||
beszel-hub:
|
||||
image: henrygd/beszel:latest
|
||||
container_name: beszel
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- beszel-data:/beszel_data
|
||||
ports:
|
||||
- "8090:8090"
|
||||
|
||||
volumes:
|
||||
prometheus-data:
|
||||
grafana-data:
|
||||
beszel-data:
|
||||
@@ -0,0 +1,10 @@
|
||||
# Auto-provisions the Prometheus datasource so Grafana works on first boot.
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: http://prometheus:9090
|
||||
isDefault: true
|
||||
editable: true
|
||||
@@ -0,0 +1,31 @@
|
||||
# Prometheus scrape config for the Dash-adjacent monitoring stack.
|
||||
# Adjust the host addresses to your LAN before starting.
|
||||
|
||||
global:
|
||||
scrape_interval: 30s
|
||||
evaluation_interval: 30s
|
||||
|
||||
scrape_configs:
|
||||
# Proxmox cluster: node + every LXC/VM via the PVE API.
|
||||
# No agents inside guests — pve-exporter asks the API on :8006.
|
||||
- job_name: pve
|
||||
metrics_path: /pve
|
||||
params:
|
||||
module: [default]
|
||||
cluster: ["1"]
|
||||
node: ["1"]
|
||||
static_configs:
|
||||
- targets: ["PVE_HOST:8006"] # <- your Proxmox host
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
target_label: __param_target
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: pve-exporter:9221
|
||||
|
||||
# Dash itself — it exposes Prometheus-format metrics already.
|
||||
- job_name: dash
|
||||
metrics_path: /api/metrics
|
||||
static_configs:
|
||||
- targets: ["DASH_HOST:3000"] # <- wherever Dash runs (CasaOS box, etc.)
|
||||
@@ -0,0 +1,13 @@
|
||||
# prometheus-pve-exporter config — copy to pve.yml and fill in.
|
||||
# pve.yml contains a credential: keep it out of git.
|
||||
#
|
||||
# Recommended setup on the Proxmox host:
|
||||
# pveum user add dashmon@pve --comment "read-only monitoring"
|
||||
# pveum aclmod / -user dashmon@pve -role PVEAuditor
|
||||
# Datacenter -> Permissions -> API Tokens -> add token "dash" for dashmon@pve,
|
||||
# uncheck "Privilege Separation" (the token inherits the user's PVEAuditor role)
|
||||
default:
|
||||
user: dashmon@pve
|
||||
token_name: dash
|
||||
token_value: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
verify_ssl: false # PVE ships self-signed certs on LAN
|
||||
Reference in new issue
Block a user