Skip to content

Commit 89ed48f

Browse files
committed
add exception for metric component prefixes for object metrics
1 parent 0bff2ec commit 89ed48f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

contributors/devel/sig-instrumentation/instrumentation.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,28 @@ requests.
116116
Resource objects that occur in names should inherit the spelling that is used
117117
in kubectl, i.e. daemon sets are `daemonset` rather than `daemon_set`.
118118

119+
### Exception for object state metrics
120+
121+
One exception to the component prefix rule is for metrics collected about
122+
the state of kubernetes objects. From users' perspective, controllers are an
123+
implementation detail of object reconciliation. The collection of controllers
124+
which comprise a working kuberntes 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 compareable 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+
119141
## Dimensionality & Cardinality
120142

121143
Metrics can often replace more expensive logging as they are time-aggregated

0 commit comments

Comments
 (0)