# Workload Metrics

> Source: https://parallelworks.com/docs/kubernetes/workload-metrics

# Workload Metrics

ACTIVATE provides built-in observability charts for Kubernetes workloads. CPU, memory, and storage usage are collected from the Kubernetes metrics-server and displayed as time-series charts on each workload's detail page.

## Accessing Metrics

Metrics are available on the detail page for workload-level resources (Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, and ReplicaSets). To view them:

1. Go to **Kubernetes > Workloads**
2. Select a cluster and namespace
3. Click on a workload name to open its detail page
4. The **Observability** panel is displayed at the top of the page

:::info Workload-Level Only
Metrics are shown for workload-level resources, not individual pods. To view metrics for a Deployment, click on the Deployment itself rather than one of its pods.
:::

## Available Charts

The Observability panel displays three charts side by side:

### CPU Usage

Shows CPU consumption in **cores** over time. The chart plots:

- **Usage** — Actual CPU consumed by all containers in the workload's pods
- **Request** — The sum of CPU requests configured across containers (displayed when set)
- **Limit** — The sum of CPU limits configured across containers (displayed when set)

### Memory Usage

Shows memory consumption in **GB** over time. The chart plots:

- **Usage** — Actual memory used by all containers in the workload's pods
- **Request** — The sum of memory requests configured across containers (displayed when set)
- **Limit** — The sum of memory limits configured across containers (displayed when set)

### Storage Usage

Shows ephemeral storage consumption in **GiB** over time. The chart plots:

- **Usage** — Actual ephemeral storage used by the workload's pods
- **Limit** — The node's ephemeral storage capacity (displayed when available)

:::tip Ephemeral Storage
Storage metrics are collected from the Kubernetes node's `/stats/summary` endpoint and reflect ephemeral storage usage, not persistent volume usage. For persistent volume information, see [Services & Storage](/docs/kubernetes/services-and-storage).
:::

## Time Range Selection

A dropdown in the Observability panel header lets you select the time window for all three charts:

| Option | Description |
|--------|-------------|
| **1 Hour** | Show metrics from the last 1 hour |
| **3 Hours** | Show metrics from the last 3 hours |
| **8 Hours** | Show metrics from the last 8 hours (default) |

The selected time range applies to all three charts simultaneously. The default view is **8 Hours**, giving you a broad view of workload behavior.

## Auto-Refresh

Metrics data refreshes automatically. There is no need to manually reload the page — the charts update in place with the latest data points from the metrics-server.

## Data Source

ACTIVATE collects metrics from the [Kubernetes metrics-server](https://github.com/kubernetes-sigs/metrics-server), which must be installed on each connected cluster. The metrics-server provides point-in-time CPU and memory usage for pods and nodes.

The platform's metrics collection process works as follows:

1. **Pod metrics** — CPU and memory usage are read from the metrics-server's `PodMetrics` API (`metrics.k8s.io/v1beta1`)
2. **Resource requests and limits** — CPU, memory, and ephemeral storage requests/limits are read from each pod's container spec
3. **Storage metrics** — Ephemeral storage usage is read from each node's `/stats/summary` proxy endpoint
4. **Aggregation** — Metrics are aggregated at the workload level (Deployment, StatefulSet, etc.) by resolving each pod's parent owner reference
5. **Storage** — Collected metrics are stored with timestamps and can be queried over the selected time range

:::warning Metrics Server Required
If the metrics-server is not installed on a cluster, the Observability panel will not display any data. Ensure that `metrics-server` is deployed and running in the `kube-system` namespace of each cluster you want to monitor.
:::

## Workload Types

Metrics aggregation resolves each pod's owner to determine which workload it belongs to:

| Pod Owner | Resolved Workload |
|-----------|-------------------|
| ReplicaSet (owned by Deployment) | Deployment |
| StatefulSet | StatefulSet |
| Job | Job |
| DaemonSet | DaemonSet (excluded from metrics) |
| Standalone pod | Excluded |

:::info Excluded Workloads
DaemonSet pods and standalone pods (pods with no owner reference) are excluded from workload-level metrics collection because they are not typically associated with a user-managed workload.
:::

## See Also

- [Pod Logs](/docs/kubernetes/pod-logs) — Stream and view container logs for individual pods
- [Managing Workloads](/docs/kubernetes/managing-workloads) — Browse and manage Deployments, StatefulSets, and other workload types
- [Cost Tracking](/docs/kubernetes/cost-tracking) — Monitor per-namespace compute costs
