Skip to content

Conversation

@zty200489
Copy link

Fixed default sql query for backend_waiting metric, where multiple locks on the same row may cause spuriously high "blocked_queries".

By adding AND blocking_locks.granted, we only consider lock pairs where the blocking lock is granted (i.e. process is using the lock) and the blocked lock is not granted (i.e. is waiting for lock). This seems more appropriate since the dashboard displays this metric as Blocked Queries, whereas the original query collects all possible potential block pairs.

Fixed `backends_waiting` metric in default monitoring queries.

Signed-off-by: Tianyuan Zhou <100499235+zty200489@users.noreply.github.com>
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Oct 8, 2025
@gbartolini gbartolini added the chart( operator ) Related to the operator (cloudnative-pg) chart label Jan 15, 2026
@gbartolini
Copy link
Contributor

gbartolini commented Jan 15, 2026

If confirmed, this should also be changed in the main cloudnative-pg project (config/manager/default-monitoring.yaml file).

@zty200489 do you mind opening an issue in cloudnativepg project and submit the PR there? Thanks.

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

Labels

bug Something isn't working chart( operator ) Related to the operator (cloudnative-pg) chart size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants