-
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
Duplicate kube_horizontalpodautoscaler_spec_target_metric #2403
Comments
The main issue is that you don't get a specific metric for each ContainerResources trigger when using multiple (assuming the same resource name and target type). It generates the same metric with the same label values. e.g:
you get all
As @dmitriishaburov suggested, one option would be to have a container label. However, we need to consider what value it would have when using Another option would be to have separate metrics for |
/assign |
Looking at the HPA API the problem should exist for ContainerResource and Object metrics because in both scenario we don't differentiate based on the object that is targeted by the rule. As you rightfully mentionned @sansalva there are two options, either we keep the same metrics and add new labels or split the metric into new ones for each metric type. For the first one, the problem with some metric types not referencing objects is fine since we don't have to expose these labels for them. But, it would still kind of add some level of complexity to the metric. I like the second option since the metric is still experimental so we can make changes to it. It will surely break some users but we didn't provide guarantees for this metrics. So as long as we make a smooth transition it should be fine.
Although I can see your point with sharing a mutual base concept, the metric types are essentially different APIs at this point. Each have their own way to referencing their target resource. For Pods, Custom and External it is still very similar APIs but for the newer Object and ContainerResource they are completely different. Because of that, I think it is reasonable to split the metric in more dedicated ones.
Not necessarily, you could use a promQL query to perform a join of the different metrics. |
@dmitriishaburov @sansalva if any of you want to try to take a stab at this and fix the issue, feel free to assign it to yourself by typing /help |
@dgrisonnet: GuidelinesPlease ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Hi, For the second option thx! |
What happened:
Duplicate
kube_horizontalpodautoscaler_spec_target_metric
causing issues with Prometheus 2.52.0+Due to new duplicates detection mechanism, I'm seeing following errors in Prometheus:
After checking kube-state metrics I've found that metrics for HPA are duplicated:
HPA itself have 3 separate entries for CPU, but there's different on container:
What you expected to happen:
kube-state-metrics not producing duplicate metrics, probably by adding container label (?)
How to reproduce it (as minimally and precisely as possible):
Environment:
kubectl version
): v1.28.9-eks-036c24bThe text was updated successfully, but these errors were encountered: