Skip to content

Get database metric history

GET/v1/databases/{uid}/metrics/history

Returns 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:

rangestep_seconds
15m15
1h60
6h300
24h900
7d3600
30d21600

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

uidstringRequired

The database's uid.

Query parameters

rangestring

Time window to return, ending now. Case-insensitive. Other values return 400 (invalid metrics range).

Default 1hOne of15m1h6h24h7d30d

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

Response

200

The metric history. vm_uid is the database's UID.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
vm_uidstringRequired

UID of the VM.

availablebooleanRequired

false when no samples exist in the range.

stalebooleanRequired

true when the newest point is more than two minutes old.

rangestringRequired

The time window returned.

One of15m1h6h24h7d30d

step_secondsintegerRequired

Seconds between points for this range.

latestanyRequired

The newest point, or null when there are none.

pointsarray of objectsRequired

Data points, oldest first.

Show item attributes
timestampstring (date-time)Required

Time of the data point.

cpu_percentnumber

CPU usage in percent. Omitted when not recorded.

memory_percentnumber

Memory usage in percent. Omitted when not recorded.

disk_percentnumber

Root filesystem usage in percent. Omitted when not recorded.

network_rx_bytesinteger

Bytes received, excluding loopback. Omitted when not recorded.

network_tx_bytesinteger

Bytes sent, excluding loopback. Omitted when not recorded.

unavailable_reasonstring

Why no data is available, for example no metrics received in range. Omitted when available.

Errors

StatusMeaning
400The range is not supported (invalid metrics range).
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
404The resource does not exist or you cannot access it.

Errors use the standard error format.