Persistence prometheus data

This commit is contained in:
2025-01-15 19:56:41 +08:00
parent 004adf6705
commit e771dfecc6
2 changed files with 8 additions and 0 deletions

View File

@@ -11,3 +11,8 @@ scrape_configs:
scrape_interval: 5s
static_configs:
- targets: ['192.168.1.24:8087']
- job_name: 'kasa-exporter-local'
scrape_interval: 5s
static_configs:
- targets: ['192.168.1.24:8088']

View File

@@ -29,14 +29,17 @@ services:
prometheus:
image: prom/prometheus:latest
user: "1000:1000"
restart: always
command:
- --storage.tsdb.retention.time=365d
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
ports:
- "8083:9090"
volumes:
- ./data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./data/prometheus/data:/prometheus
node_exporter:
image: prom/node-exporter:latest