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

Add environment (system/container) memory metrics #5308

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

fabcmartins
Copy link

Resolves 5234

@pivotal-cla
Copy link

@fabcmartins Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@fabcmartins Thank you for signing the Contributor License Agreement!

public void bindTo(MeterRegistry registry) {
Runtime runtime = Runtime.getRuntime();
if (committedVirtualMemorySize != null) {
Gauge.builder("system.virtualmemory.commited", operatingSystemBean, x -> invoke(committedVirtualMemorySize))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe split the words virtual and memory using virtual_memory for better readability?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I also think that this should be process.virtual_memory.committed. The javadoc on getCommittedVirtualMemorySize says Returns the amount of virtual memory that is guaranteed to be available to the running process.. So, maybe process namespace suits it better than system.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed the gauge.
I also noticed that other metrics are referenced by the class PrometheusSample should I add MemoryMetrics to it? What is its purpose?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System memory metrics
3 participants