-
Notifications
You must be signed in to change notification settings - Fork 992
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
base: main
Are you sure you want to change the base?
Conversation
@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. |
@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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Resolves 5234