Search code examples
prometheusgrafanapromql

Prometheus Difference jvm_gc_collection_seconds_sum and jvm_gc_pause_seconds


I found this article where GC Throughput is queried in Prometheus/Grafana as follows:

min by(job)(100 - (sum by (job, instance)(increase(jvm_gc_collection_seconds_sum[1m])) * 100 / sum by (job, instance) (increase(process_cpu_seconds_total[1m]))))

The author takes the metric besides others jvm_gc_collection_seconds_sum to compute GC Throughput. When I look to my Spring Boot Prometheus endpoint I do not find this metric but find instead jvm_gc_pause_seconds. It is stated:

 #HELP jvm_gc_pause_seconds Time spent in GC pause

Is there a difference between this two metrics?

Thanks a lot!


Solution

  • jvm_gc_collection_seconds_sum
    

    is a Prometheus client metric. Now Prometheus client is no more developed for Spring Boot 2.

    jvm_gc_pause_seconds or jvm_gc_pause_seconds_sum
    

    is a Micrometer client metric that is used in Spring Boot.