/v1/deployments/{uid}/metrics/currentReturns the latest resource sample for the deployment: replicas, CPU, memory, network and volume usage, summed across replicas. Percentages are relative to the plan's limits.
If no sample has been received yet, available is false, unavailable_reason explains
why, and only the limits are filled in. 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 deployment'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.
successbooleanRequiredtrue when the request succeeded.
messagestringRequiredHuman-readable status message.
dataobjectShow attributesHide attributes
deployment_uidstringRequiredUID of the deployment.
availablebooleanRequiredfalse when no sample has been received yet.
stalebooleanRequiredtrue when the sample is more than two minutes old.
replica_countintegerRequiredReplicas that exist.
ready_replica_countintegerRequiredReplicas that are ready.
cpu_coresnumberRequiredCPU in use, in cores.
cpu_limit_coresnumberRequiredPlan CPU limit in cores.
cpu_percentnumbercpu_cores as a percentage of cpu_limit_cores. Omitted without a sample.
memory_bytesintegerRequiredMemory in use, in bytes.
memory_limit_bytesintegerRequiredPlan memory limit in bytes.
memory_percentnumberMemory use as a percentage of the limit. Omitted without a sample.
network_rx_bytes_per_secnumberRequiredInbound network rate in bytes per second.
network_tx_bytes_per_secnumberRequiredOutbound network rate in bytes per second.
storage_used_bytesintegerUsed space on persistent volumes. Omitted without volumes.
storage_capacity_bytesintegerCapacity of persistent volumes. Omitted without volumes.
storage_percentnumberVolume usage as a percentage. Omitted without volumes.
sampled_atstring (date-time)RequiredWhen the sample was taken (the current time when available is false).
unavailable_reasonstringWhy metrics are unavailable, for example no metrics received yet.
Errors
| Status | Meaning |
|---|---|
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.