> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor sandbox usage metrics

> Query per-sandbox lifecycle and usage metrics for CoreWeave Sandboxes with PromQL.

CoreWeave Sandboxes publish per-organization metrics that describe every active sandbox: how many are running, what resources they requested, and how much CPU and memory they're consuming. Use these metrics to track fleet activity, attribute usage, and build your own dashboards and alerts.

<Note>
  CoreWeave sandboxes are in public preview. For access, contact your CoreWeave account team, [CoreWeave Support](https://cloud.coreweave.com/contact), or email [support@coreweave.com](mailto:support@coreweave.com).
</Note>

## Prerequisites

The metrics are available in the [Explore section](/observability/managed-grafana) of the Grafana instance that CoreWeave hosts. To access Grafana, you must be logged in to the CoreWeave Cloud Console and be a member of the `admin`, `metrics`, or `write` groups.

You can also query the same metrics programmatically through the [metrics API](/observability/logs-metrics/introduction) at `observe.coreweave.com` with an API access token.

<Info>
  Queries are automatically scoped to your organization. Selectors on `cluster` or `cluster_org` are rewritten to your organization, so a query that references another organization returns your own data rather than an empty result.
</Info>

## Common labels

All `cwsandbox_*` metrics carry the following labels:

| Label         | Description                          | Example       | Notes                                                                                            |
| ------------- | ------------------------------------ | ------------- | ------------------------------------------------------------------------------------------------ |
| `org_id`      | Your Organization ID                 | `abc123`      | Always your own organization.                                                                    |
| `cluster`     | Constant, equal to `org_id`          | `abc123`      | Sandbox metrics always live under this pseudo-cluster, regardless of where sandboxes are placed. |
| `cluster_org` | The Organization ID                  | `abc123`      | Queries are automatically scoped to the organization.                                            |
| `region`      | The Region serving the sandbox fleet | `US-EAST-02`  | See [the list of Regions](/platform/regions/about-regions-and-azs).                              |
| `zone`        | The Zone serving the sandbox fleet   | `US-EAST-02A` | See [the list of Availability Zones](/platform/regions/about-regions-and-azs).                   |

The label contract is identical whether your sandboxes run on CoreWeave-managed shared capacity or on your own CoreWeave Kubernetes Service (CKS) clusters with a [managed runner](/products/sandboxes/operations/managed-runners). To break usage down by placement, group by the `runner_id` label on `cwsandbox_sandbox_info`.

## Lifecycle metrics

These metrics come from the sandbox control plane and update about every 30 seconds. Per-sandbox series exist while the sandbox is active and disappear shortly after it stops.

### Metric `cwsandbox_sandboxes`

The number of active sandboxes in each lifecycle state. Units are in sandboxes.

The following labels are available for filtering and grouping:

| Label   | Description         | Example   | Notes                                                                                                         |
| ------- | ------------------- | --------- | ------------------------------------------------------------------------------------------------------------- |
| `state` | The lifecycle state | `RUNNING` | Values are `PLACING`, `CREATING`, `RUNNING`, and `TERMINATING`. Stopped and completed sandboxes are excluded. |

### Metric `cwsandbox_sandbox_info`

A constant `1` series that carries the identity of each active sandbox. Use it to join identity labels onto the usage metrics.

The following labels are available for filtering and grouping:

| Label        | Description                             | Example                                | Notes                                                                                                       |
| ------------ | --------------------------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `sandbox_id` | The sandbox ID                          | `0e0394fc-877b-4971-8e97-b99ea4f6bcd5` | Matches the ID returned when the sandbox started.                                                           |
| `profile_id` | The profile the sandbox was placed with | `default`                              | See [profiles](/products/sandboxes/profiles/profiles).                                                      |
| `runner_id`  | The runner serving the sandbox          | `prod-east-14-managed`                 | Identifies placement, including your own [managed runners](/products/sandboxes/operations/managed-runners). |
| `image`      | The sandbox container image             | `python:3.11-slim`                     | The image the sandbox was started with.                                                                     |

### Metric `cwsandbox_sandbox_age_seconds`

The age of each active sandbox since creation. Units are in seconds. Labeled by `sandbox_id`.

### Metric `cwsandbox_sandbox_requested_cpu_millicores`

The CPU each sandbox requested at admission, not measured usage. Units are in millicores. Labeled by `sandbox_id`.

### Metric `cwsandbox_sandbox_requested_memory_bytes`

The memory each sandbox requested at admission, not measured usage. Units are in bytes. Labeled by `sandbox_id`.

### Metric `cwsandbox_sandbox_requested_gpus`

The GPUs each sandbox requested at admission. Units are in GPUs. Labeled by `sandbox_id` and `gpu_type`.

## Usage metrics

These metrics are measured on the node running each sandbox and update about every 30 seconds.

### Metric `cwsandbox_sandbox_cpu_usage_seconds_total`

A counter of the CPU time each sandbox has consumed. Units are in CPU seconds. Labeled by `sandbox_id`. Use `rate()` or `increase()` to compute consumption over a window.

### Metric `cwsandbox_sandbox_memory_working_set_bytes`

The current working-set memory of each sandbox. Units are in bytes. Labeled by `sandbox_id`.

<Info>
  Usage values reflect the sandbox workload container. For sandboxes running on microVM isolation, the values come from inside the guest and exclude virtualization overhead and platform sidecar processes. The CPU counter resets if the workload container restarts, which `rate()` and `increase()` handle automatically. A short gap in a series means collection was briefly interrupted. Stale values are never reported.
</Info>

## PromQL examples

### Running sandboxes over time

```promql theme={"system"}
sum(cwsandbox_sandboxes{state="RUNNING"})
```

### CPU cores in use per sandbox

```promql theme={"system"}
rate(cwsandbox_sandbox_cpu_usage_seconds_total[5m])
```

### CPU usage enriched with profile and runner

Join the usage counter with `cwsandbox_sandbox_info` on `sandbox_id` to attach identity labels:

```promql theme={"system"}
rate(cwsandbox_sandbox_cpu_usage_seconds_total[5m])
* on (sandbox_id) group_left (profile_id, runner_id, image)
cwsandbox_sandbox_info
```

### Total memory in use across the fleet

```promql theme={"system"}
sum(cwsandbox_sandbox_memory_working_set_bytes)
```

### CPU efficiency, used versus requested

```promql theme={"system"}
sum(rate(cwsandbox_sandbox_cpu_usage_seconds_total[5m]))
/
(sum(cwsandbox_sandbox_requested_cpu_millicores) / 1000)
```

### Requested GPUs by type

```promql theme={"system"}
sum by (gpu_type) (cwsandbox_sandbox_requested_gpus)
```

### Longest-running sandboxes

```promql theme={"system"}
topk(10, cwsandbox_sandbox_age_seconds)
```
