concept
Metrics pipeline and dashboards
Resource metrics describe CPU and memory consumption. The kubelet exposes resource usage; an installed metrics-server gathers it and serves the resource Metrics API, used by kubectl top and resource-based autoscaling. This is not a general historical monitoring database. Application metrics instead describe requests, errors, queues and latency. They require instrumentation and a suitable collection path. Low CPU does not imply good latency. An absent sample must be investigated, not replaced with zero.
Formal Syntax & Structure
kubernetes syntaxkubernetes
rate(counter[5m]); classic histogram bucketsWorking Example
Example Snippetkubernetes
sum by (service) (rate(bookstore_http_requests_total[5m]))# Query example only: needs a populated Prometheus instance.