---
title: "(-- api-linter: core::0131::synonyms=disabled aip.dev/not-precedent: ReadMetrics is a custom method on a singleton resource, not a standard Get method. The \"read\" verb is appropriate for metrics collection operations. --) Reads current resource usage metrics for the sandbox environment."
method: GET
path: "/v1/{name}/metrics:read"
tags: ["MetricsService"]
---

# (-- api-linter: core::0131::synonyms=disabled aip.dev/not-precedent: ReadMetrics is a custom method on a singleton resource, not a standard Get method. The "read" verb is appropriate for metrics collection operations. --) Reads current resource usage metrics for the sandbox environment.

`GET /v1/{name}/metrics:read`

## Request

- Base URL: `https://docs.h2o.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.h2o.ai/v1/{name}/metrics:read`
- Auth: none declared
- TypeScript: <https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/docs/v1/:name/metrics:read/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns a snapshot of memory, CPU, and disk statistics
collected at the time of the request.

If metrics cannot be collected, behavior depends on strict_mode:
returns an error in strict mode, or partial metrics with zero values otherwise.

Authorization: Only the creator of the SandboxEngine is allowed to call this method.

## Path parameters

- `name` string, required

## Query parameters

- `strictMode` boolean

## Response `200`

A successful response.

- V1ReadMetricsResponse: Response containing sandbox metrics.
  - `metrics` V1Metrics: Represents a snapshot of resource usage metrics for the sandbox environment.
    - `memory` V1MemoryMetrics: Memory usage statistics.
      - `currentBytes` string, int64: Output only. Current memory usage in bytes. This includes all memory charged to the container (file cache, anonymous memory, swap, etc.).
      - `limitBytes` string, int64, nullable: Output only. Maximum allowed memory in bytes. Unset if no memory limit is configured (unlimited memory).
    - `disk` V1DiskMetrics: Disk usage statistics for the sandbox filesystem.
      - `totalBytes` string, int64: Output only. Total disk space in bytes.
      - `availableBytes` string, int64: Output only. Available disk space in bytes.
    - `cpu` V1CpuMetrics: CPU usage statistics.
      - `usageRatio` number, double: Output only. CPU usage as a ratio of available CPU resources (0.0-1.0). Calculated by measuring CPU time delta over a sampling period and normalizing appropriately. - With CPU quota set: Returns 0.0-1.0 of allocated cores (e.g., 0.75 when using 1.5 cores out of 2 cores allocated). - Without CPU quota: Returns 0.0-1.0 of host CPU count (e.g., 0.5 when using 4 cores on an 8-core host). Note: The initial calls to ReadMetrics after service startup may return 0.0 until the background sampler has established a baseline (one sampling interval).
    - `collectTime` string, date-time: Output only. The time when these metrics were collected.

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto.md) - [All operations](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/revisions/57d1a2e93fcf?raw)
