Metrics and telemetry ›
Get sandbox metrics
GET
/v1/sandboxes/{id}/metricsWhat one sandbox read between two moments: CPU, memory, disk and network.
RequestTypeScript
- import { Agental } from "agental-sdk";
- const agental = new Agental();
- const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
- const metrics = await sandbox.metrics();
Answer200 OK · SandboxMetrics
- {
- "sandboxId": string,
- "since": string,
- "until": string,
- "stepSeconds": integer,
- "keptDays": integer,
- "points": [{
- "at": string,
- "cpuUtilization": number | null,
- "memoryUsedBytes": number | null,
- "memoryTotalBytes": number | null,
- "diskUsedBytes": number | null,
- "diskTotalBytes": number | null,
- … 4 more
- }],
- "complete": boolean,
- }
What one sandbox read between two moments: CPU, memory, disk and network, oldest first.
Path
idrequiredstring | e.g. "sbx_0123456789abcdef" |
Query
sincestring | Read from this moment. An hour before until when omitted. Readings are kept 15 days. e.g. "2026-10-14T15:00:00Z" |
untilstring | Read up to this moment. Now when omitted, and never later than now. |
stepSecondsinteger | Seconds between two points, 60 at the least, which is how often a sandbox is read. When omitted, a step that gives about 360 points. e.g. 60 |
Headers
AuthorizationrequiredBearer key | An API key that may make this call. |
Returns
200 What one sandbox read between two moments: CPU, memory, disk and network, oldest first. There is no point for a moment it was stopped at, and none from before it was made. Nothing is asked of the sandbox itself, and nothing has to be installed in it.
SandboxMetrics7 fields
sandboxIdstring
sincestring
untilstring
stepSecondsinteger
keptDaysinteger
How long a reading is kept, in days.
pointsMetricsReading[]10 fields
atstring
The moment of the reading.
cpuUtilizationnumbernull
The share of the sandbox's CPUs' time that was not idle, 0 to 1.
More
Null when the server had no such figure then.memoryUsedBytesnumbernull
Memory in use, as the sandbox counts it: what it has less what is available.
More
Null when the server had no such figure then.memoryTotalBytesnumbernull
The memory the sandbox has.
More
Null when the server had no such figure then.diskUsedBytesnumbernull
What of the root disk cannot be written to: its size less what is available.
More
Null when the server had no such figure then.diskTotalBytesnumbernull
The size of the root disk.
More
Null when the server had no such figure then.networkReceivedBytesPerSecondnumbernull
Bytes a second received from the network.
More
Null when the server had no such figure then.networkSentBytesPerSecondnumbernull
Bytes a second sent to the network.
More
Null when the server had no such figure then.diskReadBytesPerSecondnumbernull
Bytes a second read from disk.
More
Null when the server had no such figure then.diskWrittenBytesPerSecondnumbernull
Bytes a second written to disk.
More
Null when the server had no such figure then.completeboolean
False when a server did not answer.
More
A sandbox that was moved has readings on each server it was on, and those of the one that did not answer are missing.Errors and other answers
| 400 | since is not before until, the two are more than 15 days apart, or stepSeconds would give more than 1500 points. |
| 404 | Not found. |
| 501 | metrics_unavailable sandboxes are not read here. GET /v1/policy says so as metrics. |
| 503 | metrics_unreadable not one of the servers answered for its readings. The sandboxes are as they were. Ask again in a minute. |
Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.