kubernetes/kube-state-metrics

Add-on agent to generate and expose cluster-level metrics.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 43 minutes ago
Added to GitGenius on April 7th, 2021
Created on May 6th, 2016
Open Issues & Pull Requests: 106 (+0)
Number of forks: 2,192
Total Stargazers: 6,183 (+0)
Total Subscribers: 76 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 7.0 days
Mean response time: 68.3 days
90th percentile: 100.2 days
Tracked items: 262

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 87% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Only 2% of issues opened in the past year have been closed. Three people close 54% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 62
New in 7 days: 2
Closed in 7 days: 1
Avg open age: 376 days
Stale 30+ days: 48
Stale 90+ days: 25

Recent activity

Opened in 7 days: 1
Closed in 7 days: 1
Comments in 7 days: 2
Events in 7 days: 11

Top labels

  • needs-triage (195)
  • kind/feature (130)
  • kind/bug (117)
  • lifecycle/rotten (85)
  • triage/accepted (77)
  • kind/support (15)
  • help wanted (14)
  • lifecycle/stale (7)

Detailed Description

kube-state-metrics is a Kubernetes add-on agent written in Go that listens to the Kubernetes API server and generates metrics about the state of cluster objects. Rather than monitoring the health of individual Kubernetes components, it focuses on the health and state of objects within the cluster such as deployments, nodes, and pods. The project exposes these metrics on an HTTP endpoint at /metrics on port 8080 by default, serving them as plaintext in a format compatible with Prometheus scraping.

A core design principle of kube-state-metrics is generating metrics directly from Kubernetes API objects without modification. This approach ensures that the stability grade of metrics matches that of the underlying Kubernetes API objects themselves. The service exposes raw, unmodified data from the Kubernetes API, allowing users to access complete information and apply their own heuristics for interpretation rather than relying on the simplified representations that kubectl provides. The metrics reflect the current state of the cluster, and when Kubernetes objects are deleted, they no longer appear on the metrics endpoint.

The project maintains compatibility with multiple Kubernetes versions through the client-go library. According to the compatibility matrix, recent releases support Kubernetes versions ranging from v1.32 to v1.35, with the main development branch targeting v1.36. Container images are available for multiple architectures including amd64, arm, arm64, ppc64le, and s390x. The project distinguishes itself from the metrics-server by focusing on generating new metrics from Kubernetes object state rather than serving performance metrics from nodes and pods.

The project shares contributors with other major Kubernetes ecosystem projects including thanos-io/thanos, prometheus/prometheus, and kubernetes/kubernetes.

The repository includes comprehensive documentation covering metrics, deployment options, and scaling considerations. It supports resource filtering, horizontal sharding for scaling across multiple instances, and both standard Kubernetes deployment and Helm chart installation methods. The project exposes its own telemetry metrics on a separate port, including list and watch success and error metrics that can help diagnose configuration or permission issues. It also provides build information and configuration metrics for monitoring the kube-state-metrics service itself.

kube-state-metrics handles label name conflicts that arise from differences between Kubernetes and Prometheus character set restrictions by automatically converting unsupported characters to underscores and appending conflict suffixes when necessary. The project supports ECMAScript regular expressions for allow and deny lists with evaluation time capped at one minute to prevent performance degradation. Resource recommendations suggest allocating 250MiB of memory and 0.1 cores as a baseline, with usage scaling proportionally to the number of Kubernetes objects in the cluster.