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

# Monitor Compute workloads

> Use metrics and logs to understand your Compute workloads and Instances.

Use Compute metrics and logs to understand how your workloads run. Metrics show CPU and memory usage. Logs show Instance output and, for published workloads, requests handled by an Application Load Balancer (ALB).

## Metrics

The Cloud Portal shows CPU and memory usage on Compute workload and Instance pages. Open the **Metrics** tab for a longer view. Datum also publishes the measurements to your project's metrics store so you can query them or [export them to Grafana Cloud](/docs/platform/metrics-export).

### CPU and memory series

| Metric | Type | Meaning |
| - | - | - |
| `datum_compute_instance_cpu_usage_seconds_total` | Counter | CPU time used, in seconds. Apply `rate()` to see CPU usage in cores. |
| `datum_compute_instance_memory_working_set_bytes` | Gauge | Memory working set, in bytes. |

Each series measures one container in an Instance. These measurements don't represent total virtual machine memory or include a separate virtual machine overhead measurement. An Instance's quota and configured size also differ from measured usage.

Use these labels to select the series you need:

| Label | Meaning |
| - | - |
| `resourcemanager_datumapis_com_project_name` | Project ID. |
| `resource_name` | Instance name, as shown by `datumctl compute instances`. This is not the workload name. |
| `instance_container` | Container name within the Instance. Use this label for a per-container breakdown. The metrics store doesn't expose the raw Prometheus `container` label. |
| `region` | Location where the Instance runs, such as `us-central-1`. |
| `runtime_class` | `general-purpose` on standard container Instances. |

### Query an Instance

Replace `PROJECT_ID` and `INSTANCE_NAME` with your project ID and an Instance name returned by `datumctl compute instances --workload=WORKLOAD_NAME`. Run these MetricsQL queries in your metrics tool:

```promql theme={null}
sum(rate(datum_compute_instance_cpu_usage_seconds_total{resourcemanager_datumapis_com_project_name="PROJECT_ID",resource_name="INSTANCE_NAME"}[5m]))
```

The CPU result is in cores. For example, `0.5` means approximately half of one CPU core over the five-minute window.

```promql theme={null}
sum(datum_compute_instance_memory_working_set_bytes{resourcemanager_datumapis_com_project_name="PROJECT_ID",resource_name="INSTANCE_NAME"})
```

The memory result is in bytes. These queries add the container measurements for the selected Instance. Keep the project selector because Instance names alone aren't unique across projects.

To see each container's contribution, retain `instance_container` in the result:

```promql theme={null}
sum by (instance_container) (rate(datum_compute_instance_cpu_usage_seconds_total{resourcemanager_datumapis_com_project_name="PROJECT_ID",resource_name="INSTANCE_NAME"}[5m]))

sum by (instance_container) (datum_compute_instance_memory_working_set_bytes{resourcemanager_datumapis_com_project_name="PROJECT_ID",resource_name="INSTANCE_NAME"})
```

If an Instance has more than one container, each has its own series. Sum the series once for an Instance total; don't add the container breakdown to that total again.

To graph a whole workload, get its Instance names with `datumctl compute instances --workload=WORKLOAD_NAME`, then select those names in `resource_name`. The metrics don't carry a workload-name label.

## Logs

Open a workload's **Logs** tab in the Cloud Portal to see output from its Instances. If the workload is published through an ALB, the same view also includes ALB access logs. Open an Instance's **Logs** tab to focus on that Instance's output and related ALB requests. The Overview pages show recent logs, and the Logs tabs provide a larger explorer with time and search controls.

Instance output appears after an Instance starts writing to standard output. ALB access logs require a published workload and requests to its public endpoint. If you don't see expected entries, check that the Instance is running, select a time range that includes the activity, and confirm that requests reached the ALB.

To read or follow the same logs from a terminal, see [View Compute logs with datumctl](/docs/datumctl/compute/viewing-logs).

To find who changed a workload's configuration, see [Activity logs](/docs/platform/activity-logs). Activity logs record resource changes; the Logs tab shows output from running Instances and requests to the ALB.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.