@@ -116,6 +116,34 @@ requests.
116
116
Resource objects that occur in names should inherit the spelling that is used
117
117
in kubectl, i.e. daemon sets are ` daemonset ` rather than ` daemon_set ` .
118
118
119
+ ### Exception for object state metrics
120
+
121
+ One exception to the component prefix rule is for metrics derived from
122
+ the state of Kubernetes objects. From the users' perspective, controllers are an
123
+ implementation detail of object reconciliation. The collection of controllers
124
+ which comprise a working Kubernetes cluster is viewed as a single system which
125
+ drives objects towards their specified desired state. Metrics concerning a
126
+ given object should be easily discoverable and comparable even when they are
127
+ produced by different controllers. Metrics describing the state of a built-in
128
+ Kubernetes object take the form:
129
+
130
+ ```
131
+ kube_<kind>_<metric>
132
+ ```
133
+
134
+ Metrics describing the state of a custom resource avoids collisions by adding a
135
+ group. Metrics take the form:
136
+
137
+ ```
138
+ kube_[<group>](https://kubernetes.io/docs/reference/using-api/#api-groups)_<kind>_metric
139
+ ```
140
+
141
+ The [ Kube-State-Metrics] ( https://github.com/kubernetes/kube-state-metrics )
142
+ project introduced the original kube_ * prefixed metrics. For examples of
143
+ kube_ * prefixed metrics, refer to the list of
144
+ [ Exposed Metrics] ( https://github.com/kubernetes/kube-state-metrics/tree/master/docs#exposed-metrics )
145
+ in the Kube-State-Metrics documentation.
146
+
119
147
## Dimensionality & Cardinality
120
148
121
149
Metrics can often replace more expensive logging as they are time-aggregated
@@ -213,4 +241,3 @@ metric could look as follows:
213
241
```
214
242
kube_pod_restarts and on(namespace, pod) kube_pod_info{uuid=”ABC”}
215
243
```
216
-
0 commit comments