From ee9c089f8b0c95b5f398975b41efe7ab9285091b Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 21 Oct 2023 15:07:49 +0100 Subject: [PATCH] Make prometheus backup service fail on error --- cookbooks/prometheus/templates/default/backup-data.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cookbooks/prometheus/templates/default/backup-data.erb b/cookbooks/prometheus/templates/default/backup-data.erb index a7a1c5725..93786a1ad 100644 --- a/cookbooks/prometheus/templates/default/backup-data.erb +++ b/cookbooks/prometheus/templates/default/backup-data.erb @@ -2,6 +2,8 @@ # DO NOT EDIT - This file is being maintained by Chef +set -e + SNAPSHOT=$(curl -s -XPOST http://localhost:9090/prometheus/api/v1/admin/tsdb/snapshot | jq -r .data.name) /opt/awscli/v2/current/bin/aws --profile osm-prometheus-data-upload s3 sync --storage-class=INTELLIGENT_TIERING --no-progress /var/lib/prometheus/metrics2/snapshots/${SNAPSHOT} s3://openstreetmap-prometheus-data -- 2.39.5