Skip Pod metrics if any container skipped#1781
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dippynark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @dippynark. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/assign @RainbowMango |
|
/ok-to-test |
|
@dippynark thank you for the contribution. Do you think you could write a test for the scenario you described? |
|
/triage accepted |
What this PR does / why we need it:
Currently, if a container's start time or CPU seconds decreases, we exclude that container's resource usage from the exposed metrics for its Pod:
metrics-server/pkg/storage/types.go
Lines 54 to 59 in 78192ed
In particular, if a Pod has multiple containers and one of the containers hits this condition, the Pod's metrics are still reported but with that container's contribution excluded. This can look like the Pod's utilisation is significantly lower than it actually is which can be especially problematic when using this information for horizontal or vertical scaling.
This PR changes this behaviour to exclude the entire Pod, favouring accurate metrics over unreliable/inconsistent metrics.