pgbadger #1

Supports: trusty


pgBadger is a PostgreSQL log analyzer that generates detailed performance and activity reports and charts.


pgBadger is a log analyzer for PostgreSQL that generates performance and activity reports.

When connected to a PostgreSQL service, the pgBadger charm receives PostgreSQL log messages in real time and updates the reports every five minutes.

The reports themselves are web pages available directly from the unit, or proxied via another Juju service.


Deploying the pgbadger service and attaching it to a PostgreSQL service is simple:

juju deploy postgresql
juju deploy pgbadger
juju add-relation postgresql pgbadger
juju expose pgbadger

You also need to increase the amount of logging information generated by PostgreSQL or your reports will be empty. The following will enable all the pgBadger features:

juju set postgresql log_min_duration_statement=0
juju set postgresql log_checkpoints=true
juju set postgresql log_connections=true
juju set postgresql log_disconnections=true
juju set postgresql log_autovacuum_min_duration=0
juju set postgresql log_lock_waits=true

You can then browse to http:///pgbadger to view the reports as are generated and updated. If there is database activity, the initial reports should be available in 5 minutes.

Known Limitations and Issues

  • log_temp_files is not supported by the PostgreSQL charm, so temp file usage is not reported. Bug LP:1281600


  • jobs: The number of parallel tasks pgbadger uses. Set this to the number of CPUs you want to use.

Contact Information



(int) The number of parallel tasks used to generate the reports.