From beea11d0fe4658ce0ebd85e49859782de5156f45 Mon Sep 17 00:00:00 2001 From: jmckulk Date: Tue, 19 Sep 2023 22:18:57 -0400 Subject: [PATCH] Update pgmonitor 4.9 Update to pull pgMonitor 4.9 queries. The new version has a specific file for the global_dbsize metric that needs to be included when generating the default queries --- Makefile | 2 +- internal/controller/postgrescluster/pgmonitor_test.go | 2 +- internal/pgmonitor/exporter.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4b9df23279..3daf1a800a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PGO_IMAGE_URL ?= https://www.crunchydata.com/products/crunchy-postgresql-for-kub PGO_IMAGE_PREFIX ?= localhost PGMONITOR_DIR ?= hack/tools/pgmonitor -PGMONITOR_VERSION ?= v4.8.1 +PGMONITOR_VERSION ?= v4.9.0 QUERIES_CONFIG_DIR ?= hack/tools/queries # Buildah's "build" used to be "bud". Use the alias to be compatible for a while. diff --git a/internal/controller/postgrescluster/pgmonitor_test.go b/internal/controller/postgrescluster/pgmonitor_test.go index 5b80f92aae..dad7b93fcf 100644 --- a/internal/controller/postgrescluster/pgmonitor_test.go +++ b/internal/controller/postgrescluster/pgmonitor_test.go @@ -548,7 +548,7 @@ func TestReconcilePGMonitorExporterStatus(t *testing.T) { podExecCalled: false, // Status was generated manually for this test case // TODO jmckulk: add code to generate status - status: v1beta1.MonitoringStatus{ExporterConfiguration: "79b86d7d69"}, + status: v1beta1.MonitoringStatus{ExporterConfiguration: "66c45b8cfd"}, statusChangedAfterReconcile: false, }} { t.Run(test.name, func(t *testing.T) { diff --git a/internal/pgmonitor/exporter.go b/internal/pgmonitor/exporter.go index 90455d8c91..5c71e0ce95 100644 --- a/internal/pgmonitor/exporter.go +++ b/internal/pgmonitor/exporter.go @@ -60,7 +60,7 @@ var DefaultValuesForQueries = map[string]string{ func GenerateDefaultExporterQueries(ctx context.Context, cluster *v1beta1.PostgresCluster) string { log := logging.FromContext(ctx) var queries string - baseQueries := []string{"backrest", "global", "per_db", "nodemx"} + baseQueries := []string{"backrest", "global", "global_dbsize", "per_db", "nodemx"} queriesConfigDir := GetQueriesConfigDir(ctx) // TODO: When we add pgbouncer support we will do something like the following: