DaytonaDocs
Working with Sandboxes

Usage Metrics

Live and historical CPU, memory, disk, and network usage per sandbox.

Daytona measures every sandbox's resource consumption from outside the sandbox. Because sandboxes are hardware-isolated microVMs, the platform can observe CPU, memory, disk, and network usage from the host side, sampled roughly once per second — no agent runs inside your sandbox, so metrics collection adds zero overhead to your workload and can't be tampered with by anything running in it.

Three surfaces cover the common questions: a live endpoint for "what is this sandbox doing right now", a history endpoint for "what has it been doing over time", and a project report for "what is all of this costing me".

Live usage

GET /vms/:id/usage returns the sandbox's current resource usage — CPU, memory, disk, and network — as observed by the host. Use it for spot checks and for dashboards that watch a specific sandbox in real time.

cURL
curl https://api.rl.trydaytona.com/vms/$SANDBOX_ID/usage \
  -H "Authorization: Bearer $RLP_API_KEY"

The response wraps the live sample in a document with "source": "live". The sandbox must be running and placed; a sandbox with no compute (stopped, paused) has no live usage to report.

Usage history

GET /vms/:id/usage/history returns a time series of the same measurements, so you can see how a workload behaved over minutes or days — where the CPU spikes were, how memory grew, how much I/O a job did.

cURL
# Default: the last 24 hours at minute resolution
curl "https://api.rl.trydaytona.com/vms/$SANDBOX_ID/usage/history" \
  -H "Authorization: Bearer $RLP_API_KEY"
 
# A specific window at hourly resolution
curl "https://api.rl.trydaytona.com/vms/$SANDBOX_ID/usage/history?from=2026-07-30T00:00:00Z&to=2026-08-01T00:00:00Z&resolution=h" \
  -H "Authorization: Bearer $RLP_API_KEY"

Query parameters:

ParameterMeaningDefault
fromRFC3339 start of the window (inclusive)to − 24h
toRFC3339 end of the window (exclusive)now
resolutionm (minute buckets) or h (hourly rollups)m

Each period in the response carries start, duration_ms, and integrals/gauges for the bucket: cpu_core_s (CPU core-seconds consumed), mem_byte_s, mem_rss_peak, disk_used, io_r_bytes, io_w_bytes, net_rx_bytes, and net_tx_bytes. To turn an integral into an average rate, divide by the bucket's duration — for example, average cores used = cpu_core_s / (duration_ms / 1000).

Project-level reporting

GET /usage/report aggregates usage across all sandboxes in your project over a time window, at hourly (resolution=h, default) or daily (resolution=d) granularity — the input for cost review and budgeting. See Platform → Spending for how usage maps to billing.

cURL
curl "https://api.rl.trydaytona.com/usage/report?start=2026-07-01T00:00:00Z&end=2026-08-01T00:00:00Z&resolution=d" \
  -H "Authorization: Bearer $RLP_API_KEY"

Dashboard

The Usage tab on a sandbox's page in the dashboard charts the same history data — the quickest way to eyeball a workload's footprint without writing any queries.

See also

On this page