wavefrontHQ / wavefront-collector-for-kubernetes

Monitoring Kubernetes Clusters using Wavefront
https://www.wavefront.com/
Other
30 stars 35 forks source link

Collector stopped getting hpa.* metrics #556

Closed jeesmon closed 1 year ago

jeesmon commented 1 year ago

We recently updated collector to a new version (we were running with a quite old version before) and we stopped getting hpa.* metrics. Our kubernetes version is 1.22. Looks like it happened after this commit: https://github.com/wavefrontHQ/wavefront-collector-for-kubernetes/pull/432/files (change from v2beta1 -> v2beta2)

We can see collector showing the following error log

time="2023-01-26T00:04:18Z" level=error msg="invalid type: *v2beta1.HorizontalPodAutoscaler"

So I'm assuming our cluster is still returning v2beta1.HorizontalPodAutoscaler and type casting to v2beta2.HorizontalPodAutoscaler is failing.

Any advice on fixing this issue? Any insight on why version for HPA is changed from v2beta1 -> v2beta2? Is it due to kubernetes version supportability?

Thanks!

jeesmon commented 1 year ago

Looks like it is a bug in collector. Recent change to replace v2beta1 with v2beta in hpa.go did not account that informer is still using v2beta1 for hpa resource type in lister. So lister is returning hpa with v2beta1.HorizontalPodAutoscaler type and pointsForHPA is trying to type cast it to v2beta2.HorizontalPodAutoscaler and failing.

Created this PR to fix it: https://github.com/wavefrontHQ/wavefront-collector-for-kubernetes/pull/557

jeesmon commented 1 year ago

@Jyuqi @mmichael @priyaselvaganesan Could you please take look? Thanks!

priyaselvaganesan commented 1 year ago

Hello @jeesmon, Thank you for bringing this up! We will review the PR and look to get a fix in the upcoming releases.