-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[metricbeat] check for a valid limit before we process a memory event #11676
[metricbeat] check for a valid limit before we process a memory event #11676
Conversation
+1 It would be probably very expensive to Not needed, but a bit more awesomeness and love if setting a proper variable name to something like
|
@odacremolbap Yah, I kinda gave those variable name the side-eye earlier too. |
@@ -22,6 +22,7 @@ import ( | |||
"github.com/elastic/beats/metricbeat/module/docker" | |||
) | |||
|
|||
//MemoryData contains parsed container memory info |
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.
a space here would be great :-) "// MemoryData..." and same in line 38
Can you add a changelog entry? Also added |
Looks like coredns is failing here now too: |
Let's try to rebase. |
3b7511c
to
6cad5e7
Compare
…elastic#11676) * check for a valid limit before we process a memory event (cherry picked from commit 97aec9b)
…elastic#11676) * check for a valid limit before we process a memory event (cherry picked from commit 97aec9b)
It seems it was already backported, I am removing the needs_backport label. |
This fixes #11283
It appears that we can get a stat object back when a container is in some odd in between state where it's not actually started. During this time, all the memory values we're using are zero, and we get NaNs from the division operations:
The docker source states that
Limit
will only be 0 if a container isn't started, so we use that to check if we have a valid event. We can also process the event and just wrap the division inif
blocks, but I liked the idea of skipping the event if we have zero'ed out data.