Skip to content

Commit 2d11aea

Browse files
committed
fix signal
1 parent b48754d commit 2d11aea

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

postgres-observ-lib/dashboards_out/postgres-overview.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postgres-observ-lib/signals/maintenance.libsonnet

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,26 @@ function(this)
1515
description: 'Ratio of tables with dead tuple ratio > 10% to total tables.',
1616
type: 'gauge',
1717
unit: 'percentunit',
18-
aggFunction: 'avg', // Use avg for ratio, not sum
1918
sources: {
2019
postgres_exporter: {
2120
expr: |||
22-
count(
21+
avg by (job, cluster, instance) (
2322
(
24-
pg_stat_user_tables_n_dead_tup{%(queriesSelector)s}
25-
/
26-
(pg_stat_user_tables_n_live_tup{%(queriesSelector)s} + pg_stat_user_tables_n_dead_tup{%(queriesSelector)s} + 1)
27-
) > 0.1
28-
) OR on() vector(0)
29-
/
30-
count(pg_stat_user_tables_n_live_tup{%(queriesSelector)s})
23+
count(
24+
(
25+
pg_stat_user_tables_n_dead_tup{%(queriesSelector)s}
26+
/
27+
(pg_stat_user_tables_n_live_tup{%(queriesSelector)s} + pg_stat_user_tables_n_dead_tup{%(queriesSelector)s} + 1)
28+
) > 0.1
29+
)
30+
OR
31+
vector(0)
32+
)
33+
/
34+
count(pg_stat_user_tables_n_live_tup{%(queriesSelector)s})
35+
)
3136
|||,
32-
legendCustomTemplate: ' Tables needing vacuum',
37+
legendCustomTemplate: 'Tables needing vacuum',
3338
},
3439
},
3540
},

0 commit comments

Comments
 (0)