kube-state-metrics/docs
Kubernetes Prow Robot c02c4cd32f
Merge pull request #1732 from X4BNet/feature/LastSuccessfulTime
Add missing LastSuccessfulTime metric
2022-05-16 04:18:17 -07:00
..
design docs: rename the Documentation folder to docs 2019-02-19 21:06:44 -08:00
developer Rename collector to resource 2020-02-05 19:43:23 -06:00
README.md Adds opt-in metric info and builds out opt-in column in Pod 2022-02-07 10:21:14 -08:00
certificatesigningrequest-metrics.md Mark new annotations metrics as EXPERIMENTAL 2021-08-15 18:11:36 +02:00
cli-arguments.md Add the opt-in metric family filter to expose or not to a metric family from the store (#1574) 2021-12-01 22:08:52 +01:00
configmap-metrics.md Expose configmap labels and annotations 2021-09-21 12:52:40 +03:00
cronjob-metrics.md Add missing LastSuccessfulTime metric 2022-05-16 18:38:41 +10:00
daemonset-metrics.md Mark new annotations metrics as EXPERIMENTAL 2021-08-15 18:11:36 +02:00
deployment-metrics.md Merge remote-tracking branch 'origin/master' into annotations 2021-08-16 08:50:02 +02:00
endpoint-metrics.md endpoints: export information about ports 2021-11-09 06:53:03 +01:00
horizontalpodautoscaler-metrics.md Add the "kube_horizontalautoscaler_info" metric docs 2021-12-08 18:44:31 +01:00
ingress-metrics.md Add ingressclass to kube_ingress_info metric 2021-12-16 10:59:23 +11:00
job-metrics.md Mark new annotations metrics as EXPERIMENTAL 2021-08-15 18:11:36 +02:00
lease-metrics.md add leases collector 2020-01-30 08:31:01 +03:00
limitrange-metrics.md Merge release-1.7 into upstream/master 2019-08-05 10:46:00 -07:00
mutatingwebhookconfiguration-metrics.md Fix metrics & labels documentation 2020-02-27 20:37:53 +01:00
namespace-metrics.md Mark new annotations metrics as EXPERIMENTAL 2021-08-15 18:11:36 +02:00
networkpolicy-metrics.md Add kube_*_annotations metrics 2021-04-29 16:04:16 +02:00
node-metrics.md Merge remote-tracking branch 'origin/master' into annotations 2021-08-16 08:50:02 +02:00
persistentvolume-metrics.md fix formatting 2022-05-13 12:42:27 -07:00
persistentvolumeclaim-metrics.md Mark new annotations metrics as EXPERIMENTAL 2021-08-15 18:11:36 +02:00
pod-metrics.md kube_pod_nodeselector -> kube_pod_nodeselectors 2022-02-07 11:02:39 -08:00
poddisruptionbudget-metrics.md Implement kube_*_labels and kube_*_annotations metrics for pdb 2021-10-26 21:19:40 +05:30
replicaset-metrics.md Mark new annotations metrics as EXPERIMENTAL 2021-08-15 18:11:36 +02:00
replicationcontroller-metrics.md Add kube_replicationcontroller_owner 2020-02-18 22:24:17 +01:00
resourcequota-metrics.md Merge release-1.7 into upstream/master 2019-08-05 10:46:00 -07:00
secret-metrics.md Mark new annotations metrics as EXPERIMENTAL 2021-08-15 18:11:36 +02:00
service-metrics.md Upgrade doc for service metrics of add uid 2022-02-20 00:36:28 +08:00
statefulset-metrics.md Merge remote-tracking branch 'origin/master' into annotations 2021-08-16 08:50:02 +02:00
storageclass-metrics.md Mark new annotations metrics as EXPERIMENTAL 2021-08-15 18:11:36 +02:00
validatingwebhookconfiguration-metrics.md Fix metrics & labels documentation 2020-02-27 20:37:53 +01:00
verticalpodautoscaler-metrics.md Add kube_*_annotations metrics 2021-04-29 16:04:16 +02:00
volumeattachment-metrics.md volumeattachment: Fix instrumentation guideline violation 2020-04-08 10:55:33 +02:00

README.md

Documentation

This documentation is intended to be a complete reflection of the current state of the exposed metrics of kube-state-metrics.

Any contribution to improving this documentation or adding sample usages will be appreciated.

Table of Contents

Metrics Stages

Stages about metrics are grouped into three categories

Stage Description
EXPERIMENTAL Metrics which normally correspond to the Kubernetes API object alpha status or spec fields and can be changed at any time.
STABLE Metrics which should have very few backwards-incompatible changes outside of major version updates.
DEPRECATED Metrics which will be removed once the deprecation timeline is met.

Opt-in Metrics

As of v2.3.0, kube-state-metrics supports additional opt-in metrics via the CLI flag -metric-opt-in-list. See the metric documentation to identify which metrics need to be specified.

Exposed Metrics

Per group of metrics there is one file for each metrics. See each file for specific documentation about the exposed metrics:

Join Metrics

When an additional, not provided by default label is needed, a Prometheus matching operator can be used to extend single metrics output.

This example adds label_release to the set of default labels of the kube_pod_status_ready metric and allows you select or group the metrics by Helm release label:

kube_pod_status_ready * on (namespace, pod) group_left(label_release) kube_pod_labels

Another useful example would be to query the memory usage of pods by its phase, such as Running:

sum(kube_pod_container_resource_requests{resource="memory"}) by (namespace, pod, node)
  * on (namespace, pod) group_left() (sum(kube_pod_status_phase{phase="Running"}) by (pod, namespace) == 1)

CLI Arguments

Additionally, options for kube-state-metrics can be passed when executing as a CLI, or in a kubernetes / openshift environment. More information can be found here: CLI Arguments