Skip to content

Get true lock_timeout and statement_timeout#8

Closed
NikolayS wants to merge 5 commits into
mainfrom
claude/implement-issue-61-C8E0c
Closed

Get true lock_timeout and statement_timeout#8
NikolayS wants to merge 5 commits into
mainfrom
claude/implement-issue-61-C8E0c

Conversation

@NikolayS
Copy link
Copy Markdown
Contributor

@NikolayS NikolayS commented Dec 16, 2025

pgwatch sets lock_timeout to 100ms during metric collection, which causes the monitoring to report 100ms instead of the actual configured value. This fix queries reset_val from pg_settings for lock_timeout to get the genuine configuration value.

Closes #61


Note

Ensures the settings metric reports actual configured values instead of session overrides.

  • Update metrics.yml settings SQL: use reset_val for lock_timeout/statement_timeout, derive numeric_value from the same source, and compute is_default by comparing reset_val to boot_val; description updated to document behavior
  • Add tests under tests/settings/: unit tests validating SQL fields/logic and description, plus an integration test confirming lock_timeout returns the reset (configured) value even when session overrides are applied

Written by Cursor Bugbot for commit fb693bf. Configure here.

@NikolayS NikolayS changed the title True lock_timeout Get true lock_timeout Dec 16, 2025
@NikolayS
Copy link
Copy Markdown
Contributor Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread config/pgwatch-prometheus/metrics.yml
pgwatch sets lock_timeout to 100ms during metric collection, which
causes the monitoring to report 100ms instead of the actual configured
value. This fix queries reset_val from pg_settings for lock_timeout
to get the genuine configuration value.

Closes #61
@NikolayS NikolayS force-pushed the claude/implement-issue-61-C8E0c branch from 7891edc to 7893064 Compare December 26, 2025 05:28
When pgwatch sets lock_timeout during collection, source becomes
'session', causing is_default to incorrectly report non-default.
Now we compare reset_val with boot_val to determine the true default
status for lock_timeout.
@NikolayS NikolayS changed the title Get true lock_timeout Get true lock_timeout and statement_timeout Dec 26, 2025
pgwatch sets statement_timeout per-metric during collection, which
would mask the actual configured value. Apply the same reset_val
fix as lock_timeout.
@NikolayS
Copy link
Copy Markdown
Contributor Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants