Skip to main content
KubeStacks finds the Prometheus or VictoriaMetrics in your cluster and charts what the cluster used, from the last 15 minutes to the last week. It asks through the API server with your own credentials, so nothing needs to be port-forwarded or exposed. History shows up in two places: the Metrics page, which ranks and compares, and a Metrics tab on pods, workloads and nodes.
Usage over the last six hours from Prometheus, by namespace.Usage over the last six hours from Prometheus, by namespace.

The Metrics page: six hours of CPU, by namespace.

What you need

  • A Prometheus-compatible server in the cluster. Prometheus (as kube-prometheus-stack, the Prometheus chart or kube-prometheus install it) or VictoriaMetrics, single-node or cluster.
  • cAdvisor’s metrics, scraped. CPU, memory and network charts use the kubelet’s container_* series. kube-prometheus-stack scrapes them out of the box.
  • kube-state-metrics, for restarts. It also places pods on nodes when cAdvisor’s series don’t carry a node label.
  • Permission to reach it. Your account needs get on services/proxy in the namespace the server runs in, and list on services to find it.

How KubeStacks finds it

You usually don’t have to do anything. Unless you’ve chosen a source, KubeStacks looks through the cluster’s services for one that answers PromQL:
1

It scores every service

It skips services that come with Prometheus but don’t answer queries themselves (Alertmanager, operators, exporters, kube-state-metrics, Grafana, VictoriaMetrics’ agent and storage components, and so on), and rates the rest by their name and their app.kubernetes.io/name or app label:Services in a namespace named monitoring, prometheus, observability or victoria-metrics get 5 more.
2

It asks the best four

In order, it sends each a trivial query. The first that answers is used. Its name and version show on the chip at the top of every chart.
If yours runs under a name KubeStacks doesn’t recognize, or you have several and want another, choose it yourself.

Choosing the source

Open Metrics source from the chip on any chart, or from the command palette (⌘K, then “Metrics source”). ⌘ is Ctrl on Windows and Linux.
The default. KubeStacks looks for Prometheus and VictoriaMetrics among the cluster’s services, as described above.
The choice is kept per cluster.
In your cluster: the administrator sets the default for everyone with the chart’s metrics.source (auto, off, or a service like monitoring/prometheus-operated:9090). Each person can still choose another; it’s kept in their browser. See Helm values.

The Metrics page

Open it from the sidebar, or press G then U. It ranks what uses the most, and shows how that changed. Under the chart:
  • Summary tiles. Now, Average and Peak for the total, and either Of allocatable, on average (for the whole cluster) or the busiest group. For restarts: how many, how many pods (or workloads…) restarted, which restarted most, and how often.
  • A distribution. How the groups spread out. Click a band to filter the table to it.
  • A ranked table of every group, with its now, average and peak, sortable.
The page follows the namespace menu, and keeps everything you pick in its address, so Back and Forward restore it.

The Metrics tab

Pods, Deployments, StatefulSets, DaemonSets, ReplicaSets, Jobs, CronJobs and Nodes have a Metrics tab in their detail panel.
A pod's CPU and memory over time, against its requests and limits.A pod's CPU and memory over time, against its requests and limits.

A pod's Metrics tab: CPU and memory against its requests and limits.

A limit line appears only when every container has a limit, since without one there’s no ceiling to draw.

Reading the charts

  • Zoom in by dragging across any chart. Reset zoom goes back to the range you picked.
  • Read values by hovering, or with ← →, Home and End when the chart has focus. Esc hides the readout.
  • Show or hide a series by clicking it in the legend. Alt-, ⌘- or Shift-click shows only that one.
Each range has its own resolution, and charts refresh on their own while you look:

When there’s no history

Where a chart would be, KubeStacks says why, and what to do: A chart that’s empty for a time usually means Prometheus has no samples for it: the object wasn’t running yet, or cAdvisor isn’t scraped. Restarts come from kube-state-metrics, so without it that chart stays empty.

Live usage

What’s in use right now, from metrics-server.

What KubeStacks needs

The RBAC behind each feature, history included.