prometheus-postgres-exporter's query fails when PostgreSQL 14 is used
Summary
When I tried StackGres 1.0.0 with PostgreSQL 14.0, I found the following error message was periodically reported.
prometheus-postgres-exporter column "compression" does not exist
Current Behaviour
Steps to reproduce
Set up the Prometheus Stack, create distributed log server, and create StackGres Clusters using PostgreSQL 14 with Prometheus Autobind enabled. Then you can see the error message in the cluster's logs.
Expected Behaviour
Possible Solution
I guess that, this happens because "compression" column was dropped from pg_stat_ssl in PostgreSQL 14, but prometheus-postgres-exporter hasn't address that yet.
Environment
- StackGres version: 1.0.0
- Kubernetes version:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:04:39Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-21T23:01:33Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}
- Cloud provider or hardware configuration:
Relevant logs and/or screenshots
Per logs, the failed query was
SELECT pid, bits, CASE WHEN ssl THEN 1.0 ELSE 0.0 END AS active, CASE WHEN compression THEN 1.0 ELSE 0.0 END AS compression FROM pg_catalog.pg_stat_ssl