Docs

Metrics API

Query real-time and historical database metrics.

Endpoints

text
GET /api/v1/metrics - Current metrics snapshot GET /api/v1/metrics/history - Historical metrics GET /api/v1/metrics/top-queries - Top queries by time GET /api/v1/metrics/os - OS-level metrics

Current Metrics

bash
curl -H "X-API-Key: your-api-key" \ https://api.dbabrain.ai/api/v1/metrics

Response Fields

  • -connections - current/max connection counts
  • -cacheHitRatio - buffer cache hit percentage
  • -tps - transactions per second
  • -deadTuples - total dead tuples across tables
  • -replicationLagSeconds - lag in seconds
  • -blockedSessions - count of blocked sessions
  • -walSizeBytes - WAL directory size
  • -xidWraparoundPct - XID wraparound progress percentage
  • -checkpoints - timed/requested counts and backend write pct
  • -diskIo - read/write IOPS and latency
  • -vacuumActivity - running vacuums and details
  • -topQueries - top 10 queries by total execution time