-
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] Add windows memory data to docker/memory #12172
[metricbeat] Add windows memory data to docker/memory #12172
Conversation
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.
This looks quite good to me if we cannot consider that Windows metrics are more or less equivalent to Linux ones.
@@ -66,5 +70,9 @@ func (s *MemoryService) getMemoryStats(myRawStat docker.Stat, dedot bool) Memory | |||
TotalRssP: float64(totalRSS) / float64(myRawStat.Stats.MemoryStats.Limit), | |||
Usage: myRawStat.Stats.MemoryStats.Usage, | |||
UsageP: float64(myRawStat.Stats.MemoryStats.Usage) / float64(myRawStat.Stats.MemoryStats.Limit), |
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 wonder if these percentages are NaN because of 0/0 on Windows, we should probably check for these limits not being 0. Though it wouldn't be so important now if we send different fields for Windows.
"pct": memoryData.UsageP, | ||
"max": memoryData.MaxUsage, | ||
}, | ||
} |
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 am fine with this approach if we cannot consider these metrics equivalent to others on Linux. The private working set could be similar to the RSS, and commit and commit peak could be similar to usage and max usage, but not sure.
Probably @narph or @andrewkroh can shed more light about this.
If they are equivalent or similar enough we should send them in the same fields.
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.
Commit - memory space the application has reserved for use, so this will be allocated but not necessarily used. (This is composed of main memory (RAM) and disk (pagefiles).)
CommitPeak - the highest amount that the commit has reached since the operating system was last started or session.
PrivateWorkingSet - the amount of memory used by a process.
Not sure the memory stats are matching here so I would go for separate naming, we might want to look into that as well for the other memory related metricsets
fields = common.MapStr{ | ||
"commit": memoryData.Commit, | ||
"commit_peak": memoryData.CommitPeak, | ||
"private_working_set": memoryData.PrivateWorkingSet, |
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.
Follow the structure of Linux metrics, in case some day docker supports limits in Windows and we can calculate percentages.
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.
++
Adjusted things a tad so now we have commited bytes in Regarding @jsoriano 's comments: I agree that we should make these more consistent, and that things like |
2ab8496
to
bd22180
Compare
Yeah, that's actually a point to discuss. The good thing of having all the equivalent metrics in the same fields is that you can build dashboards or queries showing this information together more easily. One option can be to keep OS-specific fields, but also duplicate these values into common fields. This could be added afterwars in any case. |
That's one option, yah! We did something similar with the RAID metricset, where we had a detail section, and a normalized section for RAID states. |
@fearful-symmetry , I have not commented on the initial naming as I found it to be clear enough.
You could go for I would stir away from @jsoriano, Is there a way we can store only the os specific information and utilize the field alias to create a common visualization/dashboard for the user instead of going for duplication? (I have not tried this) |
Thanks for your added input @narph. |
I don't think we can use the alias field for this. Aliases are defined in the index mapping (not per document), and can only be defined in a 1 to 1 way, so we couldn't create an alias pointing to several OS-specific metrics. I'd keep both OS-specific metrics in the events by now as they are different things (thanks @narph for the clarifications!), and we can evaluate later what to do if we create visualizations for this. Maybe this can be solved in the visualization or the dashboard itself. |
@jsoriano So we're good as-is? Should I take this out of draft? |
Yeah, I think this can go for review. Only let me know what you think about this comment https://github.com/elastic/beats/pull/12172/files#r283109849 It would be to change the metrics to something like this:
In case some day we add also percentages or other aggregations. |
Ahh, alright, I wasn't 100% sure what you meant by that, so I figured the |
Okay, I think I'm confusing myself with the fields.yml format, but it should be good now. |
@fearful-symmetry are you going to do the change for commit and commit peak too?
|
Oh, is that how we want to do it? I figured we could just use the existing |
Okay. Hopefully this makes sense now. |
We are discussing offline about the proper location of the commit metrics
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 couple of comments on documentation, for the rest it LGTM, sorry for the back and forth on field names!
Leaving this as a draft since I'm not 100% sure how to handle vastly different stats across various operating systems. Will probably add more commits later as I tinker around.
This addresses #11971 by adding the memory stats that are only available on windows. The change itself is fairly simple, but I have no practical experience with docker/go on windows, so I would appreciate help from any other folks. I added @narph to the reviewers list as well.