What is the StateSet behavior on an array of a CustomResourceStateMetrics? #1913
Unanswered
richard-zang
asked this question in
Q&A
Replies: 1 comment
-
This is the code which generates values for state sets: kube-state-metrics/pkg/customresourcestate/registry_factory.go Lines 312 to 352 in 0cbabf9 I assume it will be similar to what you suggested, but feel free to test it out on a real case. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an array of zero or more objects and I want to create a metric where each state has a value of zero or one.
What is the behavior if I try to create a StateSet metric on an array of values?
I see that targeting an array for Gauges will create a metric for each element in the array but I don't see anything that indicates if this works for StateSets.
kube-state-metrics/pkg/customresourcestate/config_metrics_types.go
Line 37 in 0cbabf9
For example, say I had the following CR:
and the following config:
Would I get something like the following?
my_metric{mystate="A"} 1
my_metric{mystate="B"} 1
my_metric{mystate="C"} 0
Beta Was this translation helpful? Give feedback.
All reactions