github darold/pgbadger v13.4
Version 13.4

one hour ago

2026-12-04 - v13.4

This is a maintenance release of pgBadger that fixes issues and applied patches
reported by users since last release. It also adds some new features:

  • Add time series of connections per host

    The "Connections per host" report only had a pie chart and a table of
    the total number of connections per host, it was not possible to see
    when a host was responsible of a spike of connections.

    A time series graph is added below the chart and table: the number of
    connections of each host per period (--average minutes, 5 by default).
    To reduce noise with many client hosts, only the hosts with the most
    connections are drawn, the connections of the other hosts are summed in
    an "Others" serie, so the sum of the series is the total number of
    connections. New option --top-hosts sets the number of hosts drawn,
    default 10, 0 disables the graph.
    Thanks to Andrew Jackson for the feature request.

  • Make histograms of query and session times adapt to the logged durations.
    With log_min_duration_statement = 1000 the histogram of query times only
    had 2 useful bars (1000-10000ms and > 10000ms) because of the fixed
    default inbounds.
    The default inbounds are now finer and leading and trailing empty ranges
    are not reported, so the histograms adapt to the durations found in the
    logs without any configuration.
    Options --histogram-query and --histogram-session are kept for custom
    inbounds, all their ranges are reported as before.
    Thanks to dusatvoj for the feature request.

  • Add support for Google Cloud Logging exports of AlloyDB and CloudSQL logs
    AlloyDB (and CloudSQL) PostgreSQL logs exported from Google Cloud Logging
    were not or only partially parsed:

  • Add support for the logs of Azure Database for PostgreSQL archived to a
    storage account through Diagnostic Settings (PostgreSQLLogs category,
    PT1H.json blobs in JSON Lines format, one record per line).
    Until now these logs gave an empty report and users had to convert them
    to stderr format with jq. The format is now autodetected as jsonlog. The
    message property holds the full log line with the log_line_prefix, it is
    parsed using the --prefix given at command line to extract user, database,
    client and application. The detail, hint, context and statement properties
    are attached to the message, so bind parameters are applied and error
    details reported. When no prefix is given, or it does not match,
    timestamp, processId, errorLevel and sqlerrcode properties are used.
    Thanks to Ali Akbar for the feature request.

  • Add permalink anchors to query and error entries in HTML report
    Each entry of the top queries and top errors lists already has a unique
    id on its details cell. Add a small link pointing to that id so a
    specific entry can be linked. The link is placed before the query block,
    floated to the right. Thanks to Joao Rito for the patch.

  • Report durations with 3 decimals instead of rounding to milliseconds
    Min/max/avg durations were rounded to an integer number of milliseconds
    by convert_time() because of the use of sprintf("%.3d"), so all
    sub-millisecond values were reported as 0ms. For example the average
    query duration (15000 + 696) / 300281 = 0.0522 was displayed as 0ms.
    Thanks for rus-ik for the feature request.

Fixes:

  • Use localdie() instead of die() when the value of the options
    --histogram-query and --histogram-session is invalid, the pid file was
    not removed and the next run failed with "another process is already
    started".

  • Fix autodetection of the log format with journalctl input
    With --journalctl the log format was never autodetected, without -f the
    report was empty. Thanks to Frank Lanitz and Matt Blissett for the report.

  • Fix durations lower than the first custom inbound that were counted
    in a range never reported, they are now reported in a "< first"
    range and percentages sum to 100%.

  • Query ranges now use the same human readable labels as sessions (1s-5s
    instead of 1000-5000ms), also in the "Key values" box.

  • Add openSUSE instructions to install JSON::XS. Thanks to Avinesh Kumar
    for the patch.

Don't miss a new pgbadger release

NewReleases is sending notifications on new releases.