Preview — pending review
This reference is generated from the platform API contract and is still under review. Operations, fields, and descriptions can change before publication.
Read VM metric time series for one instance (Monitoring tab)
Returns chart data for the instance's Monitoring tab: CPU %, memory % (+ page cache,
swap), per-disk read/write MB/s, IOPS and latency, per-NIC in/out Mbps, packets, errors and
drops. Samples come from the Prometheus that scrapes the compute host's libvirt exporter
(30 s scrape, 7 d retention on dev). vCPU steal/delay are deliberately not offered.
CPU % (cpu.utilization) is measured on the hypervisor from the vCPU threads' run time
divided by the vCPU count; under heavy network/interrupt load it can read higher
than the guest operating system shows. Alert rules on cpu.utilization evaluate the same
series.
A volume's disk metrics appear here, on the instance it is attached to, as the series whose
labels.volumeId is that volume's id.
Tenant isolation: the caller never sends a query. The backend resolves the instance under
the scope and builds every query from a fixed template pinned to that instance's
provider server id AND the scope's provider project id; an instance of another project is
404 NOT_FOUND exactly like the detail read.
Monitoring switched off: when monitoringEnabled is false no metric is read (and none is
billed): 200 with status: MONITORING_DISABLED and an empty metrics array. Turn it on with
PATCH .../instances/{instanceId} {monitoringEnabled: true}. An instance that has no
provider server yet answers status: NOT_PROVISIONED, also without reading anything.
Switched-off spans: Prometheus keeps samples for the retention window whatever the switch
says; samples inside the window taken while monitoring was OFF are returned with v: null
(a gap), so a customer never sees the span they turned off (and were not billed for).
Empty series: status: OK with a metric whose series is empty means the store holds no
sample for it in the window (a just-started VM, or memory.utilization on a guest without a
balloon driver — Windows needs the virtio balloon driver AND its service).
Validation: metric is required, 1–20 names from the closed InstanceMetricName
vocabulary; range is 1h|6h|24h|7d (default 1h); step, when given, is 30 seconds to
min(range, 86400) seconds and must yield at most 1500 points over the range, otherwise 422
VALIDATION_FAILED. Default steps:
60 s (1h), 120 s (6h), 300 s (24h), 1800 s (7d).
Async & state: Synchronous read; no state change.
Errors: 401; 403 without compute read access; 404 unknown/other-project instance; 422
invalid parameters; 503 PROVIDER_UNAVAILABLE when the metrics store is unreachable or not
configured (never an empty chart that would look like an idle VM); 500 INTERNAL.
Idempotency/Concurrency: Safe; no idempotency key.
bearerTokenAuthorizationBearer <token>An API token (pc_live_…) or a service-account key (sak_live_…), created in Identity & Access Management and sent as Authorization: Bearer <token>. Requests are rate limited per credential and per tenant: every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a refused request gets 429 RATE_LIMITED with Retry-After.
scopeId*stringOpaque ownership+authorization scope resolving to tenant + subscription + project.
instanceId*stringIdentifier of the compute instance.
metric*array<>One or more metric names (repeat the parameter). Each becomes one entry of metrics, in request order.
1 <= items <= 20range?stringChart window ending now.
"1h""1h""6h""24h""7d"step?integerResolution in seconds; defaults per range (60 / 120 / 300 / 1800). Must also be at most the range itself (3600 for 1h) and yield at most 1500 points, otherwise 422.
30 <= value <= 86400Metric series for the instance (or a status explaining why none were read).
application/json- response
Metric series of one instance over a window.
instanceId*stringmonitoringEnabled*booleanstatus*InstanceMetricsStatusOK — metrics were read (series may still be empty); MONITORING_DISABLED — monitoring is off for the instance, nothing was read; NOT_PROVISIONED — the instance has no provider server (or its project no provider projection) yet, nothing was read.
"OK""MONITORING_DISABLED""NOT_PROVISIONED"range*MetricRangeA chart window ending now; bounded by the metrics retention.
"1h""1h""6h""24h""7d"stepSeconds*integerstart*stringdate-timeend*stringdate-timemetrics*array<>curl -X GET "https://example.com/scopes/string/compute/instances/string/metrics?metric=cpu.utilization"{ "instanceId": "string", "monitoringEnabled": true, "status": "OK", "range": "1h", "stepSeconds": 0, "start": "2019-08-24T14:15:22Z", "end": "2019-08-24T14:15:22Z", "metrics": [ { "metric": "cpu.utilization", "unit": "percent", "series": [ { "labels": { "device": "string", "volumeId": "string", "macAddress": "string" }, "points": [ { "t": 0, "v": 0 } ] } ] } ]}