Overview of kube-state-metrics
mainkube-state-metrics (KSM) is a service that listens to the Kubernetes API server to generate metrics regarding the state of Kubernetes objects (e.g., deployments, nodes, and pods).
Key characteristics:
- Raw Data: KSM exposes raw, unmodified data from the Kubernetes API. Unlike
kubectl, which applies heuristics to make messages more human-readable, KSM provides the exact values from the API so users can apply their own logic. - Metric Scope: It focuses on the state of objects within the cluster rather than the health of the Kubernetes components themselves.
- Consumption: Metrics are exported as plaintext and are designed to be consumed by Prometheus or any Prometheus-compatible scraper.