Used memory should be based on operating system's internals#2534
Merged
lmolkova merged 6 commits intoopen-telemetry:mainfrom Aug 7, 2025
Merged
Used memory should be based on operating system's internals#2534lmolkova merged 6 commits intoopen-telemetry:mainfrom
lmolkova merged 6 commits intoopen-telemetry:mainfrom
Conversation
braydonk
approved these changes
Jul 17, 2025
mx-psi
reviewed
Jul 17, 2025
Contributor
Author
lmolkova
approved these changes
Jul 19, 2025
mx-psi
approved these changes
Aug 7, 2025
joaopgrassi
pushed a commit
to dynatrace-oss-contrib/semantic-conventions
that referenced
this pull request
Aug 18, 2025
ShipraJain01
pushed a commit
to ShipraJain01/semantic-conventions
that referenced
this pull request
Aug 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR clarifies the expected value of the
usedmemory attribute on Linux systems, specifying that it should be derived fromMemAvailablefor a more accurate representation of memory usage.On Linux, using MemAvailable breaks the assumption that the sum of all
system.memory.statevalues equalssystem.memory.limit. However, this assumption is only valid because the current used value is derived indirectly from the limit and other memory states (total - free - buffers - cached), which can misrepresent actual memory pressure (with some issues). If the current used state is derivable, I recommend redefining it to reflect a more meaningful value that cannot be derived—specifically one based on MemAvailable—and making system.memory.limit enabled by default.While the proposed used value can still be calculated from the optional system.memory.limit and system.linux.memory.available metrics, doing so requires awareness of the current used state’s inaccuracy and explicit user configuration. This change aims to promote a more accurate and meaningful metric for memory usage in Linux environments.
Context: shirou/gopsutil#1873
Repository to test the different formulas: https://github.com/rogercoll/linux-memory-metrics
Merge requirement checklist
[chore]