kubernetes-monitoring / kubernetes-mixin

A set of Grafana dashboards and Prometheus alerts for Kubernetes.
Apache License 2.0
2.11k stars 598 forks source link

Fix: Handle float apiserver buckets #935

Closed SuperQ closed 2 months ago

SuperQ commented 5 months ago

Depending on the version of client_golang and metrics format (Prometheus vs OpenMetrics), bucket names may contain either integer or float formatting.

Use a regexp match to select either format.

SuperQ commented 3 months ago

Ping @povilasv :)

povilasv commented 3 months ago

@SuperQ sorry for delay, given the https://github.com/kubernetes-monitoring/kubernetes-mixin/blob/dd5c59ab4491159593ed370a344a553b57146a7d/rules/kube_apiserver-config.libsonnet#L14 is configureable, can't you just configure differently?

I don't really undertand why we need regex here :thinking:

SuperQ commented 3 months ago

A regexp is needed because different versions of K8s produce different le values depending on a few different factors. Since it's somewhat dynamic, using a regexp makes it compatible with different version. I suppose I could put the regexp changes into the default config.

SuperQ commented 3 months ago

Alternative implementation: https://github.com/kubernetes-monitoring/kubernetes-mixin/pull/965

skl commented 2 months ago

Suggest we take #965 and close this one.