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

Support ZGC in JvmGcMetrics #2305

Closed
shakuzen opened this issue Oct 26, 2020 · 4 comments · Fixed by #2306
Closed

Support ZGC in JvmGcMetrics #2305

shakuzen opened this issue Oct 26, 2020 · 4 comments · Fixed by #2306
Labels
enhancement A general enhancement
Milestone

Comments

@shakuzen
Copy link
Member

shakuzen commented Oct 26, 2020

Similar to #1861 for ZGC. See the OpenJDK Wiki for ZGC for more information on it. In addition to GC pause time metric (jvm.gc.pause) which should already work, we should support the following when using ZGC:

  • jvm.gc.max.data.size
  • jvm.gc.live.data.size
  • jvm.gc.memory.allocated
@shakuzen shakuzen added the enhancement A general enhancement label Oct 26, 2020
@shakuzen shakuzen added this to the 1.6.0 milestone Oct 26, 2020
shakuzen added a commit to shakuzen/micrometer that referenced this issue Oct 26, 2020
There were some assumptions in JvmGcMetrics that the garbage collector was generational, with a designated young and old region. ZGC and Shenandoah are examples of OpenJDK garbage collectors that are not generational. GC metrics should be properly recorded with these changes.

Resolves micrometer-metrics#1861
Resolves micrometer-metrics#2305
shakuzen added a commit that referenced this issue Oct 28, 2020
There were assumptions in JvmGcMetrics that the garbage collector was generational, with designated young and old regions. ZGC and Shenandoah are examples of OpenJDK garbage collectors that are not generational. GC metrics should be properly recorded for them with these changes.

Resolves #1861
Resolves #2305
@crohit
Copy link

crohit commented Jan 20, 2024

Hi @shakuzen - sorry to bug on this old post with this question, but I recently upgraded to zgc for a repo at work and am wondering what are the metrics available for zgc.

action:end_of_gc_pause,cause:proactive
action:end_of_gc_pause,cause:warmup

These are the only ones I see. Are there more metrics I should be seeing? Including any other causes and actions?

@shakuzen
Copy link
Member Author

Are there more metrics I should be seeing? Including any other causes and actions?

Not until more actions and causes happen in your application after JvmGcMetrics is bound to a registry. The metrics are dynamically registered in response to GC notifications. Until GC events happen in your application, there won't be any metrics recorded for them. We do not register metrics for GC events until they happen. You could, for example, force a GC in your application (with e.g. System.gc() or JMX or jconsole) and see GC metrics recorded in response to that. Does that make sense and clear up what's happening?

@crohit
Copy link

crohit commented Jan 24, 2024

Are there more metrics I should be seeing? Including any other causes and actions?

Not until more actions and causes happen in your application after JvmGcMetrics is bound to a registry. The metrics are dynamically registered in response to GC notifications. Until GC events happen in your application, there won't be any metrics recorded for them. We do not register metrics for GC events until they happen. You could, for example, force a GC in your application (with e.g. System.gc() or JMX or jconsole) and see GC metrics recorded in response to that. Does that make sense and clear up what's happening?

Ah yeah that clears up- Let me go back and look into this. Are there other notifications which are emitted on GC that I know I should look out for when a GC is run?

@shakuzen
Copy link
Member Author

Are there other notifications which are emitted on GC that I know I should look out for when a GC is run?

We don't keep an exhaustive list because it is up to what the garbage collector has implemented, which can change between versions of the JVM. Unfortunately, I'm not aware of good documentation on this from each collector either.

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

Successfully merging a pull request may close this issue.

2 participants