/v1/databases/{uid}/metrics/currentReturns 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
uidstringRequiredThe database's uid.
Headers
X-Workspace-SlugstringRequiredSlug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.
Response
The latest metrics sample. 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 metrics have been received from the VM yet.
stalebooleanRequiredtrue when the latest sample is more than two minutes old.
cpu_percentnumberCPU usage in percent. Omitted when unavailable.
memory_percentnumberMemory usage in percent. Omitted when unavailable.
disk_percentnumberRoot filesystem usage in percent. Omitted when unavailable.
network_rx_bytesintegerBytes received across all network interfaces except loopback, as reported by the agent. Omitted when unavailable.
network_tx_bytesintegerBytes sent across all network interfaces except loopback, as reported by the agent. Omitted when unavailable.
sampled_atstring (date-time)RequiredWhen the sample was taken. When available is false, this is the time of the request.
unavailable_reasonstringWhy metrics are unavailable, for example no metrics received yet. Omitted when available.
Errors
| Status | Meaning |
|---|---|
400 | The request was malformed or failed validation. |
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.