Skip to content

Running checks#

A check's ID is its topic and name, such as storage.database_size. Find one in Checks, or with pgcue list and pgcue find.

Parameters#

Set parameters after the check ID:

$ pgcue run activity.idle_transactions --minimum-duration 30s
$ pgcue run storage.largest_tables --limit NULL

NULL removes a limit. Checks that report cumulative counters count from the last statistics reset, so compare two runs to see a rate.

Scripts and monitoring#

--output json prints one compact document per run, and one line per run with --watch:

$ pgcue run storage.database_size --database orders --output json
{"captured_at":"2026-11-22T00:35:04+01:00","check":"storage.database_size","status":"succeeded","columns":["database_name","size"],"rows":[{"database_name":"orders","size":"12 GB"}]}

status is succeeded, failed or unavailable. A succeeded check has columns and rows, and any other has an error. Use the exit status to detect failures.

To produce CSV, convert with jq:

$ pgcue run activity.connections --output json \
    | jq -r '.columns as $cols | $cols, (.rows[] | [.[$cols[]]]) | @csv'