-
Notifications
You must be signed in to change notification settings - Fork 25
Replace container-stats with golang client #2188
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #2188 +/- ##
=======================================
Coverage 28.83% 28.83%
=======================================
Files 96 96
Lines 5799 5799
Branches 2551 2551
=======================================
Hits 1672 1672
Misses 3408 3408
Partials 719 719
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Use CRI/Docker API clients to get container stats information, instead of spinnig up a new container (which can fail to mount docker socket and thus provide no information).
4dfd831
to
0518786
Compare
/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.
Hey @erthalion - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Left a few comments, I'm a bit worried about the synchronization aspect of the array of stats, though I might be worrying too much.
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
6ac3cba
to
b966ef2
Compare
d6ef382
to
de49422
Compare
de49422
to
69f6742
Compare
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!
Description
Currently we use a separate container to capture Collector container
performance stats. This container mounts docker/podman socket and uses
corresponding cli to get the data. But in some cases (e.g. SUSE) we can't mount
the socket, hence the approach doesn't work.
Use CRI/Docker API clients to get container stats information instead. This is
more direct approach, which allows to trim number of containers and overall
tests churn. The stats capturing is implemented as a cancelable background go
routine, which is started/stopped accordingly to start/stop of the Collector
container.
One side effect of this approach is different reporting units. Previously we
were reporting data in human readable form (megabytes or cpu utilization
percentage), now it's going to be more prometheus style -- bytes and millicores
used. Since the idea is to compare stats before different commits, I don't
think it's worth the effort to convert the numbers to keep the original format.
Note that docker go package bump is needed to use some functionality.
On top of that fix small anomaly -- ProcfsScraper test was using executor
object directly, instead of going through a getter.
Checklist
- [ ] Updated documentation accordinglyAutomated testing
- [ ] Added unit tests- [ ] Added integration tests- [ ] Added regression testsCI is sufficient.
Testing Performed
Running TestCollectorStartup and verifying stats.