Skip to content

feat(monitor): add kube_horizontalpodautoscaler_*

Steve Xuereb requested to merge feat/kube-horizontalpodautoscaler-rename into master

Background

Part of the prometheus-stack helmchart upgrade in https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/13973 kube-state-metrics is upgraded from v1.9.7 to v2.2.0. There are some breaking changes with the major version bump.

https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/13973#note_710138098 describes all the breaking changes in detail. The one we are intersted in is

[CHANGE] v2: Rename hpa metrics to use full horizontalpodautoscaler
`#1003` All metrics with prefix of kube_hpa_ were renamed to
kube_horizontalpodautoscaler_

Right now gstg and pre are using the latest version (v2.2.0) of kube-state-metrics which uses kube_horizontalpodautoscaler_ whilst gprd is still using kube_hpa_

Solution

The solution tires to be backword compatable as much as possible, by following a Two-phase deployment by introducing the new metrics the same way as kube_hpa is being used.

The alert rules are set to s4 because on gprd it's going to trigger since there are no metrics and we can bump them to s2 and s3 like kube_hpa when

kube_hpa_ will be removed in a follow up merge request when the kube-state-metrics version is upgraded in gprd

reference https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/13973

Edited by Steve Xuereb

Merge request reports