For PostgreSQL engineers

Your client runs one command. You get the full picture.

pg-probe records PostgreSQL and Linux host metrics into one file. Open it in a local console, or print a report your client can read.

How it works

Capture there. Review here.

ssh db-prod-01
postgres@db-prod-01:~$ pg-probe capture -h 127.0.0.1 -U postgres --duration 3m --interval 5s
pg-probe0.4.0 Capture · 3m every 5s
Progress
Samples37
Elapsed3m00s of 3m00s
Statusdone
Artifact./db-prod-01-2026-10-24-19h37m27s.sqlite.gz 534.0 KiB
Collectors
okunsuperrors
Snapshot5010
Linux1300each sample
PostgreSQL1300each sample
ok and unsup: last sample · errors: all samples
Cost
Sample time86.0ms last · p95 552.4ms · p99 1.3s · 36 samples
CPU0.54% sampling · 0.56% overall
Memory7.5 MiB peak resident
Disk writes128.2 MiB
DONE! Capture finished
postgres@db-prod-01:~$

The output is one file in the current directory. Nothing leaves the server.

The printed report

A report your client can read.

Print the whole session to PDF from the console: 39 charts of the host and the database, from CPU and disks to locks and WAL. Each chart gets its own page, with what it measures and how to read it.

  • Cover and contents, linked to every chart
  • "What to look for" on each page, written for a reader who does not know the metric
  • Sources that were not available listed after the cover, never drawn as zero
Open the sample report PDF, 47 pages, in a new tab.

In English, Portuguese, or Spanish, whichever your client reads.

Report cover
A report page: lock requests waiting, with a What to look for box above the chart
The console

Built for reading a session.

Click a chart to pin one moment, or drag to select a range. Every chart and every legend follows.

Transactions per second 2.6 tps
14:5715:04:3415:10
Lock requests waiting, by type 32 26 transactionid, 6 tuple
14:5715:04:3415:10
CPU busy 3.4% of the host
14:5715:04:3415:10

From the demo capture: pinned at 15:04:34 UTC, transactions fell to 2.6 per second while 32 lock requests waited, and the CPU was 3.4% busy.

Percentiles, not averages

Every legend shows p50, p75, p95, p99, and the current value.

Rates from samples

--duration and --interval record how counters change. A counter reset is a gap, never a value.

Your own SQL

The artifact is plain SQLite. Open it with sqlite3 when the console is not enough.

MCP

Analysis with AI.

Connect pg-probe to Claude Code, Codex, Cursor, or any tool that speaks MCP. Ask in plain language: the AI reads the snapshots with read-only access, writes the SQL on the internal tables for you, and cites the table and value behind each answer.

Ask your agent

Install pg-probe and add its MCP server by following https://pg-probe.dev/llms.txt. My snapshots are in ~/snapshots, but I may point to another folder in each session.

The agent reads llms.txt and sets itself up. To set it up by hand in the terminal: claude mcp add pg-probe -- pg-probe mcp.

  • Knows the schema: the unit, the source, and what each error code means.
  • Read-only SQL: up to 1,000 rows, with percentile() for p95 and p99, or every row in a CSV.
  • Runs on your laptop: never connects to PostgreSQL. What the AI reads goes to the model it uses.

Why did transactions per second drop around 15:04 UTC?

  1. list_snapshots
  2. describe_schema
  3. query postgres_database_stats
  4. query postgres_activity_aggregates
  5. describe_schema postgres_activity_aggregates
  6. describe_schema postgres_lock_aggregates
  7. query postgres_activity_aggregates
  8. query postgres_lock_aggregates

TPS fell because of row-lock contention.

  • The drop: the commit+rollback rate in postgres_database_stats went from about 5,600/s at 15:03:24 to 2.6/s at 15:03:39.
  • Who waited: 32 client backends were active with wait_event_type = Lock, on tuple ExclusiveLock and transactionid ShareLock (postgres_lock_aggregates).
  • Likely holder: one client backend was active with wait_event_type = Timeout and max_age_seconds 14 to 15. It was sleeping inside a transaction. This is an inference.
  • Not recorded: the artifact keeps no PIDs or query text, so it cannot name the session or statement.

A real answer from Claude Code on the demo capture, shortened, with the tool calls it made.

For your client's security team

No agent. No account. No upload.

Your client does not install a monitoring stack, and you do not need access to their server.

Read-only session

One connection with default_transaction_read_only=on and a statement timeout.

Strict allowlist

No credentials, environment variables, command lines, or network identifiers in the file.

Inspectable

Your client can open the file before sending it. Nothing leaves the server on its own.

Also in the binary

What is the database doing right now?

$ pg-probe top

See the queries running now, longest first, and what each one waits on. It works with PostgreSQL 9.3 and newer.

  pg-probe  0.6.0  PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres   20:44:28 · every 2 s
                                                                                                                       
   Sessions  16/200 · ● 13 active · ○ 0 idle · ● 3 idle in txn · ● 0 aborted · ● 0 waiting                             
   Host      load 25.77 · mem 32.2 GiB/62.7 GiB avail · swap 18.2 GiB used                                             
                                                                                                                       
  1 Running 16  2 Waiting 0  3 Blocking  4 Vacuum  5 Settings  6 Log
                                                                                                                       
   PID     Database   User        CPU%     Read/s    Write/s IOW State           Time Waiting   Query
   119     postgres   postgres    67.3        0 B    3.3 MiB  N  active         0.726           SELECT r.aid, r.abalan…
   121     postgres   postgres    64.3        0 B    3.2 MiB  N  active         0.498           SELECT r.aid, r.abalan…
   124     postgres   postgres    58.8        0 B    2.8 MiB  N  active         0.417 Timeout:… SELECT r.aid, r.abalan…
   125     postgres   postgres    51.3        0 B  745.4 KiB  N  active         0.369           SELECT r.aid, r.abalan…
   126     postgres   postgres    58.8        0 B    2.7 MiB  N  active         0.316 LWLock:B… SELECT r.aid, r.abalan…
   123     postgres   postgres    55.3        0 B    1.8 MiB  N  active         0.309 LWLock:B… SELECT r.aid, r.abalan…
   122     postgres   postgres    56.8        0 B  996.6 KiB  N  active         0.106 LWLock:B… SELECT r.aid, r.abalan…
   120     postgres   postgres    52.3        0 B  881.0 KiB  N  active         0.070 IO:DataF… SELECT r.aid, r.abalan…
   148     postgres   postgres    23.4        0 B    4.8 MiB  N  idle in t…     0.001           UPDATE pgbench_branche…
   149     postgres   postgres    23.9        0 B    4.7 MiB  N  active         0.000 LWLock:B… UPDATE pgbench_account…
   142     postgres   postgres    25.9        0 B    5.5 MiB  N  active         0.000           UPDATE pgbench_branche…
   147     postgres   postgres    24.9        0 B    5.2 MiB  N  active         0.000           UPDATE pgbench_branche…
   146     postgres   postgres    25.9        0 B    5.2 MiB  N  idle in t…     0.000 Client:C… INSERT INTO pgbench_hi…
   144     postgres   postgres    24.9        0 B    5.2 MiB  N  idle in t…     0.000           BEGIN;
   143     postgres   postgres    25.4        0 B    5.2 MiB  N  active         0.000           UPDATE pgbench_branche…
   145     postgres   postgres    25.9        0 B    5.4 MiB  N  active         0.000           BEGIN;
·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·

·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·

·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·

·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·

·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·   ·

 1-6 view • ↑↓ move • enter details • tab preview • g group • space pause • ? help • q quit
Running

Every client backend that is not idle, longest first. On the database host, also its CPU, I/O, and I/O wait from /proc.

Install

Runs on the servers your clients have.

9.3 and newerPostgreSQL versions
EL7 and newerRHEL, CentOS, Rocky. rpm, tested on Rocky Linux 9
Ubuntu 18.04 and newerdeb, tested on Ubuntu 24.04
x86_64 · arm64static binary, no dependencies
$ curl -fsSL https://pg-probe.dev/install.sh | sh

On a Mac, the console, pg-probe top and the MCP server run too, on Apple Silicon and Intel. Host metrics come from the Linux server.

$ brew install momoi-labs/packages/pg-probe
Download for Linux deb, rpm, or a static binary, with no dependencies.

Open source under the PostgreSQL License. The capture, the console, and the report ship in the same binary.