Skip to content

Commit 19d3c3c

Browse files
committed
Add some info about 1:1/1:n relationships
1 parent 7ac9968 commit 19d3c3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/design/metrics-best-practices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ This way kube-state-metrics allows the user to have full control on how they wan
3131
### Static object properties
3232

3333
An object usually has a stable set of properties that do not change during its lifecycle in Kubernetes.
34-
This includes properties like name, namespace, uid etc.
34+
This includes properties like name, namespace, uid etc. that have a 1:1 relationship with the object.
3535
It is a good practice to group those together into an `_info` metric.
36+
If there is a 1:n relationship (e.g. a list of ports), it should be in a separate metric to avoid generating too many metrics.
3637

3738
### Dynamic object properties
3839

@@ -41,7 +42,6 @@ These change during the lifecycle of the object.
4142
For example a pod can be in different states like "Pending", "Running" etc.
4243
These should be part of a "State Set" that includes labels that identify the object as well as the dynamic property.
4344

44-
For example:
4545

4646
### Linked properties
4747

0 commit comments

Comments
 (0)