Commit b858689
committed
fix: limit queryid cardinality in postgres sink and query-info scrape
The pg_stat_statements WHERE filter was applied only on the Prometheus
sink path. The postgres sink (pgss_queryid_queries) had NO LIMIT,
dumping all queryids into the sink table every 30s. The flask backend
then exported them all as pgwatch_query_info Prometheus metrics — and
the query-info scrape job had no sample_limit safety net.
This was the second, unfiltered path feeding 100K queryids into
VictoriaMetrics.
Changes:
- Add LIMIT 100 to pgss_queryid_queries (postgres sink), matching
the prometheus sink's top-100-by-exec-time cap
- Add sample_limit: 500 to the query-info scrape job in prometheus.yml
https://claude.ai/code/session_01SzJxzZNQjDQphaHyaX3RU71 parent d59cfef commit b858689
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
0 commit comments