Get Database Metrics
Get a database’s CPU, RAM and network history with GET /v2/databases//metrics: up to 288 points over 24 hours, one every 5 minutes.
GET
Get Database Metrics
string
required
The API key for your account. You can find this in your account settings.
databases:read scope.
Returns historical CPU, RAM and network usage for a database, sampled every 5 minutes over the last 24 hours (up to 288 points), newest first. Use it to plot usage graphs or to decide whether the database needs more memory before calling Edit Database.
For a single current reading instead of a time series, use Get Database Status. Responses are cached for 2.5 minutes per user and database, and the endpoint is rate limited to 10 requests per 5 seconds per user, with a short block once that cap is hit. A database with no recent samples returns an empty array rather than an error.
Parameters
string
required
The ID of the database.
Response
string
Indicates whether the call was successful:
success if it was, error if not.array
The contents of the response.
Common errors
Related
- CLI:
squarecloud db metrics - SDKs:
api.databases.metrics()(JavaScript),client.databases.metrics()(Python),c.Databases.Metrics()(Go)

