kubernetes-monitoring / kubernetes-mixin

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

Fix: Handle float apiserver buckets #935

Closed SuperQ closed 4 days ago

SuperQ commented 3 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 1 month ago

Ping @povilasv :)

povilasv commented 1 month 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 1 month 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 1 month ago

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

skl commented 1 week ago

Suggest we take #965 and close this one.