# kubernetes/kube-state-metrics

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/kubernetes-kube-state-metrics).**

6,141 stars · 2,187 forks · Go · Apache-2.0

## Links

- GitHub: https://github.com/kubernetes/kube-state-metrics
- Homepage: https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/
- awesome-repositories: https://awesome-repositories.com/repository/kubernetes-kube-state-metrics.md

## Topics

`kubernetes` `kubernetes-exporter` `kubernetes-monitoring` `metrics` `monitoring` `observability` `prometheus` `prometheus-exporter`

## Description

kube-state-metrics is a Kubernetes metrics exporter that generates Prometheus-compatible metrics from the current state of cluster objects such as pods, deployments, and nodes. It operates by watching the Kubernetes API server and transforming resource snapshots into metric families, which are then exposed over an HTTP endpoint in the Prometheus text-based exposition format for direct scraping.

The project distinguishes itself through horizontal scaling capabilities, distributing metric collection across multiple instances using object UID hashing to reduce per-instance memory consumption. It also supports per-node sharding for pod metrics using field selectors, and includes self-monitoring metrics for operational observability, along with health check endpoints for Kubernetes startup, liveness, and readiness probes.

The tool provides capabilities for filtering metrics by resource type, querying object state through labels and annotations, and restricting access to specific namespaces. It also includes label-name conflict resolution for Prometheus compatibility and supports configuration of admission webhooks for request filtering and mutation.

## Tags

### DevOps & Infrastructure

- [Object State Monitoring](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-cluster-management/object-state-monitoring.md) — Generates Prometheus-compatible metrics from Kubernetes object state for cluster observability and alerting.
- [Kubernetes Object State Queries](https://awesome-repositories.com/f/devops-infrastructure/kubernetes-object-state-queries.md) — Provides Prometheus metrics about Kubernetes object labels, annotations, statuses, and phases for PromQL queries. ([source](https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/))
- [Node Scheduling Constraints](https://awesome-repositories.com/f/devops-infrastructure/node-scheduling-constraints.md) — Limits which nodes a pod can run on by requiring the node to have specific label values. ([source](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/))
- [Standardized Manifest Labeling](https://awesome-repositories.com/f/devops-infrastructure/resource-visibility-filters/resource-label-filtering/standardized-manifest-labeling.md) — Defines which pods a Service targets by declaring label matching rules in the object manifest. ([source](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/))
- [Request Filters](https://awesome-repositories.com/f/devops-infrastructure/admission-webhooks/request-filters.md) — Filters admission webhook requests using namespace labels, object labels, operations, and CEL expressions.
- [Resource Label Filtering](https://awesome-repositories.com/f/devops-infrastructure/resource-visibility-filters/resource-label-filtering.md) — Selects Kubernetes resources whose labels match exact key-value pairs using equality-based selectors. ([source](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/))

### System Administration & Monitoring

- [Prometheus-Formatted HTTP Endpoints](https://awesome-repositories.com/f/system-administration-monitoring/metrics-exporters/prometheus-formatted-http-endpoints.md) — Generates Prometheus-compatible metrics from the state of Kubernetes objects like pods, deployments, and nodes. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [Kubernetes Object State Pipelines](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/metric-performance-monitors/pipeline-processing/metric-transformation-pipelines/kubernetes-object-state-pipelines.md) — Converts Kubernetes object state into Prometheus-compatible metrics by watching the API server.
- [Kubernetes Object State Exporters](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-exporters/prometheus-based-metric-exporters/kubernetes-object-state-exporters.md) — Generates Prometheus-compatible metrics from the current state of Kubernetes cluster objects.
- [Object State Metrics](https://awesome-repositories.com/f/system-administration-monitoring/metric-collection/kubernetes-node-metrics/object-state-metrics.md) — Tracks the current state of Kubernetes resources like pods, deployments, and nodes as metrics.
- [Per-Node Sharding Strategies](https://awesome-repositories.com/f/system-administration-monitoring/metric-collection/kubernetes-node-metrics/per-node-sharding-strategies.md) — Ships per-node sharding to reduce per-instance resource usage when collecting pod metrics.
- [Cluster Object State Endpoints](https://awesome-repositories.com/f/system-administration-monitoring/metrics-exporters/prometheus-formatted-http-endpoints/cluster-object-state-endpoints.md) — Exposes cluster-level object state metrics through an HTTP endpoint for monitoring and alerting.
- [Shard Metrics](https://awesome-repositories.com/f/system-administration-monitoring/metrics-exporters/shard-metrics.md) — Splits metric collection across multiple instances by hashing each object's UID for horizontal scaling. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [Instance Sharding Distributions](https://awesome-repositories.com/f/system-administration-monitoring/metrics-exporters/shard-metrics/instance-sharding-distributions.md) — Distributes metric collection across instances using object UID hashing to reduce per-instance memory consumption. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [Cluster Monitoring Systems](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/metric-performance-monitors/cluster-monitoring-systems.md) — Generates Prometheus-compatible metrics by watching the Kubernetes API server for the current state of cluster objects. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [Object State Monitors](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/metric-performance-monitors/infrastructure-monitoring/kubernetes-monitors/object-state-monitors.md) — Queries the Kubernetes API server to produce time-series metrics about cluster resource states.
- [Health Monitoring Endpoints](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/operational-health-alerting/health-monitoring-endpoints.md) — Provides /healthz, /livez, and /readyz endpoints for startup, liveness, and readiness probes. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [HTTP Health Probes](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/operational-health-alerting/health-monitoring-endpoints/http-health-probes.md) — Provides /healthz, /livez, and /readyz endpoints for Kubernetes startup, liveness, and readiness probes. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [Prometheus-Based Metric Exporters](https://awesome-repositories.com/f/system-administration-monitoring/prometheus-exporters/prometheus-based-metric-exporters.md) — Exposes Kubernetes object metrics in Prometheus format for scraping and querying.
- [Alert Thresholds](https://awesome-repositories.com/f/system-administration-monitoring/alert-thresholds.md) — Fires alerts based on metric thresholds, such as pods stuck in a Terminating state for longer than a set duration. ([source](https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/))
- [Resource Type Filters](https://awesome-repositories.com/f/system-administration-monitoring/automatic-framework-instrumentation/kubernetes-resource-metric-collectors/resource-type-filters.md) — Restricts the metrics endpoint to return data only for specified Kubernetes resources using query parameters. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [Metric Threshold Alerting](https://awesome-repositories.com/f/system-administration-monitoring/data-pattern-monitoring/metric-threshold-alerting.md) — Fires alerts based on metric thresholds, such as pods stuck in a Terminating state for a defined duration. ([source](https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/))
- [UID-Hash Sharding](https://awesome-repositories.com/f/system-administration-monitoring/distributed-metric-collection/uid-hash-sharding.md) — Distributes metric collection across instances using object UID hashing for horizontal scaling.
- [Per-Node Pod Metric Collectors](https://awesome-repositories.com/f/system-administration-monitoring/metric-collection/kubernetes-node-metrics/per-node-pod-metric-collectors.md) — Limits each instance to collect pod metrics only from its own node using a field selector. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [Application Self-Monitoring Exporters](https://awesome-repositories.com/f/system-administration-monitoring/metrics-exporters/application-self-monitoring-exporters.md) — Exposes its own process metrics, API error rates, and HTTP request durations for operational observability.
- [Application Self-Monitors](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/metric-performance-monitors/system-usage-monitoring/evaluation-metric-monitors/application-self-monitors.md) — Reports its own process metrics, API error rates, HTTP request durations, and configuration hashes. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))

### Data & Databases

- [UID-Hash Sharding Strategies](https://awesome-repositories.com/f/data-databases/distributed-sharding-architectures/uid-hash-sharding-strategies.md) — Distributes metric collection across instances by hashing object UIDs for horizontal scaling.
- [Collection Sharding](https://awesome-repositories.com/f/data-databases/horizontal-database-scaling/metric-storage-scaling/collection-sharding.md) — Shards metric collection across multiple instances to reduce per-instance memory and resource usage.
- [Prometheus Label Name Sanitizers](https://awesome-repositories.com/f/data-databases/time-series-analysis/label-based-series-retrieval/label-name-listings/prometheus-label-name-sanitizers.md) — Resolves Kubernetes label name conflicts to produce Prometheus-compatible metric labels.

### Software Engineering & Architecture

- [UID-Hash Sharding Strategies](https://awesome-repositories.com/f/software-engineering-architecture/hash-based-data-distribution/uid-hash-sharding-strategies.md) — Distributes metric collection across instances by hashing object UIDs for horizontal scaling.
- [Resource Access Restrictions](https://awesome-repositories.com/f/software-engineering-architecture/namespace-management/namespace-discovery-scopes/resource-access-restrictions.md) — Limits metric collection to specific Kubernetes namespaces and resource types using a service account. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))
- [Namespace Access Controls](https://awesome-repositories.com/f/software-engineering-architecture/naming-conventions/reserved-names/access-restrictions/service-account-permissions/namespace-access-controls.md) — Limits metric collection to a specific set of namespaces by binding a service account with view privileges. ([source](https://cdn.jsdelivr.net/gh/kubernetes/kube-state-metrics@main/README.md))

### Web Development

- [Kubernetes Label Selectors](https://awesome-repositories.com/f/web-development/browser-integration-utilities/dom-event-handling/dom-selectors/label-based-selectors/kubernetes-label-selectors.md) — Filters Kubernetes objects returned by list or watch operations using label selectors. ([source](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/))
