pgwatch2
pgwatch2 copied to clipboard
PGWatch2 not returning version
Hello, I am deploying pgwatch with helm, trying to use two databases, im not sure if thats related to the problem or not. One database is the one that I want metrics from, the other is the one with the pgwatch2 db and the pgwatch2_metrics db. Everything seemed to be going fine with the deployment, except I have no data in the metrics db. The databases initialize successfully, and theres no connection issues with them. The error I'm seeing now is
2022/09/08 12:36:07 WARN main: Could not find PG version info for DB , skipping shutdown check of metric worker process for backends
this is happening for all dbs. I tracked down the query its running in the daemon code, and I see its this query
select (regexp_matches(
regexp_replace(current_setting('server_version'), '(beta|devel).*', '', 'g'),
E'\\\\d+\\\\.?\\\\d+?')
)[1]::text as ver, not pg_is_in_recovery() as is_primary
https://github.com/cybertec-postgresql/pgwatch2/blob/b27310ca3cb41828a2fca776d0485ad594cb4633/pgwatch2/metrics/test_all_metrics.py
when I run that, it returns nothing. Were running postgres version 12 in RDS. Not sure how to resolve this one. Thanks!
I dont want to sound naggy, but I was hoping to deploy this semi soon to help us monitor a production issue were having @pashagolub. This is also just a warning so perhaps its a red herring?
Same here, PG 14.4. Docker run this project and add PG via localhost:8080
Would you please show what is the result of
SELECT current_setting('server_version')
Would you please show what the result of
SELECT current_setting('server_version')
Hold on... Let me deploy over again
Would you please show what is the result of
SELECT current_setting('server_version')
14.4 (Debian 14.4-1.pgdg110+1)
Still not working

So just to be sure. Are you saying the metric is not working in the deployment or exactly test_all_metrics.py test script?
Would you please show what is the result of
SELECT current_setting('server_version')14.4 (Debian 14.4-1.pgdg110+1)
Still not working
It works after docker restart container

oh gosh. That's weird!
So, for me, the metrics not being written to the metrics DB was not related to this warning. Instead I realized that with the helm deployment, if you remove the databases key from the values.yaml file, in this section
databases:
- host: pgwatch2-postgresql
grafana_preset_metrics: remotedba
port: 5432
user: pgwatch2
password: 'pgwatch2'
dbs:
- postgres
- foo
- bar
because the config map that is responsible for creating the rows in the monitored_db's table with the connection information uses that value. So without it connections dont work. But it's hard to figure out why because, the connection will still pass the connection tests if you have the password set elsewhere.
📅 This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. ♻️ If you think there is new information allowing us to address the issue, please reopen it and provide us with updated details. 🤝 Thank you for your contributions.