📹 The future of AI infrastructure: optimize and shard your database with agents.Watch the talk
Navigation

Query branch metrics from the API and CLI

Branch metrics are available on the public PlanetScale API and CLI. Query time-series and current metric values for Vitess and Postgres branches, plus SQL query and tag-level metrics, Vitess tablet metrics, and table storage metrics.

Use the API with service tokens that have read_branch permission. From the CLI, pscale metrics show, instant, and report (requires pscale 0.321.0 or later) return metrics as tables, JSON, or CSV. The report command displays all relevant metrics for Vitess and Postgres database engines.

pscale metrics show <database> <branch> --org <org> --metric queries --metric latency_p99 --period 1h
pscale metrics instant <database> <branch> --org <org> --metric planetscale_volume_usage_percentage
pscale metrics report <database> <branch> --org <org> --period 1d

Metrics API docs · CLI metrics docs