/v1/databases/{uid}/metrics/historyReturns a time series of the database's metrics over a time range. The response uses the
same shape as VM metrics, so the database's UID is returned in vm_uid. The step between
points depends on the range:
range | step_seconds |
|---|---|
15m | 15 |
1h | 60 |
6h | 300 |
24h | 900 |
7d | 3600 |
30d | 21600 |
If no samples exist in the range, available is false and points is empty.
Authentication
Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.
Path parameters
uidstringRequiredThe database's uid.
Query parameters
rangestringTime window to return, ending now. Case-insensitive. Other values return 400 (invalid metrics range).
Default 1hOne of15m1h6h24h7d30d
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Response
The metric history. vm_uid is the database's UID.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
vm_uidstringRequiredUID of the VM.
availablebooleanRequiredfalse when no samples exist in the range.
stalebooleanRequiredtrue when the newest point is more than two minutes old.
rangestringRequiredThe time window returned.
One of15m1h6h24h7d30d
step_secondsintegerRequiredSeconds between points for this range.
latestanyRequiredThe newest point, or null when there are none.
pointsarray of objectsRequiredData points, oldest first.
Show item attributesHide item attributes
timestampstring (date-time)RequiredTime of the data point.
cpu_percentnumberCPU usage in percent. Omitted when not recorded.
memory_percentnumberMemory usage in percent. Omitted when not recorded.
disk_percentnumberRoot filesystem usage in percent. Omitted when not recorded.
network_rx_bytesintegerBytes received, excluding loopback. Omitted when not recorded.
network_tx_bytesintegerBytes sent, excluding loopback. Omitted when not recorded.
unavailable_reasonstringWhy no data is available, for example no metrics received in range. Omitted when available.
Errors
| Status | Meaning |
|---|---|
400 | The range is not supported (invalid metrics range). |
401 | The API key is missing, invalid, expired or revoked. |
403 | You cannot access the workspace, your role does not allow this action, or the account is suspended. |
404 | The resource does not exist or you cannot access it. |
Errors use the standard error format.