Skip to content

[Hostmetrics: Memory] Difference in values of cached memory #21

@ishleenk17

Description

@ishleenk17

There is a difference in the values being fetched for cached memory.

OTEL reports this metric using system.memory.usage, attribute: cached. On checking the logic, it fetches the cached value from /proc/meminfo and also add the reclaimed memory to it.
https://github.com/shirou/gopsutil/blob/master/mem/mem_linux.go#L297

System Integration: Uses the cached memory directly from /proc/meminfo.

The difference in values seen is exactly equal to the reclaimed memory:

Eg:
[OTEL] system.memory.usage, attr: cached= 6681276416
[OTEL] system.memory.usage, attr: slab_reclaimable = 372350976

[System Integration] = system.memory.cached = 6308524032 = 6681276416-372350976

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions