Databases

Get database consumption metrics

Changed on

Retrieve consumption metrics including storage, compute time, and data transfer. Metrics are aggregated at the project level. Defaults to last 24 hours.

Note: Advanced metrics require an upgraded plan.

get/projects/{id}/databases/{databaseName}/stats

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    • HTTP bearer
    • or HTTP bearer

Path parameters

id, string uuid required

Project ID

databaseName, string required

Database name (unique within project, lowercase letters, numbers, and underscores only)

Query parameters

from, string date-time

Start time in RFC3339 format (e.g., "2024-01-01T00:00:00Z"). Defaults to 24 hours ago.

to, string date-time

End time in RFC3339 format (e.g., "2024-01-02T00:00:00Z"). Defaults to now.

granularity, 'hourly' | 'daily' | 'monthly'

Level of detail for metrics aggregation

Response

Successful response

DatabaseStats required
current_storage_bytes, integer required

On-disk size right now, in bytes: the database itself, plus every branch's divergence from it, plus what its backups cost to hold. This is the figure the storage allowance is enforced against. branches and backup_storage_bytes break it down.

current_storage_mb, number double required

current_storage_bytes expressed in megabytes.

branches, DatabaseBranchStorage[]

Per-branch contribution to current_storage_bytes. Empty when the database has no branches. A branch that has not diverged from its parent contributes nothing.

backup_storage_bytes, integer required

What this database's backups contribute to current_storage_bytes.

A backup taken on request is charged as a full copy of the database as it was at that moment, so two backups of a 2 GB database are 4 GB. A backup schedule is charged its first snapshot in full and each later one only for the storage it adds. Deleting a backup releases its storage immediately.

Sampled from the provider rather than measured live, so it can lag a change by a few minutes, and a backup taken seconds ago may not be costed yet. Zero on a plan without backups.

storage_bytes, integer required

Total storage used in bytes (data + WAL)

data_written_bytes, integer required

Total data written in bytes

data_transfer_bytes, integer required

Total data transferred in bytes

compute_time_seconds, number double required

Total CPU seconds consumed

active_time_seconds, number double required

Total active compute time in seconds

time_range, string

Time range of the metrics (e.g., "2024-01-01T00:00:00Z to 2024-01-02T00:00:00Z")

granularity, 'hourly' | 'daily' | 'monthly'

Granularity of the aggregated metrics

Changes

    • info

      the endpoint scheme security ProjectAccessToken was added to the API

    • breaking

      added the new path request parameter databaseName

    • breaking

      added the new path request parameter id

    21 more changes in this revision