aboutsummaryrefslogtreecommitdiffstats
path: root/docker-compose/docker-compose.yml
diff options
context:
space:
mode:
authorhalil.cakal <halil.cakal@est.tech>2024-11-26 16:33:46 +0000
committerhalil.cakal <halil.cakal@est.tech>2024-12-04 14:19:59 +0000
commit9d14873af2c4f0ca2221b1be3291c039a2e1ac6e (patch)
tree05696b69e252bc40cf555d0c3c31419e4444f664 /docker-compose/docker-compose.yml
parent49c48df725d462a2085d37fc055df399c2dbd4fc (diff)
Add persistent storage to prometheus
- add healthcheck to ensure prometheus service is running correctly and restarts it if it becomes unhealthy - set the data retention time to 30d - update readme Issue-ID: CPS-2466 Change-Id: I0f6186f8577e8e0113831ed040298b823e33d624 Signed-off-by: halil.cakal <halil.cakal@est.tech>
Diffstat (limited to 'docker-compose/docker-compose.yml')
-rw-r--r--docker-compose/docker-compose.yml14
1 files changed, 12 insertions, 2 deletions
diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml
index 604cfe91a2..d2eff8da2b 100644
--- a/docker-compose/docker-compose.yml
+++ b/docker-compose/docker-compose.yml
@@ -178,12 +178,19 @@ services:
restart: always
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
+ - prometheus_data:/prometheus
+ environment:
+ - PROMETHEUS_RETENTION_TIME=${PROMETHEUS_RETENTION_TIME:-30d}
+ healthcheck:
+ test: [ "CMD-SHELL", "wget --spider --quiet --tries=1 --timeout=10 http://localhost:9090/-/healthy || exit 1" ]
+ interval: 30s
+ timeout: 10s
+ retries: 3
profiles:
- monitoring
grafana:
image: grafana/grafana-oss:latest
- user: ""
container_name: ${GRAFANA_CONTAINER_NAME:-grafana}
depends_on:
prometheus:
@@ -196,7 +203,7 @@ services:
- grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- - GF_SERVER_DOMAIN:localhost
+ - GF_SERVER_DOMAIN=localhost
profiles:
- monitoring
@@ -223,3 +230,6 @@ services:
volumes:
grafana:
+ driver: local
+ prometheus_data:
+ driver: local