Get sandbox metrics
Call Create sandbox first and replace sbx_123 with its returned sandboxID.
GET
/e2b/sandboxes/{sandboxID}/metrics● SupportedRequest parameters
sandboxIDstringrequiredpath:
startintegeroptionalquery: Unix timestamp for the start of the interval, in seconds, for which the metrics
endintegeroptionalquery: Unix timestamp for the end of the interval, in seconds, for which the metrics
Returns
200
Errors follow the E2B format — see error codes
Request
curl
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
curl https://api.deepraxis.com/e2b/sandboxes/sbx_123/metrics \
-H "X-API-Key: $PRAXIS_API_KEY"Python
# Call Create sandbox first and replace sbx_123 with its returned sandboxID.
from e2b import Sandbox
opts = dict(
api_key="$PRAXIS_API_KEY",
api_url="https://api.deepraxis.com/e2b",
domain="sandbox.praxisusercontent.com",
)
metrics = Sandbox.get_metrics("sbx_123", **opts)
print(metrics)TypeScript
// Call Create sandbox first and replace sbx_123 with its returned sandboxID.
import { Sandbox } from "e2b";
const opts = {
apiKey: "$PRAXIS_API_KEY",
apiUrl: "https://api.deepraxis.com/e2b",
domain: "sandbox.praxisusercontent.com",
};
const metrics = await Sandbox.getMetrics("sbx_123", opts);
console.log(metrics);Response 200
[]Response
HTTP 200
Successfully returned the sandbox metrics
application/json
| Name | Type | Description |
|---|---|---|
| [].timestamp | string | Timestamp of the metric entry |
| [].timestampUnix | integer | Timestamp of the metric entry in Unix time (seconds since epoch) |
| [].cpuCount | integer | Number of CPU cores |
| [].cpuUsedPct | number | CPU usage percentage |
| [].memUsed | integer | Memory used in bytes |
| [].memTotal | integer | Total memory in bytes |
| [].memCache | integer | Cached memory (page cache) in bytes |
| [].diskUsed | integer | Disk used in bytes |
| [].diskTotal | integer | Total disk space in bytes |