Skip to content

Commit 4f06560

Browse files
committed
fix: restore WHERE filter on pg_stat_statements alongside LIMIT 50
Both layers of cardinality control: - CTE: ORDER BY total_exec_time DESC LIMIT 50 (hard cap) - Outer: WHERE calls >= 5 OR exec_time_total >= 1000 (noise filter) Root cause found: the deployed VM config was missing the WHERE filter entirely, allowing all queryids through (~30K+ series). https://claude.ai/code/session_01SzJxzZNQjDQphaHyaX3RU7
1 parent 099774a commit 4f06560

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

config/pgwatch-prometheus/metrics.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ metrics:
10371037
temp_bytes_read::int8 as temp_bytes_read,
10381038
temp_bytes_written::int8 as temp_bytes_written
10391039
from aggregated_statements
1040+
where calls >= 5 or exec_time_total >= 1000
10401041
17: |
10411042
with aggregated_statements as ( /* pgwatch_generated */
10421043
select
@@ -1085,6 +1086,7 @@ metrics:
10851086
temp_bytes_read::int8 as temp_bytes_read,
10861087
temp_bytes_written::int8 as temp_bytes_written
10871088
from aggregated_statements
1089+
where calls >= 5 or exec_time_total >= 1000
10881090
gauges:
10891091
- calls
10901092
- plans_total

0 commit comments

Comments
 (0)