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_val instead of setting for lock_timeout (documented in description) and apply the same CASE logic for numeric_value.
  • Tests:
    • Add tests/settings/test_settings_metric.py with unit tests ensuring the SQL/description changes and an integration test validating lock_timeout returns the reset value despite session overrides.

Written by Cursor Bugbot for commit 7891edca. Configure here.

#61 (closed)

Edited by Nikolay Samokhvalov

Merge request reports

Loading