Repository navigation
Add GC name to gc pause metric - #3670
Conversation
6aa3552 to
1f1a6aa
Compare
1f1a6aa to
7baac0d
Compare
|
I like the idea and agree it would be very useful to have an identifier for the configured collector as a tag on the GC metrics. Unfortunately, I think the G1GC Serial Parallel ZGC Shenandoah gencon balanced optavgpause / optthruput metronome nogc |
|
@shakuzen The list you shared is the ideal values I have intended for the tag "gc_name". The reasons for that instead of just "G1" - G1 Young Generation / G1 Old Generation makes more sense. We had more success with this in identifying whether the Gc is for the young gen or the old gen and the name of the Gc. Today, "jvm.gc.pause" has "action" which says whether it is the end of minor or major Gc or pause, and having the Gc name will make this gcAction less useful and we can have a single metric for both the scenarios. |
|
@shakuzen Also to add, "gc" falls under the OpenTelemetry Sematic Convention as well. Not sure how much of the OTEL convention matter in micrometer, but here is the OTEL convention on jvm metrics I.
|
I'm not sure I understood the point about action being less useful. That may be true in the specific case of G1GC with this new tag, but we need to support many GCs and the values used for each of these things varies and is not constant across versions of Java. It may have been better if we recorded the gc time for concurrent phases and stop-the-world phases using the same metric name and a tag separating them, but that would be a breaking change at this point for users relying on the current arrangement. We can consider that separately to this pull request if you think that would be useful.
But the information about minor or major gc for g1gc is already contained in the action, so is it adding any useful information to have young/old in the gc name? Looking at other collectors, surely you can agree that I would be interested to understand more about how this will be used operationally. What kinds of metric queries are you planning to use with this new tag that aren't possible currently or are difficult? Is it more about identifying the collector in use in each application or about comparing metrics values by collector? I hope we can discuss the above more as I think this is important for making sure we're taking the right approach to provide information in the most useful way possible, and so we can understand and recommend a good approach to using this info to other users. Thank you for providing the pull request and sharing your use case. |
|
@shakuzen The basic idea behind having the GC information in the metric is to evaluate the performance of the GCs and also to have insight into the Gc that is actually generating this metric. I agree that for a single application "action" makes sense about the minor/major cycles. But in a hybrid environment where we have around more than 2000 applications running with different Jdk and with different Gc's for the same Jdk, information about the GC itself makes more sense. We can derive if it is a major/minor GC from the Gc name but we cannot do the same with just "action". |
|
You may also be interested in the It would be interesting to know what you plan to query in the metrics when evaluating GC performance. It sounds more like you want to query gc metrics and know what collector is configured (e.g. find high max pause time applications; then see what collector they're using). As opposed to querying metrics across all your applications filtered or grouped by collector (e.g. sum the pause time for each collector over the last 15 minutes). The former could be achieved by adding the collector name to
That's true for G1GC. It's not true for other collectors. You generally need to look at the name and action. One action can have multiple GC notifications meaning multiple GC metric recordings, potentially with different names even. It's also a general principle of dimensional metrics to not embed multiple pieces of different information (collector name / major or minor collection) in one tag. It shouldn't be a problem either to use multiple tags in querying metrics, so there is no reason it would hurt if the name tag actually was just the name and other tags had other information. |
This is a follow-up PR for 3562. This intends to add the name of the Garbage collector to the "jvm.gc.pause" metric. Though this information might seem trivial for a single application, this really helps at the infrastructure level when 1000's of applications are running with different JDKs and different Gc configurations.