-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicated custom resource metrics when exposed for builtin type #2044
Comments
Can you please also add the kubernetes object you have created at your cluster (the storageclass)? |
Yes, could you list all CRs for this CRD (storage.k8s.io)? Guess there are two CRs. |
and the endpoint result is
not all resources are exposed as they do not have property I want to expose and they are skipped IIUC |
Additionally, I'd like to mention here that this is not quite the way things were meant to be defined (native resources in the CRS config) since, in a nutshell, this is something that, while being technically possible pre-#1851, was never really officially supported (it'd always conflict with the native store for the builtin type), even if users got the desired metrics up somehow. EDIT. A bit more context.
2nd EDIT.
|
I have also encountered this issue. It was not present in 8.7.0 For me, it occurs when I specify a
I believe it was introduced by #1928 kube-state-metrics/pkg/app/server.go Lines 176 to 180 in 3b95dd1
kube-state-metrics/pkg/app/server.go Lines 189 to 192 in 3b95dd1
See that custom resources will be added twice as a result of this - once from I think the fix should be either: 1. Revert back to the v2.7.0 implementation: kube-state-metrics/pkg/app/server.go Lines 137 to 140 in abe3fd3
This means that when using both Personally I think this is the best option. When using OR 2. Add logic to remove duplicates from the I can open a PR to fix this if that helps |
Putting it out there that this is still the case, and the later built (custom) stores are the only ones in effect. DetailsNative Store (registered first)CRS Store (overrides the native store)CRS configuration that was used (to build custom
|
@grzesuav I'm not sure if it's possible (I'm leaning towards the contrary based on my understanding), but is it possible for KSM to expose metrics for the same native and CRS object (for instance,
I'm trying to understand how will this be facilitated from one KSM process, because AFAIR this was never the supported behavior (same internal object under both flags), and shouldn't be possible without the CR store overriding the native one. Can you provide the compete command (flags, and args) you're using to invoke KSM that allow you to "add" custom metrics for native objects on top of the original metrics exposed natively by KSM for the same object? |
I found out that |
/triage accepted |
This issue has not been updated in over 1 year, and should be re-triaged. You can:
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/ /remove-triage accepted |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Closing as the custom resource metrics feature is not meant to be used on builtin types. |
Come across the same issue. I created CRS metrics for volumeSnapshots and volumeSnapshotContent resources and they all have duplicates. Despite those being built-in classes KSM does not provide any metrics for them. As I see right now there is no solution other rather then to run two separate KSM instances for custom resource metrics and for built-in objects |
What happened:
Wanted to expose additional information for storageclass, expanded the config
I noticed that they are exposed twice, which makes it impossible to be scraped by prometheus (metrics are duplicated)
What you expected to happen:
Metrics are exposed once
How to reproduce it (as minimally and precisely as possible):
Use the config provided with k-s-m and kind cluster
Anything else we need to know?:
Full logs
Environment:
2.8.0
kubectl version
): 1.25 and 1.26The text was updated successfully, but these errors were encountered: