Skip to content

Get current database metrics

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

Returns the latest CPU, memory, disk and network sample for the database. The response uses the same shape as VM metrics, so the database's UID is returned in vm_uid.

If no sample has arrived yet, available is false, the metric fields are left out and unavailable_reason explains why. stale is true when the latest sample is more than two minutes old.

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.

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 latest metrics sample. 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 metrics have been received from the VM yet.

stalebooleanRequired

true when the latest sample is more than two minutes old.

cpu_percentnumber

CPU usage in percent. Omitted when unavailable.

memory_percentnumber

Memory usage in percent. Omitted when unavailable.

disk_percentnumber

Root filesystem usage in percent. Omitted when unavailable.

network_rx_bytesinteger

Bytes received across all network interfaces except loopback, as reported by the agent. Omitted when unavailable.

network_tx_bytesinteger

Bytes sent across all network interfaces except loopback, as reported by the agent. Omitted when unavailable.

sampled_atstring (date-time)Required

When the sample was taken. When available is false, this is the time of the request.

unavailable_reasonstring

Why metrics are unavailable, for example no metrics received yet. Omitted when available.

Errors

StatusMeaning
400The request was malformed or failed validation.
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.