CatherineF-dev

Results 236 comments of CatherineF-dev

I can reproduce this issue (metric values are not put together for one same metric) using https://github.com/kubernetes/kube-state-metrics/issues/2223#issuecomment-1792850276. ``` $ curl localhost:8089/metrics # HELP cr_creationtimestamp # TYPE cr_creationtimestamp gauge cr_creationtimestamp{customresource_group="example.com",customresource_kind="Bar",customresource_version="v1",name="mybar"} 1.700534671e+09...

I think the issue is here https://github.com/kubernetes/kube-state-metrics/blob/main/internal/store/builder.go#L210 ``` availableStores[gvrString] = func(b *Builder) []cache.Store { return b.buildCustomResourceStoresFunc( f.Name(), f.MetricFamilyGenerators(), f.ExpectedType(), f.ListWatch, b.useAPIServerCache, ) } ``` 1. It always sets new values...

Hi @k15r, could you provide detailed steps to reproduce this issue? The first issue I want to fix is this: ``` curl localhost:8089/metrics # HELP cr_creationtimestamp # TYPE cr_creationtimestamp gauge...

Could you try https://github.com/kubernetes/kube-state-metrics/pull/2257 to see whether `repeated adding and deleting CustomResourceDefinitions causes duplicate metric entries` is fixed?

I can have a look. Will try reproducing this issue to understand what happened.

I prefer label selectors which is native in k8s. qq: why do you want to change labels? Want to see whether it's a common use case or not.

From my experience, `label selector` is more dynamic and unique compared to `field selector`. I was considering a case where there are two KSMs running (it happens when deploying another...

> `change the label kubectl patch sts kube-state-metrics -n kube-system --patch '{"metadata": {"labels": {"app.revision": "2"}}}'` qq: why do you want to update label here? What are the use cases of...

> So here in the [AddFunc of the SharedIndexInformer](https://github.com/kubernetes/kube-state-metrics/blob/main/pkg/metricshandler/metrics_handler.go#L125) and [in the UpdateFunc](https://github.com/kubernetes/kube-state-metrics/blob/main/pkg/metricshandler/metrics_handler.go#L148) we check for the name isn't that equivalent of a field selector? because if we filter out...

> two KSMs separate namespace different name Was considering same name case. It might be a breaking change to users who use labelSelector to differentiate two KSMs.