Announcement

Free to view yesterday and today
Customer Service: cat_manager

kube-state-metrics - Kubernetes Cluster State Metrics Exporter

An add-on agent that listens to the Kubernetes API server and generates metrics about the state of the objects, such as deployments, nodes, and pods. It's primarily used with Prometheus for monitoring and alerting.

Go
Added on 2025年6月26日
View on GitHub
kube-state-metrics - Kubernetes Cluster State Metrics Exporter preview
5,776
Stars
2,086
Forks
Go
Language

Project Introduction

Summary

Kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects. It generates metrics based on the API objects without any modifications to the objects themselves.

Problem Solved

Kubernetes control plane components (like the API server, controller manager) don't expose detailed, Prometheus-format metrics about the *state* of all Kubernetes objects (e.g., number of ready replicas in a deployment, pending pods). Kube-state-metrics fills this gap.

Core Features

Comprehensive Metrics

Exposes a large number of detailed metrics about Kubernetes objects (pods, deployments, nodes, services, etc.).

Prometheus Native

Designed to integrate seamlessly with Prometheus, providing metrics in a format Prometheus can scrape.

Non-Intrusive

Acts as a read-only service, only querying the API server and not interacting with control plane components.

Tech Stack

Go
Kubernetes API
Prometheus (Client Library)

使用场景

Kube-state-metrics is crucial for various Kubernetes monitoring and management scenarios:

Scenario 1: Application Health Monitoring

Details

Monitor the number of ready, pending, or failed pods for specific deployments, statefulsets, or jobs.

User Value

Provides insights into application stability and enables rapid detection of issues like insufficient replicas or stuck pods.

Scenario 2: Resource Usage & Capacity Planning

Details

Track the resource requests and limits defined for pods and containers across the cluster.

User Value

Helps understand cluster resource allocation, identify potential bottlenecks, and inform capacity planning decisions.

Scenario 3: Proactive Alerting

Details

Set up alerts based on the state of Kubernetes objects, like receiving an alert when a PersistentVolumeClaim enters a pending state or a node is NotReady.

User Value

Enables automation of operational responses by triggering alerts on critical cluster or application state changes.

Recommended Projects

You might be interested in these projects

open-telemetryopentelemetry-go-contrib

This project provides a collection of valuable extensions, instrumentations, and exporters for OpenTelemetry-Go, enabling broader compatibility and enhanced observability features for Go applications.

Go
1445668
View Details

sunfacerust-by-practice

Learning Rust By Practice, narrowing the gap between beginner and skilled-dev through challenging examples, exercises and projects.

Rust
129291058
View Details

sveltejssvelte

Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app.

JavaScript
832784561
View Details