[Java] Garbage collection metrics not showing up after updating GC strategy to -XX:+UseG1GC

I wanted to test the performance of our app by changing the GC strategy to -XX:+UseG1GC for one JVM in our cluster.

However after app restart I see that the GC related metrics are not shown. I cannot see the Young, Survivor and Old gen spaces used. The CPU used by Garbage Collection is also empty.

Here are some notes that I feel are relevant to debug this issue:

  1. In " Metric Normalization rules" I see that for “.*” we have the action “Deny new metrics”.
  2. Only one JVM in the cluster of 7 have this new GC strategy.
  3. JDK version is openjdk version “1.8.0_265”
  4. This is similar to the question - Updated JVM to use G1GC but not seeing any metrics in APM - JVM
  5. The Agent version is 6.2.1

Hello @shankar.pachari,

Great job on the detective work! I was able to find the application in your account with the “Deny new metrics” rule.

The short answer is that yes, these rules can cause JVM metrics to stop reporting. If I had to guess, the reason that you’re no longer seeing GC metrics is that when you changed the GC strategy on the JVM, those new metrics were denied.

The rule itself was put in place on Sept 30th, probably due to some other metrics that caused it. You can read more about “Deny new metrics rules” here: Metric Grouping Issues

That said, since resolving the rule requires sharing sensitive information, I will open a ticket for you. You should receive an email notification.

Cheers,
Giselle

1 Like

@Giselle Thanks for the responses. I can see the new GC metrics for this JVM now. Can I make the “Deny new metrics” option active again? I am not sure why it was placed earlier and would prefer it to be active.

@shankar.pachari Glad to hear the metrics are showing now! Actually you don’t want the “Deny new metrics” rule turned on. That was automatically put in place by our collector’s, probably because of a Metric Grouping Issue.

If it was left enabled, then in the future there may be other metrics that don’t get reported because they happen to be ‘new’. Deny new metrics rules are kinda like a gatekeeper - only the ‘metric names’ already coming in are allowed, not new ones until the others have aged out. In your case, the new ones were the GC metrics after you made the config change.

It’s much better to use the Metric Normalization tool as you did to better group the Transactions, and avoid a new MGI. Just keep in mind that if you make a rule, the “Deny new metrics” rule still needs to be turned off by support. Additionally, there are some other tips in this guide for solving a Java MGI:

2 Likes