Skip to content

Commit 9e611ea

Browse files
authored
feat(cloudnative-pg): Metrics for extensions updates (#541)
Updating the image can update the extensions available, but doesn't change the version installed in the database. We want to expose the info about an available update to the users. These are the same changes included in cloudnative-pg/cloudnative-pg#7195 Signed-off-by: Francesco Canovai <[email protected]>
1 parent 089bb4c commit 9e611ea

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

charts/cloudnative-pg/values.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -649,3 +649,35 @@ monitoringQueriesConfigMap:
649649
- setting:
650650
usage: "GAUGE"
651651
description: "Setting value"
652+
653+
pg_extensions:
654+
query: |
655+
SELECT
656+
current_database() as datname,
657+
name as extname,
658+
default_version,
659+
installed_version,
660+
CASE
661+
WHEN default_version = installed_version THEN 0
662+
ELSE 1
663+
END AS update_available
664+
FROM pg_catalog.pg_available_extensions
665+
WHERE installed_version IS NOT NULL
666+
metrics:
667+
- datname:
668+
usage: "LABEL"
669+
description: "Name of the database"
670+
- extname:
671+
usage: "LABEL"
672+
description: "Extension name"
673+
- default_version:
674+
usage: "LABEL"
675+
description: "Default version"
676+
- installed_version:
677+
usage: "LABEL"
678+
description: "Installed version"
679+
- update_available:
680+
usage: "GAUGE"
681+
description: "An update is available"
682+
target_databases:
683+
- '*'

0 commit comments

Comments
 (0)