Quick setup guide for testing pgtrace.
- PostgreSQL (via docker-compose or local installation)
- Rust toolchain (cargo, rustc)
- Elixir/Mix (for Phoenix server)
- Start PostgreSQL containers:
docker-compose up -d postgres-store
docker-compose up -d postgres-source # Optional, for testing agent- Run migrations:
export PGPASSWORD=postgres
# Core migrations
psql -h localhost -p 5433 -U postgres -d pgtrace_store -f store/migrations/001_init.sql
psql -h localhost -p 5433 -U postgres -d pgtrace_store -f store/migrations/002_rollup_tables.sql
psql -h localhost -p 5433 -U postgres -d pgtrace_store -f store/migrations/003_roles_grants.sql
psql -h localhost -p 5433 -U postgres -d pgtrace_store -f store/migrations/004_retention_helpers.sqlOr run all at once:
for file in store/migrations/*.sql; do
psql -h localhost -p 5433 -U postgres -d pgtrace_store -f "$file"
donecd agent
cargo build --releaseConfiguration example: agent/pgtrace-agent.yaml.example
cd cli
cargo build --releaseSet environment variable for store database:
export PGTRACE_STORE_DSN="postgres://postgres:postgres@localhost:5433/pgtrace_store"cd server
mix deps.get
mix compileUpdate database connection in server/config/config.exs if needed.
- Check database tables:
psql -h localhost -p 5433 -U postgres -d pgtrace_store -c "\dt pgtrace.*"- Run CLI doctor command:
cd cli
cargo run -- doctor- Check server health (once running):
curl http://localhost:4000/api/v1/health