kubernetes / kube-state-metrics

Add-on agent to generate and expose cluster-level metrics.
https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/
Apache License 2.0
5.2k stars 1.92k forks source link

Metric type INFO is not registered in prometheus client model type #2420

Open alileza opened 2 weeks ago

alileza commented 2 weeks ago

What happened: The fact that INFO is not a valid type on prometheus client model, it prevent us to use prometheus tooling such as prom2json. Parsing custom resource definition that contains info would cause an error like unknown metric type "info"

What you expected to happen: I would expect kube-state-metrics with a custom resource definition info should still return a valid type that recognizable by prometheus client_model. I'm thinking either UNTYPED or simply GAUGE with value always 1 should be acceptable

How to reproduce it (as minimally and precisely as possible): Create custom resource definition with type info, then try to parse it using prom2json, like curl localhost:8080/metrics | prom2json

error reading metrics: reading text format failed: text format parsing error in line 26: unknown metric type "info"

Anything else we need to know?:

Environment:

Serializator commented 5 days ago

Though not exactly the same context, a similar discussion about this happened in #2248 in November of last year as well as a newer issue in #2366 from last month.

dgrisonnet commented 1 day ago

/assign @rexagod /triage accepted