From bbbe459ee620c441e2dbac2d81bc2039cc2640b2 Mon Sep 17 00:00:00 2001 From: Benjamin Blattberg Date: Thu, 28 Aug 2025 09:07:55 -0500 Subject: [PATCH] Fix backup status query The backup status query was incorrectly changed before. This change uses the original query as a model, but simplifies the query based on the underlying metrics. Notes: - The prometheus min function takes one metric; - The last incremental backup returns the last incr, diff, or full - The last diff backup returns the last diff or full - The last full backup returns the last full This is true currently for PGO OTEL and postgres_exporter solutions. --- changelogs/fragments/481.yml | 2 ++ grafana/containers/postgresql_details.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/481.yml diff --git a/changelogs/fragments/481.yml b/changelogs/fragments/481.yml new file mode 100644 index 00000000..3f26839b --- /dev/null +++ b/changelogs/fragments/481.yml @@ -0,0 +1,2 @@ +bugfixes: + - grafana - Fixed container postgresql details dashboard query for last completed backup diff --git a/grafana/containers/postgresql_details.json b/grafana/containers/postgresql_details.json index b54f304a..d38cf826 100644 --- a/grafana/containers/postgresql_details.json +++ b/grafana/containers/postgresql_details.json @@ -151,7 +151,7 @@ "pluginVersion": "7.4.5", "targets": [ { - "expr": "min(ccp_backrest_last_incr_backup_time_since_completion_seconds{pg_cluster=\"[[cluster]]\"}, ccp_backrest_last_diff_backup_time_since_completion_seconds{pg_cluster=\"[[cluster]]\"}, ccp_backrest_last_full_backup_time_since_completion_seconds{pg_cluster=\"[[cluster]]\"})", + "expr": "min(ccp_backrest_last_incr_backup_time_since_completion_seconds{pg_cluster=\"[[cluster]]\"} or ccp_backrest_last_diff_backup_time_since_completion_seconds{pg_cluster=\"[[cluster]]\"} or ccp_backrest_last_full_backup_time_since_completion_seconds{pg_cluster=\"[[cluster]]\"}) ", "format": "time_series", "interval": "", "intervalFactor": 1,