Skip to content
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

hostmetrics: Remove slab reclaimable from cache #14909

Closed
rmfitzpatrick opened this issue Oct 12, 2022 · 13 comments
Closed

hostmetrics: Remove slab reclaimable from cache #14909

rmfitzpatrick opened this issue Oct 12, 2022 · 13 comments

Comments

@rmfitzpatrick
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently the library used by the hostmetrics receiver to report cached memory includes slab reclaimable memory in its calculation despite this not being the literal value provided by /proc/meminfo (introduced in shirou/gopsutil#617). This can be unexpected as the receiver's memory scraper also provides usage and utilization values for the slab reclaimable value itself and the fact that this happens isn't advertised in this project.

Describe the solution you'd like

Calculate the linux cached memory by subtracting the advertised slab reclaimable memory so the reported values reflect what's provided by procfs.

Describe alternatives you've considered

Leaving this alone is viable, but I think at minimum the aggregate value should be advertised in the scraper readme.

Additional context

I've not done a comprehensive audit of different offerings but anecdotally sysstat/sar and the legacy sfx smart agent don't conflate the two values.

@rmfitzpatrick rmfitzpatrick added enhancement New feature or request needs triage New item requiring triage labels Oct 12, 2022
@evan-bradley evan-bradley added priority:p2 Medium receiver/hostmetrics and removed needs triage New item requiring triage labels Oct 13, 2022
@github-actions
Copy link
Contributor

Pinging code owners: @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Dec 13, 2022
@fatsheep9146
Copy link
Contributor

@rmfitzpatrick do you have interest in contributing this?

@github-actions github-actions bot removed the Stale label Dec 13, 2022
@rmfitzpatrick
Copy link
Contributor Author

@fatsheep9146 yes I'd be happy to open a PR w/ the proposed change.

@fatsheep9146
Copy link
Contributor

@fatsheep9146 yes I'd be happy to open a PR w/ the proposed change.

Thanks! It's yours! @rmfitzpatrick

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Feb 13, 2023
@dmitryax dmitryax removed the Stale label Feb 13, 2023
@dmitryax
Copy link
Member

There is an ongoing effort to move slab states to another metric:

@rmfitzpatrick feel free to weigh in

I believe we can keep the cached state as is if we remove the slab states

@rogercoll
Copy link
Contributor

I think this solution will also need to modify the used value provided by Gosputils as it is made by cached state: https://github.com/shirou/gopsutil/blob/0969c9436bc0d9bf190face9c4a3c4a430b98523/mem/mem_linux.go#L313

    // Total memory removing slab from catched
    memStats, _ := mem.VirtualMemory()
    newCached := memStats.Cached - memStats.SReclaimable
    newUsed := memStats.Total - memStats.Free - memStats.Buffers - newCached
    fmt.Println(memStats.Total == newUsed+newCached+memStats.Free+memStats.Buffers)

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Oct 23, 2023
@dmitryax dmitryax removed the Stale label Oct 23, 2023
Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Dec 25, 2023
Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants