Setup¶
Bring pg-logstats into the environment before the agent starts touching a
PostgreSQL incident.
The setup path has three stages:
- install the CLI
- install the agent guidance
- verify that the environment is ready for the workflow you want to run
Install¶
Today the simplest install path is:
If the investigation path needs Amazon RDS or CloudWatch input:
Homebrew packaging is an intended distribution path and should live here once it is published.
Install Agent Guidance¶
The agent should not be expected to discover the product contract on its own. Install the harness-specific guidance first.
For Codex:
Use --dry-run when you want to preview the expected file writes:
Verify Readiness¶
Before the agent starts triage, run inspect against the actual evidence
source you expect the agent to use. The result is persisted to the workspace and
required by later workflows.
Local logs:
RDS / CloudWatch:
pg-logstats inspect \
--rds-instance my-db \
--since 1h
pg-logstats query-families \
--rds-instance my-db \
--since 1h
The most common success path is log_backed_only: logs are available and live
database access is not configured. If a DSN is configured and the required
PostgreSQL probes pass, inspect reports log_backed_and_live and the reports
can include live follow-up actions. If the required evidence is missing, the
honest result is unready.
Choose A First Workflow¶
- Use
pg-logstats query-familiesfor slow queries and latency incidents. - Use
pg-logstats errorsfor repeated PostgreSQL errors, failed statements, or connection failures. - Use
pg-logstats temp-filesfor disk pressure caused by temporary file spills. - Use
pg-logstats running-queriesonly wheninspectreports live database capability.