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

Metric for Dirty memory (Linux exclusive) #1998

Open
braydonk opened this issue Mar 17, 2025 · 2 comments
Open

Metric for Dirty memory (Linux exclusive) #1998

braydonk opened this issue Mar 17, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request experts needed This issue or pull request is outside an area where general approvers feel they can approve

Comments

@braydonk
Copy link
Contributor

Propose new conventions

I'd like to introduce two new Linux-exclusive metrics for Dirty memory:

  • system.memory.dirty
  • system.memory.dirty.page.count

system.memory.dirty will be the bytes from /proc/meminfo's Dirty field. system.memory.dirty.page.count will be that number divided by getconf PAGESIZE. I did some research to determine why I think this will produce an accurate number which you can audit here: https://gist.github.com/braydonk/78ff4581be2056c0b3e77b471088258a

This issue will be blocked on #1932. These will be Specialist Class metrics, and they will be OS exclusive, so the name will either start with linux or be system.linux.

@braydonk
Copy link
Contributor Author

I forgot to add: Why should page.count be a separate metric?

This a pretty simple calculation on the surface, but the reason I think it should be a separate metric is because getting the configured page size from the system is better done by instrumentation. In the Collector we could theoretically add getting the page size as a function in OTTL or something, but it is far simpler for the source reporting the metric to get this information and use it in the calculation than for users to have to configure something extra.

@braydonk
Copy link
Contributor Author

In the PR for open-telemetry/opentelemetry-collector-contrib#38672 Dmitrii brought up a good point that introducing a page.count metric could open up the floodgates for all sorts of memory metrics to have their own duplicate *.page.count metrics. To get around the issue mentioned in my previous comment, we are going to introduce system.memory.page_size as a separate metric that can be used in calculations for any other metrics that may come in the future similar to this one where a calculated pagesize would make sense (i.e. any other metrics from /proc/meminfo which are similarly calculated to kB from page numbers).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request experts needed This issue or pull request is outside an area where general approvers feel they can approve
Development

No branches or pull requests

1 participant