Kubernetes module has few metricsets with a quite complex code that probably can be improved, make it more clear or test more code. "Offending" metricsets are:
state_deployment
state_pod
state_replicaset
state_statefulset
Ideally, all of them should work in a similar way, like state_container does with this small snippet:
func TestEventMapping(t *testing.T) {
ptest.TestMetricSet(t, "kubernetes", "state_container",
ptest.TestCases{
{
MetricsFile: "../_meta/test/kube-state-metrics",
ExpectedFile: "./_meta/test/kube-state-metrics.expected",
},
{
MetricsFile: "../_meta/test/kube-state-metrics.v1.3.0",
ExpectedFile: "./_meta/test/kube-state-metrics.v1.3.0.expected",
},
},
)
}
Kubernetes module has few metricsets with a quite complex code that probably can be improved, make it more clear or test more code. "Offending" metricsets are:
state_deploymentstate_podstate_replicasetstate_statefulsetIdeally, all of them should work in a similar way, like
state_containerdoes with this small snippet: