Postgresql high rollback rate warning
>>>
sum by (namespace,datname) ((
rate
(
pg_stat_database_xact_rollback
{datname!~"template.*|postgres",datid!="0"}[3m])) / ((
rate
(
pg_stat_database_xact_rollback
{datname!~"template.*|postgres",datid!="0"}[3m])) + (
rate
(
pg_stat_database_xact_commit
{datname!~"template.*|postgres",datid!="0"}[3m])))) > 0.02
The query computes, for each (namespace, datname) pair, the 3‑minute rate of rolled‑back transactions divided by the sum of rolled‑back and committed transaction rates (excluding template and postgres databases). The alert triggers when this rollback‑to‑total transaction ratio exceeds 2 % for any database, indicating a high abort rate.
Exporters Used
Related Alerts
PostgreSQLCacheHitRatio
PostgreSQLDown
PostgreSQLHighConnections
PostgreSQLMaxConnectionsReached
PostgreSQLQPS
PostgreSQLSlowQueries
Postgresql SSL compression active
Postgresql bloat index high (> 80%)
Postgresql bloat table high (> 80%)
Postgresql commit rate low
Postgresql configuration changed
Postgresql dead locks
Postgresql down
Postgresql exporter error
Postgresql high rate deadlock
Postgresql high rate statement timeout
Postgresql invalid index
Postgresql low XID consumption
Postgresql not enough connections
Postgresql replication lag
Postgresql restarted
Postgresql table not auto analyzed
Postgresql table not auto vacuumed
Postgresql too many connections
Postgresql too many dead tuples
Postgresql too many locks acquired
Postgresql unused replication slot