Charmed PostgreSQL VM

Channel Revision Published Runs on
latest/stable 345 09 Nov 2023
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
latest/stable 239 09 Feb 2022
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
latest/stable 226 01 Apr 2021
Ubuntu 22.04 Ubuntu 20.04 Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
14/stable 468 11 Sep 2024
Ubuntu 22.04
14/stable 467 11 Sep 2024
Ubuntu 22.04
14/candidate 529 29 Nov 2024
Ubuntu 22.04
14/candidate 528 29 Nov 2024
Ubuntu 22.04
14/beta 529 28 Nov 2024
Ubuntu 22.04
14/beta 528 28 Nov 2024
Ubuntu 22.04
14/edge 531 29 Nov 2024
Ubuntu 22.04
14/edge 530 29 Nov 2024
Ubuntu 22.04
16/edge 527 27 Nov 2024
Ubuntu 24.04
16/edge 526 27 Nov 2024
Ubuntu 24.04
juju deploy postgresql --channel 14/edge
Show information

Platform:

Ubuntu
24.04 22.04 20.04 18.04 16.04 14.04

Alert rules

This page contains a markdown version of the alert rules described in the postgresql-operator repository. The following file(s) are the source of truth:

This documentation describes the latest alert rule expressions. See the YAML file(s) on listed above if you require an older version.

PostgresqlExporter

Alert Severity Notes
PostgresqlDown critical PostgresSQL instance is down.
If you are not upgrading or configuring cross-region async replication clusters, check for errors in the Loki logs.
PostgresqlRestarted info PostgresSQL instance has restarted.
If you are not enabling/disabling TLS or upgrading or configuring cross-region async replication clusters, check for errors in the Loki logs.
PostgresqlExporterError critical PostgresSQL instance is showing an exporter error.
There may be a buggy query in query.yaml
PostgresqlTableNotAutoVacuumed warning A PostgresSQL table in instance is not auto vacuumed.
A table has not been auto vacuumed for 7 days.Double-check your VACUUM settings.
PostgresqlTableNotAutoAnalyzed warning A PostgresSQL table in instance is not auto analyzed.
A table has not been auto analyzed for 7 days.Double-check your AUTOVACUUM ANALYZE settings.
PostgresqlTooManyConnections warning PostgresSQL instance is using > 80% of the maximum connections.
Consider checking how many connections the client application is opening, or using PgBouncer in front of the database.
PostgresqlNotEnoughConnections info PostgresSQL instance does not have enough connections.
PostgreSQL instance should have more connections (> 5).
Consider double-checking how many connections the client application is opening and/or using PgBouncer in front of the database.
PostgresqlDeadLocks warning PostgresSQL instance has dead locks.
See more details with the pg_locks view.
PostgresqlHighRollbackRate warning PostgresSQL instance has a high rollback rate instance.
The ratio of transactions being aborted compared to committed is > 2 %.
This is probably happening due to unoptimized configurations related to commit delay, connections, memory, and WAL files.
PostgresqlCommitRateLow info PostgresSQL instance has a low commit rate.
PostgresSQL seems to be processing very few transactions.
Check for long-running queries and configuration issues, like insufficient cache size.
PostgresqlLowXidConsumption info PostgresSQL instance shows low XID consumption.
PostgresSQL seems to be consuming transaction IDs very slowly.
Run ANALYZE to update the optimizer statistics, ensure that query plans are correct, and double-check your VACUUM settings.
PostgresqlHighRateStatementTimeout critical PostgresSQL instance shows a high rate of statement timeout.
Either tune statement_timeout when sending queries or use EXPLAIN ANALYZE to understand how the queries can be improved.
PostgresqlHighRateDeadlock warning PostgresSQL instance shows a high deadlock rate.
More details can be obtained through the pg_locks view.
PostgresqlUnusedReplicationSlot info PostgresSQL instance has unused replication slots.
Check if a replica is not using any of them before deleting it.
PostgresqlTooManyDeadTuples warning PostgresSQL instance has too many dead tuples.
Double-check your VACUUM settings.
PostgresqlConfigurationChanged info PostgresSQL instance configuration has changed.
PostgresSQL database configuration has changed.
PostgresqlSslCompressionActive warning PostgresSQL instance SSL compression is active.
Database connections with SSL compression are enabled.
This may add significant jitter in replication delay.Replicas should turn off SSL compression via sslcompression=0 in recovery.conf.
PostgresqlTooManyLocksAcquired warning PostgreSQL instance has acquired too many locks.
If this alert happens frequently, you may need to increase the PostgresSQL setting max_locks_per_transaction.
PostgresqlBloatIndexHigh(>80%) warning PostgreSQL instance has a high bloat index (> 80%).
An index is bloated.Consider running REINDEX INDEX CONCURRENTLY <index name>;
PostgresqlBloatTableHigh(>80%) warning PostgreSQL instance has a high bloat table (> 80%).
A table is bloated.Consider running VACUUM {{ $labels.relname }};
PostgresqlInvalidIndex critical PostgresSQL instance )= has an invalid index.
A table has an invalid index.
Consider running DROP INDEX <index name>;

PgbouncerExporter

Alert Severity Notes
PgbouncerActiveConnections warning PgBouncer instance has > 200 active connections
Consider checking the client application responsible for generating those additional connections.
PgbouncerErrors warning PgBouncer instance is logging errors.
This may be due to a a server restart or an admin typing commands at the PgBouncer console.
PgbouncerMaxConnections critical PgBouncer instance has reached max_client_conn.
Consider checking how many connections the client application is opening.

PatroniExporter

Alert Severity Notes
PatroniPostgresqlDown critical Patroni PostgreSQL instance is down.
Check for errors in the Loki logs.
PatroniHasNoLeader critical Patroni instance has no leader node.
A leader node (neither primary nor standby) cannot be found inside a cluster.
Check for errors in the Loki logs.