-
Notifications
You must be signed in to change notification settings - Fork 2k
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
custom metrics for resources w/ group="" broken, e.g. Node #2434
Comments
PR#1851 introduced accidental breakage for custom metrics on resources with an empty empty, e.g. Node. Fix it, and add tests to catch the next breakage. Reference: kubernetes#1851 Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com> Fixes: kubernetes#2434
PR#1851 introduced accidental breakage for custom metrics on resources with an empty empty, e.g. Node. Fix it, and add tests to catch the next breakage. Reference: kubernetes#1851 Reference: kubernetes#2434 Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com>
PR#1851 introduced accidental breakage for custom metrics on resources with an empty empty, e.g. Node. Fix it, and add tests to catch the next breakage. Reference: kubernetes#1851 Reference: kubernetes#2434 Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com>
PR#1851 introduced accidental breakage for custom metrics on resources with an empty empty, e.g. Node. Fix it, and add tests to catch the next breakage. ``` demo_timestamp{customresource_group="",customresource_kind="Node",customresource_version="v1",node="kind-control-plane"} 1.719618433e+09 ``` Reference: kubernetes#1851 Reference: kubernetes#2434 Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com>
PR#1851 introduced accidental breakage for custom metrics on resources with an empty empty, e.g. Node. Fix it, and add tests to catch the next breakage. ``` demo_timestamp{customresource_group="",customresource_kind="Node",customresource_version="v1",node="kind-control-plane"} 1.719618433e+09 ``` Reference: kubernetes#1851 Reference: kubernetes#2434 Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com>
can confirm this issue, it's silently dropping the metrics. empty group should be allowed and actually the exporter should panic if something is wrong and not silently drop metrics |
same with v2.12.0 |
/assign |
Based on the slack thread and the discussions we've had on the PR, I think we've come to the conclusion that we should reject this particular feature request (the fact that it was originally possible was a bug) as it is out of scope for kube-state-metrics. To quote some of the reasons I gave in the slack thread:
|
@mblaschke although I would normally agree with you for panicking in case of misconfiguration, here we are talking about a dynamic configuration that can be updated at runtime. If a user updating ksm configuration at runtime would cause it to crash that would be quite dreadful. That said I can definitely see a pain point here and maybe we should add a new metrics to report any kind of misconfiguration so that it would be more visible to cluster admin when kube-state-metrics is misconfigured. @rexagod do you have any thoughts on the above? |
Seconding Damien, I'm not for panicking the binary since we expect a reload on configuration change, and then a log (or metric) indicating an issue with the given configuration. Crashing the binary goes against the controller-esque behavior and allows anyone (with access) to crash a running instance simply by supplying a bad config, breaking existing expectations.
+1 all the way. I'll add one. |
What happened:
Custom metrics for resources where group is empty, e.g.
Node
resource do not work. This was a regression between v2.8.2 and v2.9.0What you expected to happen:
Custom metrics should work even with an empty group.
How to reproduce it (as minimally and precisely as possible):
Run kube-state-metrics v2.9.0, compare vs v2.8.2
Error:
This breakage was introduced accidently in #1851
Specifically here:
kube-state-metrics/internal/discovery/discovery.go
Lines 123 to 125 in dc86ade
Anything else we need to know?:
This was previously reported #2333
Rolling KSM back to v2.8.2 and the custom metric DOES work, but that's not an option in production environment due to the need for RBAC features introduced
Environment:
kubectl version
): v1.25.1Screenshot of the metrics working in v2.8.2:
The text was updated successfully, but these errors were encountered: