Skip to content

Get current deployment metrics

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

Returns 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

uidstringRequired

The deployment'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.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
deployment_uidstringRequired

UID of the deployment.

availablebooleanRequired

false when no sample has been received yet.

stalebooleanRequired

true when the sample is more than two minutes old.

replica_countintegerRequired

Replicas that exist.

ready_replica_countintegerRequired

Replicas that are ready.

cpu_coresnumberRequired

CPU in use, in cores.

cpu_limit_coresnumberRequired

Plan CPU limit in cores.

cpu_percentnumber

cpu_cores as a percentage of cpu_limit_cores. Omitted without a sample.

memory_bytesintegerRequired

Memory in use, in bytes.

memory_limit_bytesintegerRequired

Plan memory limit in bytes.

memory_percentnumber

Memory use as a percentage of the limit. Omitted without a sample.

network_rx_bytes_per_secnumberRequired

Inbound network rate in bytes per second.

network_tx_bytes_per_secnumberRequired

Outbound network rate in bytes per second.

storage_used_bytesinteger

Used space on persistent volumes. Omitted without volumes.

storage_capacity_bytesinteger

Capacity of persistent volumes. Omitted without volumes.

storage_percentnumber

Volume usage as a percentage. Omitted without volumes.

sampled_atstring (date-time)Required

When the sample was taken (the current time when available is false).

unavailable_reasonstring

Why metrics are unavailable, for example no metrics received yet.

Errors

StatusMeaning
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.