-
Notifications
You must be signed in to change notification settings - Fork 1.1k
stats: modernize stats collection and implement Pod level stats reporting #5427
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
stats: modernize stats collection and implement Pod level stats reporting #5427
Conversation
3a4b9fe to
cfe818d
Compare
Codecov Report
@@ Coverage Diff @@
## main #5427 +/- ##
==========================================
- Coverage 43.52% 43.45% -0.07%
==========================================
Files 118 120 +2
Lines 11890 11924 +34
==========================================
+ Hits 5175 5182 +7
- Misses 6220 6245 +25
- Partials 495 497 +2 |
|
|
||
| func UpdateWithMemoryStatsFromFile(memoryStatPath, inactiveFileSearchString string, memory *types.MemoryUsage, usage uint64) error { | ||
| var totalInactive uint64 | ||
| f, err := os.Open(memoryStatPath) |
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.
G304: Potential file inclusion via variable
(at-me in a reply with help or ignore)
31e8e0b to
3644f70
Compare
3644f70 to
8f78f4f
Compare
8f78f4f to
1402213
Compare
|
/test integration_fedora |
|
/retest |
saschagrunert
left a comment
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.
Just a few nits, otherwise LGTM
|
@haircommander, can you hold this one till Tomorrow? I'd like to do a review (together with some local tests) on this later Today / Tomorrow morning. |
1402213 to
ebd34ac
Compare
| rssBytes = m.Memory.RSS | ||
| pageFaults = m.Memory.PgFault | ||
| majorPageFaults = m.Memory.PgMajFault |
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.
For kata-containers, this is the part that differs from the approach taken before and that we should ensure the CRI runtime has access to the correct information.
Those are collect, and then passed up to the CRI runtime, here:
https://github.com/kata-containers/kata-containers/blob/e89c06e68bcd465cc79dc68945751a706f230bfe/src/runtime/pkg/containerd-shim-v2/metrics.go#L98-L146
It means that, theoretically, from the kata-containers everything needed here is already provided by kata-containers, but I still need to get to do some more tests on this.
ebd34ac to
e4bb4e6
Compare
6e0436c to
5fec39a
Compare
|
comments addressed, PTAL @cri-o/cri-o-maintainers |
|
Unfortunately this needs a rebase. |
Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
5fec39a to
e34f415
Compare
|
rebased! |
- drop unneeded fields from stats call - remove unneeded variable - replace internal Metadata with CRI type - as well as add CRIAttributes function - update with most remaining required fields for container stats Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
e34f415 to
dec3bf5
Compare
saschagrunert
left a comment
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.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander, kolyshkin, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
@haircommander: The following tests failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
|
/retest-required |
|
/retest-required Please review the full test history for this PR and help us cut down flakes. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
CRI stats has been in sore need of an update, and is targeted to be updated in 1.23. Part of this update is support in the main CRI implementations.
This PR is partially a refactor and partially a feature. In includes cleaning up some code that wasn't actually used and was thus wasteful, bumping CRI to get the new pod level stats calls, adding a StatsServer to give the ability to cache the stats on a periodic basis (rather than collect on-demand, as is default).
There still should be some test updates, but integration tests will be hard before critools adds support for the new fields and cuts a release. In the meantime, lots of this is reviewable.
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?