-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix for influxdb container labels and network stats #2184
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
Conversation
Hi @ddtmachado. Thanks for your PR. I'm waiting for a google or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
can we just re-use the whitelisted_container_labels flag? |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks mostly good
@@ -299,14 +319,26 @@ func newStorage( | |||
return nil, err | |||
} | |||
|
|||
//Reuse cadvisor flag for whitelisted container labels | |||
var argWhitelistedLabels = flag.Lookup("whitelisted_container_labels").Value.(flag.Getter).Get().(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather explicitly plumb this through, and do all of the flag parsing when cAdvisor starts if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be done, but I'm not so familiar with the patterns and preferences here yet.
Are you suggesting to pass it down on the storage
constructor or maybe add it to the StorageDriver.AddStats
interface?
I was trying to avoid modifying anything on other storage drivers as I have no context on then but it makes sense that they also respect the labels when storing if possible.
@ddtmachado: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
This fixes the lack of labels when using the influxdb storage.
The driver was referencing an attribute from
ContainerInfo
that was not initialized, resulting in no container labels being stored even when the user set the flags for exporting labels on metrics:store_container_labels / whitelisted_container_labels
. Complements #2113In addition to that I added a new flag
storage_driver_influxdb_whitelisted_labels
only for influxdb, so it is controlled separately but on the same format of #1984Also
Network.Interfaces
was not being used so it only returned stats for the first network interface inside the container (the old behavior). I changed that to collect stats for each network interface adding a tag/label to the metric with the interface name. Fixes #1737What do you think of this approach?
Let me know if I missed something