Get time-series metrics
Authorization
A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint:
Service Token Accesses
read_branch, delete_branch, create_branch, connect_production_branch, connect_branch
OAuth Scopes
| Resource | Scopes |
|---|---|
| Organization | read_branches |
| Database | read_branches |
| Branch | read_branch |
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
Organization name slug from list_organizations. Example: acme.
Database name slug from list_databases. Example: app-db.
Branch name from list_branches. Example: main.
Query Parameters
Metric names to retrieve
avg_parallel_workers, avg_shard_queries, block_cache_hit_ratio, blocks_dirtied, blocks_hit, blocks_read, blocks_written, connections, cpu_duration_millis, egress_bytes, egress_bytes_per_query, ingress_bytes, ingress_bytes_per_query, io_duration_millis, latency_max, latency_p50, latency_p95, latency_p99, latency_p999, max_egress_bytes, max_ingress_bytes, max_shard_queries, planetscale_dedicated_pgbouncer_cpu_usage, planetscale_dedicated_pgbouncer_current_connections, planetscale_dedicated_pgbouncer_memory_usage, planetscale_edge_bytes_received, planetscale_edge_bytes_received_rate, planetscale_edge_bytes_sent, planetscale_edge_bytes_sent_rate, planetscale_pgbouncer_current_connections, planetscale_pgbouncer_pools_client, planetscale_pgbouncer_pools_server, planetscale_pods_container_ooms, planetscale_pods_cpu_util_percentages, planetscale_pods_iops_total, planetscale_pods_mem_util_percentages, planetscale_primary_memory_active_cache_bytes, planetscale_primary_memory_inactive_cache_bytes, planetscale_primary_memory_mmap_bytes, planetscale_primary_memory_rss_bytes, planetscale_primary_pgbouncer_cpu_util_percentages, planetscale_primary_pgbouncer_mem_util_percentages, planetscale_primary_pods_cpu_util_percentages, planetscale_primary_pods_iops_total, planetscale_primary_pods_mem_util_percentages, planetscale_primary_postgres_connection_state, planetscale_primary_storage_usage, planetscale_primary_xact_commit_rate, planetscale_replica_lag_seconds, planetscale_replica_memory_active_cache_bytes, planetscale_replica_memory_inactive_cache_bytes, planetscale_replica_memory_mmap_bytes, planetscale_replica_memory_rss_bytes, planetscale_replica_pgbouncer_cpu_util_percentages, planetscale_replica_pgbouncer_current_connections, planetscale_replica_pgbouncer_mem_util_percentages, planetscale_replica_pods_cpu_util_percentages, planetscale_replica_pods_iops_total, planetscale_replica_pods_mem_util_percentages, planetscale_replica_postgres_connection_state, planetscale_replica_storage_usage_bytes, planetscale_replica_volume_usage_percentages, planetscale_replication_slot_max_wal_retained_bytes, planetscale_replication_slots_lost, planetscale_settings_max_slot_wal_keep_size_bytes, planetscale_storage_usage_bytes, planetscale_volume_usage_percentages, planetscale_wal_archiver_failed_rate, planetscale_wal_archiver_last_age_succeeded, planetscale_wal_archiver_succeeded_rate, planetscale_wal_size_bytes, queries, query_errors, rows_affected_per_query, rows_read, rows_read_per_query, rows_read_per_returned, rows_returned, rows_returned_per_query, rows_written, storage_per_table, total_duration_millis, traffic_control_throttled, traffic_control_warnings, violations, vtgate_cpu_avg_by_az, vtgate_cpu_by_az, vtgate_latency_p50, vtgate_latency_p95, vtgate_memory_avg_by_az, vtgate_memory_by_az, vtgate_requests Named time period to retrieve. Defaults to 12h.
15m, 1h, 3h, 6h, 12h, 1d, 2d, 7d, 8d Start of a custom time range as an ISO 8601 timestamp
End of a custom time range as an ISO 8601 timestamp
Number of data points to return
Filter by tablet type
primary, replica, rdonly Filter by keyspace
Filter by shard
Filter by Postgres role
Filter by container
Filter by pod
Filter by pods
Filter by query pattern IDs
Filter by query fingerprint
Filter by traffic budget ID
Filter by traffic rule ID
Filter by search terms

