Tu cliente ejecuta un comando. Tú tienes una visión completa.
pg-probe registra las métricas de PostgreSQL y del host Linux en un solo fichero. Ábrelo en una consola local, o imprime un informe que tu cliente pueda leer.
Captura allí. Análisis aquí.
El resultado es un fichero en el directorio actual. Nada sale del servidor.
Te envío la captura de la lentitud de esta mañana.
db-prod-01-2026-10-24-19h37m27s.sqlite.gz534 KiB No es un paso de pg-probe. Tu cliente envía el fichero como envía cualquier fichero: correo, ticket o carpeta compartida. pg-probe no sube nada.
you@laptop:~$ pg-probe analyze -d ~/clients/acme pg-probe: review console listening on http://127.0.0.1:3080/console/
Abre la dirección en el navegador. La consola lee el mismo fichero, en tu máquina.
Un informe que tu cliente puede leer.
Imprime toda la sesión en PDF desde la consola: 39 gráficos del host y de la base de datos, de la CPU y los discos a los bloqueos y el WAL. Cada gráfico tiene su propia página, con lo que mide y cómo leerlo.
- Portada e índice, con enlace a cada gráfico
- "Qué observar" en cada página, escrito para quien no conoce la métrica
- Fuentes que no estaban disponibles enumeradas tras la portada, nunca representadas como cero
En español, inglés o portugués, en el idioma que lea tu cliente.
Hecha para leer una sesión.
Haz clic en un gráfico para fijar un momento, o arrastra para seleccionar un intervalo. Todos los gráficos y leyendas lo siguen.
En la captura de demostración, en el instante fijado de las 15:04:34 UTC, la tasa de transacciones cayó a 2,6 por segundo, con 32 solicitudes de bloqueo en espera y un uso de CPU del 3,4%.
Percentiles, no medias
Cada leyenda muestra p50, p75, p95, p99 y el valor actual.
Tasas a partir de las muestras
--duration e --interval registran cómo cambian los contadores. Un reinicio de contador es un hueco, nunca un valor.
Tu propio SQL
El artefacto es una base de datos SQLite. Ábrelo con sqlite3 cuando la consola no baste.
Análisis con IA.
Conecta pg-probe a Claude Code, Codex, Cursor o cualquier herramienta con MCP. Pregunta en lenguaje natural: la IA consulta los snapshots con acceso de solo lectura, escribe el SQL sobre las tablas internas por ti y cita la tabla y el valor detrás de cada respuesta.
Pídeselo a tu agente
Instala pg-probe y añade su servidor MCP siguiendo https://pg-probe.dev/llms.txt. Mis snapshots están en ~/snapshots, pero puedo indicar otra carpeta en cada sesión. El agente lee llms.txt y se configura solo. Si prefieres configurarlo a mano en la terminal: claude mcp add pg-probe -- pg-probe mcp.
- Conoce el esquema: la unidad, el origen y el significado de cada código de error.
- SQL de solo lectura: hasta 1.000 filas, con
percentile()para p95 y p99, o todo en un CSV. - Se ejecuta en tu portátil: nunca se conecta a PostgreSQL. Lo que lee la IA va al modelo que usa.
¿Por qué cayeron las transacciones por segundo hacia las 15:04 UTC?
- list_snapshots
- describe_schema
- query postgres_database_stats
- query postgres_activity_aggregates
- describe_schema postgres_activity_aggregates
- describe_schema postgres_lock_aggregates
- query postgres_activity_aggregates
- query postgres_lock_aggregates
El TPS cayó por contención de bloqueos de fila.
- La caída: la tasa de commit+rollback en
postgres_database_statspasó de unas 5.600/s a las 15:03:24 a 2,6/s a las 15:03:39. - Quién esperó: 32 client backends estaban
activeconwait_event_type = Lock, entupleExclusiveLock ytransactionidShareLock (postgres_lock_aggregates). - Probable titular: un client backend estaba
activeconwait_event_type = Timeoutymax_age_secondsde 14 a 15. Dormía dentro de una transacción. Esto es una inferencia. - No registrado: el artefacto no guarda PIDs ni texto de consultas, así que no puede nombrar la sesión ni la sentencia.
Una respuesta real de Claude Code sobre la captura de demostración, resumida y traducida, con las llamadas a herramientas que hizo.
Sin agente. Sin cuenta. Sin subidas.
Tu cliente no instala una plataforma de monitorización, y tú no necesitas acceso a su servidor.
Sesión de solo lectura
Una conexión con default_transaction_read_only=on y un statement timeout.
Lista de permitidos estricta
Ni credenciales, ni variables de entorno, ni líneas de comando, ni identificadores de red en el fichero.
Inspeccionable
Tu cliente puede abrir el fichero antes de enviarlo. Nada sale del servidor por sí solo.
¿Qué está haciendo la base de datos ahora?
$ pg-probe top Mira las consultas que se ejecutan ahora, de la más larga a la más corta, y qué espera cada una. Funciona desde PostgreSQL 9.3.
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
pg-probe 0.6.0 PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres 20:44:54 · every 2 s Sessions 17/200 · ● 17 active · ○ 0 idle · ● 0 idle in txn · ● 0 aborted · ● 8 waiting Host load 31.93 · mem 32.0 GiB/62.7 GiB avail · swap 18.2 GiB used 1 Running 17 2 Waiting 8 3 Blocking 4 Vacuum 5 Settings 6 Log PID Database User CPU% Read/s Write/s IOW State Time Waiting Query 147 postgres postgres 0.0 0 B 0 B N active 9.588 Lock:tra… UPDATE pgbench_branche… 146 postgres postgres 0.0 0 B 0 B N active 9.588 Lock:tra… UPDATE pgbench_branche… 143 postgres postgres 0.0 0 B 0 B N active 9.588 Lock:tra… UPDATE pgbench_branche… 144 postgres postgres 0.0 0 B 0 B N active 9.588 Lock:tra… UPDATE pgbench_branche… 145 postgres postgres 0.0 0 B 0 B N active 9.588 Lock:tra… UPDATE pgbench_branche… 149 postgres postgres 0.0 0 B 0 B N active 9.588 Lock:tra… UPDATE pgbench_branche… 142 postgres postgres 0.0 0 B 0 B N active 9.588 Lock:tra… UPDATE pgbench_branche… 148 postgres postgres 0.0 0 B 0 B N active 9.588 Lock:tup… UPDATE pgbench_branche… · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 1-6 view • ↑↓ move • enter details • tab preview • g group • space pause • ? help • q quit
pg-probe 0.6.0 PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres 20:44:57 · every 2 s Sessions 17/200 · ● 17 active · ○ 0 idle · ● 0 idle in txn · ● 0 aborted · ● 8 waiting Host load 31.93 · mem 32.1 GiB/62.7 GiB avail · swap 18.2 GiB used 1 Running 17 2 Waiting 8 3 Blocking 2 4 Vacuum 5 Settings 6 Log PID Database User CPU% Read/s Write/s IOW State Time Blocks Query 142 postgres postgres 0.0 0 B 0 B N active 12.653 148 UPDATE pgbench_branche… 569 postgres postgres 0.0 0 B 0 B N active 12.651 142,143,… SELECT pg_sleep(30) · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 1-6 view • ↑↓ move • enter details • tab preview • g group • space pause • ? help • q quit
pg-probe 0.6.0 PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres 20:45:32 · every 2 s Sessions 17/200 · ● 17 active · ○ 0 idle · ● 0 idle in txn · ● 0 aborted · ● 0 waiting Host load 26.15 · mem 32.1 GiB/62.7 GiB avail · swap 18.2 GiB used 1 Running 17 2 Waiting 0 3 Blocking 4 Vacuum 1 5 Settings 6 Log Members 0.0% used · autovacuum aggressive from 50% · writes stop at 100% Past a freeze limit 0 · read 20:45:27, every 30 s No table is past autovacuum_freeze_max_age or autovacuum_multixact_freeze_max_age. Running now 1 PID Databa… Table Type Phase CPU% Read/s Write/s Scann… IDX Time Waiti… Query 1276 postgr… audit_… manual scanni… 0.0 0 B 31.9 KiB 0.7% 0 8.175 IO:Da… VACUUM (DISABLE_PAGE_S… · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 1-6 view • ↑↓ move • enter details • tab preview • g group • space pause • ? help • q quit
pg-probe 0.6.0 PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres 20:45:34 · every 2 s Sessions 17/200 · ● 14 active · ○ 0 idle · ● 3 idle in txn · ● 0 aborted · ● 0 waiting Host load 28.06 · mem 32.1 GiB/62.7 GiB avail · swap 18.2 GiB used 1 Running 17 2 Waiting 0 3 Blocking 4 Vacuum 5 Settings 14 of 385 6 Log Name Value Default Client Connection Defaults / Locale and Formatting 6 of 12 default_text_search_config ● default_text_search_config pg_catalog.e… pg_catalog.s… Sets default text search configuration. ● lc_messages en_US.utf8 '' ● lc_monetary en_US.utf8 C Value pg_catalog.english ● lc_numeric en_US.utf8 C Default pg_catalog.simple ● lc_time en_US.utf8 C Source configuration file ● TimeZone Etc/UTC GMT File /var/lib/postgresql/data/postgresq l.conf:767 Connections and Authentication / Connection Settings 2 of 10 Context user Applies in the session ● listen_addresses * localhost Pending no ● max_connections 200 100 Reporting and Logging / What to Log 2 of 21 ● log_temp_files 0 -1 ● log_timezone Etc/UTC GMT Reporting and Logging / Where to Log 2 of 13 ● log_destination csvlog stderr ● logging_collector on off Statistics / Cumulative Query and Index Statistics 1 of 7 1-6 view • ↑↓ move • / search • d changed • p pending • r reload • esc clear • ? help • q quit
pg-probe 0.6.0 PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres 20:45:53 · every 2 s Sessions 17/200 · ● 17 active · ○ 0 idle · ● 0 idle in txn · ● 0 aborted · ● 0 waiting Host load 28.49 · mem 31.7 GiB/62.7 GiB avail · swap 18.2 GiB used 1 Running 17 2 Waiting 0 3 Blocking 4 Vacuum 5 Settings 14 of 385 6 Log Log /var/lib/postgresql/data/log/postgresql-2026-11-13_204342.csv · following · 5.2 MiB read 12 errors since top started at 20:44:20 · 3 distinct · 12 in the last 5 min Time PID Code Message 20:45:36 1346 23505 duplicate key value violates unique const… Errors by user, database and error top 3… 20:45:36 1346 42P01 relation "order_items" does not exist 20:45:36 1346 22012 division by zero Count Last 5m Last User@database 20:45:36 1353 23505 duplicate key value violates unique const… 4 4 20:45:36 postgres@pos… 20:45:36 1353 42P01 relation "order_items" does not exist division_by_zero division by zero 20:45:36 1353 22012 division by zero 4 4 20:45:36 postgres@pos… 20:45:36 1361 23505 duplicate key value violates unique const… unique_violation duplicate key value vi 20:45:36 1361 42P01 relation "order_items" does not exist 4 4 20:45:36 postgres@pos… 20:45:36 1361 22012 division by zero undefined_table relation "order_items" 20:45:36 1372 23505 duplicate key value violates unique const… 20:45:36 1372 42P01 relation "order_items" does not exist 20:45:36 1372 22012 division by zero · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 1-6 view • e errors • t temp files • c checkpoints • ↑↓ move • ←→ resize • enter details • ? help • q quit
pg-probe 0.6.0 PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres ‖ paused · 20:44:28 PID 119 postgres · postgres · active · 0.726 Session Database postgres User postgres Application pgbench Client local socket Backend type client backend State active Waiting Timing Connection age 11.194 (since 2026-11-13 20:44:19) Transaction age 0.096 (since 2026-11-13 20:44:31) Query duration 0.096 In this state 0.096 xid / xmin — / 55377 Resources CPU 67.3% now · 4.920 total Memory 4.3 MiB private · 149.4 MiB resident (includes shared buffers) I/O now read 0 B/s · write 3.3 MiB/s I/O total read 0 B · write 24.7 MiB I/O wait no Query SELECT r.aid, ↑↓ scroll • f functions • e explain • space paused • esc back
pg-probe 0.6.0 PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres ‖ paused · 20:44:28 PID 119 postgres · postgres · active · 0.726 Sessi Explain in postgres Dat Use Estimated plan (EXPLAIN without ANALYZE). The query was not run, and the plan may differ from the one App the backend is running. Cli Bac Function Scan on branch_report r (cost=0.25..10.25 rows=1000 width=16) Sta Wai Timin Con Tra Que In xid Resou CPU Mem I/O I/O I/O Query ↑↓ scroll • esc back SELECT r.aid, ↑↓ scroll • esc back
pg-probe 0.6.0 PostgreSQL 17.11 (Debian 17.11-1.pgdg13+2) · postgres@127.0.0.1:5432/postgres ‖ paused · 20:44:28 PID 119 postgres · postgres · active · 0.726 Sessi Function in postgres Dat Use public.branch_report App Cli Arguments p_bid integer Bac Returns TABLE(aid integer, abalance integer, history_rows bigint) Sta Language plpgsql Wai Volatility VOLATILE Security invoker Timin Owner postgres Cost / rows 100 / 1000 Con Tra Calls 271 Que Total time 2:19 (self 2:19, the rest in queries it runs) In Mean time 0.517 xid Source Resou 1 BEGIN CPU 2 RETURN QUERY Mem 3 SELECT a.aid, a.abalance, count(h.*) I/O 4 FROM pgbench_accounts a I/O 5 LEFT JOIN pgbench_history h ON h.aid = a.aid I/O 6 WHERE a.bid = p_bid Query ↑↓ scroll • esc back SELECT r.aid, ↑↓ scroll • esc back
Todos los backends de clientes que no están inactivos, de mayor a menor tiempo de ejecución. En el host de la base de datos, también su CPU, I/O y espera de I/O, leídas de /proc.
Los backends que esperan un bloqueo, y el bloqueo que espera cada uno.
Quién tiene el bloqueo, con la cola detrás de cada uno en forma de árbol.
Cada autovacuum y vacuum manual. Desde PostgreSQL 9.6, también su fase y cuánto de la tabla ha recorrido.
Todas las filas de pg_settings por categoría, con el valor predeterminado, el origen y cuándo se aplica un valor nuevo. d deja solo lo que difiere del predeterminado.
El csvlog del servidor a medida que crece, en el host de la base de datos. e, t y c dejan solo los errores, los archivos temporales o los checkpoints, con un resumen de cada uno desde que top inició.
Un backend: la consulta completa y todos los tiempos transcurridos. En el host de la base de datos, también su CPU, memoria e I/O.
El plan estimado. EXPLAIN sin ANALYZE, así que la consulta no vuelve a ejecutarse.
La función plpgsql a la que llama: firma, estadísticas de llamadas y código fuente.
Funciona en los servidores que tienen tus clientes.
$ curl -fsSL https://pg-probe.dev/install.sh | sh En un Mac también funcionan la consola, pg-probe top y el servidor MCP, en Apple Silicon e Intel. Las métricas del host vienen del servidor Linux.
$ brew install momoi-labs/packages/pg-probe Código abierto bajo la PostgreSQL License. La captura, la consola y el informe vienen en el mismo binario.