`GET /api/v1/agents/{node_id}/metrics` — metrics history for an agent.
const url = 'https://example.com/api/v1/agents/example/metrics';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/agents/example/metricsParameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Agent node ID
Query Parameters
Section titled “Query Parameters ”Only return samples taken at or after this UNIX timestamp (seconds).
Defaults to now - retention_window so the response covers the full
retention window when omitted.
Maximum number of samples to return. When omitted, all samples in the window are returned.
Responses
Section titled “ Responses ”Metrics history
Response body for GET /api/v1/agents/{node_id}/metrics.
object
Node ID of the agent these samples belong to.
Samples within the requested window, ordered by collected_at
ascending.
A single metrics sample in an API response.
Mirrors the wire format MetricsReport and the stored MetricsSnapshot.
All metric fields are nullable: a null value means the agent could not
collect that metric (the OS does not expose it, the agent has metrics
disabled, or the metric is not yet implemented for this platform).
object
UNIX timestamp (seconds) when the agent took this sample.
System-wide CPU usage at sample time, as a percentage (0–100).
Total disk space across all mounted non-virtual filesystems, in bytes.
Used disk space across all mounted non-virtual filesystems, in bytes.
Total physical memory in bytes.
Used physical memory in bytes.
Time since last boot in seconds.
Example generated
{ "node_id": "example", "samples": [ { "collected_at": 1, "cpu_usage": 1, "disk_total": 1, "disk_used": 1, "memory_total": 1, "memory_used": 1, "uptime": 1 } ]}No samples in the requested window