Task metrics
The Metrics tab shows each task’s CPU and memory usage against what it requested. Self-Hosted Base reads these series from a Prometheus: one the chart runs for you, or one you run yourself. Self-Hosted Base doesn’t depend on it to start.
What Prometheus needs
| Series | Source |
|---|---|
container_cpu_usage_seconds_total, container_memory_working_set_bytes |
cAdvisor, scraped from each node through the API server |
kube_pod_container_resource_requests, kube_pod_container_resource_limits, kube_pod_status_phase |
kube-state-metrics |
DCGM_FI_* (GPU charts only) |
NVIDIA dcgm-exporter |
The prometheus-community/prometheus chart scrapes cAdvisor and its bundled kube-state-metrics with its default configuration.
Run Prometheus with the chart
prometheus:
enabled: trueThe chart then runs the prometheus-community/prometheus chart (version 25.30.2) in Self-Hosted Base’s namespace, with only its server and kube-state-metrics, and points Self-Hosted Base at the server’s Service, unless you set metrics.prometheusURL yourself. It scrapes cAdvisor and kube-state-metrics across the cluster, so it creates a ClusterRole for scraping nodes. Any of that chart’s values can be set under prometheus.
The server keeps prometheus.server.retention (3d) of data on an emptyDir, so a restart loses the history. For GPU charts, also run dcgm-exporter; Prometheus scrapes it through its prometheus.io/scrape annotations.
Bring your own Prometheus
To install one separately:
# prometheus-values.yaml
alertmanager:
enabled: false
prometheus-pushgateway:
enabled: false
prometheus-node-exporter:
enabled: false
kube-state-metrics:
enabled: true
server:
retention: 3dhelm install prometheus prometheus --repo https://prometheus-community.github.io/helm-charts \
--version 25.30.2 -n monitoring --create-namespace -f prometheus-values.yamlThe chart creates a ClusterRole for scraping nodes. To reuse a Prometheus you already run, check that it has the series above, with their namespace and pod labels.
Then point Self-Hosted Base at it:
metrics:
prometheusURL: http://prometheus-server.monitoring.svcRun helm upgrade. If your Prometheus serves under a path prefix, include it, for example http://prometheus.monitoring.svc/prometheus.
Gotchas
| Symptom | Cause and fix |
|---|---|
| The Metrics tab says the action ran too briefly | Metrics need at least two scrapes of the task’s pod. With a one-minute scrape interval, tasks shorter than about two minutes have no CPU chart. |
| Memory charts render but CPU charts are empty | CPU usage is a rate over two cAdvisor samples. Wait for a second scrape, or lower the scrape interval. |
| Requested and limit lines are missing | kube-state-metrics isn’t scraped, or doesn’t watch Self-Hosted Base’s namespace. |