fix: Get true lock_timeout and statement_timeout
pgwatch sets lock_timeout to 100ms during metric collection, which causes the monitoring to report 100ms instead of the actual configured value.
the same applies to statement_timeout.
This fix queries reset_val from pg_settings for lock_timeout and statement_timeout to get the genuine configuration value.
Closes #61 (closed)
Note
Report the actual lock_timeout by using reset_val in the settings metric and add unit/integration tests to verify it.
-
Metrics config (
config/pgwatch-prometheus/metrics.yml):-
settings: Use
reset_valinstead ofsettingforlock_timeout(documented in description) and apply the same CASE logic fornumeric_value.
-
settings: Use
-
Tests:
- Add
tests/settings/test_settings_metric.pywith unit tests ensuring the SQL/description changes and an integration test validatinglock_timeoutreturns the reset value despite session overrides.
- Add
Written by Cursor Bugbot for commit 7891edca. Configure here.
Edited by Nikolay Samokhvalov