-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat: add useMemAvailable feature gate #42223
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
feat: add useMemAvailable feature gate #42223
Conversation
The useMemAvailable feature gate will use the MemAvailable kernel's statistic to compute the "used" memory usage.
ChrsMark
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.
receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux.go
Show resolved
Hide resolved
receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux.go
Outdated
Show resolved
Hide resolved
…mory_scraper_linux.go Co-authored-by: Braydon Kains <93549768+braydonk@users.noreply.github.com>
|
|
||
| var useMemAvailable = featuregate.GlobalRegistry().MustRegister( | ||
| "receiver.hostmetricsreceiver.UseLinuxMemAvailable", | ||
| featuregate.StageAlpha, |
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 like we already moved to the updated Used from gopsutil. So we don't need this PR anymore. Or we can make it beta to not get back
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.
Good catch, moved to beta so users can still roll out to the previous formula
ecec14d to
ff010f5
Compare
receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux.go
Outdated
Show resolved
Hide resolved
…mory_scraper_linux.go
Description
The useMemAvailable feature gate will use the MemAvailable kernel's statistic to compute the "used" memory usage. The PR performs the calculation of Used memory by using the raw memory values, this will prevent having a different "Used" value once gopsutil upgrades.
Link to tracking issue
Fixes #42221
Testing
Added a unit test to verify the formulas result to different values.
Documentation