Skip to content

Add pscale metrics commands - #1345

Merged
dgraham merged 3 commits into
mainfrom
metrics-cmd
Aug 18, 2026
Merged

Add pscale metrics commands#1345
dgraham merged 3 commits into
mainfrom
metrics-cmd

Conversation

@dgraham

@dgraham dgraham commented Aug 18, 2026

Copy link
Copy Markdown
Member

Query performance metrics for a branch. Includes a comprehensive metrics report command that includes all metrics relevant to each kind of database (Vitess, PostgreSQL).

  • 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

Sample output

$ pscale metrics show <database> <branch> --org <org> --metric queries --metric latency_p99 --period 1h

  Metrics for <database>/<branch>
  Range: 2026-08-18 10:00–11:00 MDT · interval: 60s · up to 60 points/series

  METRIC        SERIES  DIMENSIONS  LATEST    MIN       AVG       MAX       TREND
  Queries       —       —           1,903     912       1,366     1,903     ▁▄█
  Latency p99   —       —           18.24 ms  7.821 ms  12.46 ms  18.24 ms  ▁▅█
  $ pscale metrics instant <database> <branch> --org <org> --metric planetscale_volume_usage_percentage

  Current metrics for <database>/<branch>

  METRIC        DIMENSIONS                    VALUE
  Volume usage  pod=postgres-0, role=primary  71.4%
  Volume usage  pod=postgres-1, role=replica  68.25%
  $ pscale metrics report <database> <branch> --org <org> --period 1d

  Metrics report for <org>/<database>/<branch>
  Range: 2026-08-17 11:00–2026-08-18 11:00 MDT · interval: 900s

  Workload, errors, and traffic control

  METRIC        SERIES  DIMENSIONS  LATEST  MIN  AVG    MAX    TREND
  Queries       —       —           1,903   912  1,366  2,104  ▁▃▅▄▆█
  Query errors  —       —           3       0    1.25   7      ▁▁▂▁▃█

  Latency and execution time

  METRIC       SERIES  DIMENSIONS  LATEST    MIN       AVG       MAX       TREND
  Latency p50  —       —           2.184 ms  1.702 ms  2.056 ms  2.831 ms  ▁▃▄█
  Latency p99  —       —           18.24 ms  7.821 ms  12.46 ms  24.19 ms  ▁▂▅█

  ...

@dgraham
dgraham requested a review from a team as a code owner August 18, 2026 20:51

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 540fff4. Configure here.

Comment thread internal/cmd/metrics/format.go
@dgraham
dgraham merged commit e3c260d into main Aug 18, 2026
4 checks passed
@dgraham
dgraham deleted the metrics-cmd branch August 18, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants