Logs and metrics
Logs and metrics are read per Workload and merged across its units, or narrowed to one with unit_id. Both stay readable for 30 days, including for units that were scaled away, destroyed, or whose Workload is stopped.
curl
Code
TypeScript
Code
Python
Code
Logs
| Parameter | Meaning |
|---|---|
unit_id | one unit (live or gone); omit for all units merged by instant |
direction | backward (default, newest first, how a panel opens) or forward (how a follow polls) |
cursor | opaque; resumes exactly, with no duplicate and no gap |
limit, from, to | page size and time window |
search | case-insensitive substring |
container | which container of the pod |
lines are always oldest first. To follow: read the first page backward, take follow_cursor, then poll direction=forward&cursor=<follow_cursor> every poll_after_ms. The platform agent's own lines are hidden unless you ask for them.
For a live socket instead of polling, POST .../units/{unit_id}/logs/stream-ticket mints a short-lived ticket for the stream, and GET .../units/logs/download exports a range as a file.
Metrics
GET .../units/metrics returns CPU, memory and network over window of 1h, 6h, 24h, 7d or 30d, always as 120 buckets. series is a comma-separated list of cpu, memory, network_in, network_out and log_lines_archived. Without unit_id each series has one aggregate line and a line for each of at most ten units (the highest), with omitted_units for the rest.
GET .../units/count is the unit-count series over time, and GET .../units/{unit_id}/terminations lists how a unit's containers ended.
