OS Manuals

/usr/bin/pgwatch

Postgres monitoring tool for Kubernetes.

From pgwatch 6.1.0-r1 (enterprise-packages), captured 2026-11-08 by running pgwatch --help (exit 0). permalink

Version info:
  Version:       6.1.0
  Config Schema: 00824
  Sink Schema:   01614
  Git Commit:    742aaf91551df5d65cce2423c32e6fd8b3cdd9cc
  Built:         2026-11-04T07:53:54Z

Usage:
  pgwatch [OPTIONS] [config | metric | source]

Sources:
  -s, --sources=                           Postgres URI, file or folder of YAML
                                           files containing info on which DBs
                                           to monitor [$PW_SOURCES]
      --refresh=                           How frequently to resync sources and
                                           metrics (default: 120) [$PW_REFRESH]
  -g, --group=                             Groups for filtering which databases
                                           to monitor. By default all are
                                           monitored [$PW_GROUP]
      --min-db-size-mb=                    Smaller size DBs will be ignored and
                                           not monitored until they reach the
                                           threshold. (default: 0)
                                           [$PW_MIN_DB_SIZE_MB]
      --max-parallel-connections-per-db=   Max parallel metric fetches per DB.
                                           Note the multiplication effect on
                                           multi-DB instances (default: 4)
                                           [$PW_MAX_PARALLEL_CONNECTIONS_PER_DB]
      --try-create-listed-exts-if-missing= Try creating the listed extensions
                                           (comma sep.) on first connect for
                                           all monitored DBs when missing. Main
                                           usage - pg_stat_statements
                                           [$PW_TRY_CREATE_LISTED_EXTS_IF_MISSI-

                                           NG]
      --create-helpers                     Create helper database objects from
                                           metric definitions
                                           [$PW_CREATE_HELPERS]

Metrics:
  -m, --metrics=                           Postgres URI or path to YAML file
                                           with metrics definitions
                                           [$PW_METRICS]
      --instance-level-cache-max-seconds=  Max allowed staleness for instance
                                           level metric data shared between DBs
                                           of an instance. Set to 0 to disable
                                           (default: 30)
                                           [$PW_INSTANCE_LEVEL_CACHE_MAX_SECOND-

                                           S]
      --emergency-pause-triggerfile=       When the file exists no metrics will
                                           be temporarily fetched (default:
                                           /tmp/pgwatch-emergency-pause)
                                           [$PW_EMERGENCY_PAUSE_TRIGGERFILE]

Sinks:
      --sink=                              URI where metrics will be stored,
                                           can be used multiple times [$PW_SINK]
      --batching-delay=                    Sink-specific batching flush delay;
                                           may be ignored by some sinks
                                           (default: 950ms) [$PW_BATCHING_DELAY]
      --partition-interval=                Time range for PostgreSQL sink time
                                           partitions. Must be a valid
                                           PostgreSQL interval. (default: 1
                                           day) [$PW_PARTITION_INTERVAL]
      --retention=                         Delete metrics older than this. Must
                                           be a valid PostgreSQL interval.
                                           (default: 14 days) [$PW_RETENTION]
      --maintenance-interval=              Run pgwatch maintenance tasks on
                                           sinks with this interval e.g.,
                                           deleting old metrics; Set to zero to
                                           disable. Must be a valid PostgreSQL
                                           interval. (default: 12 hours)
                                           [$PW_MAINTENANCE_INTERVAL]
      --real-dbname-field=                 Tag key for real database name
                                           (default: real_dbname)
                                           [$PW_REAL_DBNAME_FIELD]
      --system-identifier-field=           Tag key for system identifier value
                                           (default: sys_id)
                                           [$PW_SYSTEM_IDENTIFIER_FIELD]

Logging:
  -v, --log-level=[debug|info|error]       Verbosity level for stdout and log
                                           file (default: info)
      --log-file=                          File name to store logs
      --log-file-format=[json|text]        Format of file logs (default: json)
      --log-file-rotate                    Rotate log files
      --log-file-size=                     Maximum size in MB of the log file
                                           before it gets rotated (default: 100)
      --log-file-age=                      Number of days to retain old log
                                           files, 0 means forever (default: 0)
      --log-file-number=                   Maximum number of old log files to
                                           retain, 0 to retain all (default: 0)

WebUI:
      --web-disable=[all|ui]               Disable REST API and/or web UI
                                           [$PW_WEBDISABLE]
      --web-addr=                          TCP address in the form 'host:port'
                                           to listen on (default: :8080)
                                           [$PW_WEBADDR]
      --web-base-path=                     Base path for web UI and API
                                           endpoints (e.g., 'pgwatch' for
                                           reverse proxy setups)
                                           [$PW_WEBBASEPATH]
      --web-user=                          Admin username [$PW_WEBUSER]
      --web-password=                      Admin password [$PW_WEBPASSWORD]

Help Options:
  -h, --help                               Show this help message

Available commands:
  config  Manage configurations
  metric  Manage metrics
  source  Manage sources
Options (29)
OptionDescriptionSource
-s, --sourcesPostgres URI, file or folder of YAML files containing info on which DBs to monitor [$PW_SOURCES]help
--refreshHow frequently to resync sources and metrics (default: 120) [$PW_REFRESH]help
-g, --groupGroups for filtering which databases to monitor.help
--min-db-size-mbSmaller size DBs will be ignored and not monitored until they reach the threshold.help
--max-parallel-connections-per-dbMax parallel metric fetches per DB.help
--create-helpersCreate helper database objects from metric definitions [$PW_CREATE_HELPERS]help
-m, --metricsPostgres URI or path to YAML file with metrics definitions [$PW_METRICS]help
--instance-level-cache-max-secondsMax allowed staleness for instance level metric data shared between DBs of an instance.help
--emergency-pause-triggerfileWhen the file exists no metrics will be temporarily fetched (default: /tmp/pgwatch-emergency-pause) [$PW_EMERGENCY_PAUSE_TRIGGERFILE]help
--sinkURI where metrics will be stored, can be used multiple times [$PW_SINK]help
--batching-delaySink-specific batching flush delay;help
--partition-intervalTime range for PostgreSQL sink time partitions.help
--retentionDelete metrics older than this.help
--maintenance-intervalRun pgwatch maintenance tasks on sinks with this interval e.g., deleting old metrics;help
--real-dbname-fieldTag key for real database name (default: real_dbname) [$PW_REAL_DBNAME_FIELD]help
--system-identifier-fieldTag key for system identifier value (default: sys_id) [$PW_SYSTEM_IDENTIFIER_FIELD]help
-v, --log-level debug|info|errorVerbosity level for stdout and log file (default: info)help
--log-fileFile name to store logshelp
--log-file-format json|textFormat of file logs (default: json)help
--log-file-rotateRotate log fileshelp
--log-file-sizeMaximum size in MB of the log file before it gets rotated (default: 100)help
--log-file-ageNumber of days to retain old log files, 0 means forever (default: 0)help
--log-file-numberMaximum number of old log files to retain, 0 to retain all (default: 0)help
--web-disable all|uiDisable REST API and/or web UI [$PW_WEBDISABLE]help
--web-addrTCP address in the form 'host:port' to listen on (default: :8080) [$PW_WEBADDR]help
--web-base-pathBase path for web UI and API endpoints (e.g., 'pgwatch' for reverse proxy setups) [$PW_WEBBASEPATH]help
--web-userAdmin username [$PW_WEBUSER]help
--web-passwordAdmin password [$PW_WEBPASSWORD]help
-h, --helpShow this help messagehelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.