Describe the bug In our spring boot kubernetes application, all jvm_gc_* (Grabage Collection related) metrics are missing. On checking here: /actuator/prometheus/ I'm only able to fetch jvm_gc_overhead_percent metric and other jvm metrics.

List of jvm matrices available:

# HELP jvm_threads_live_threads The current number of live threads including both daemon and non-daemon threads
# TYPE jvm_threads_live_threads gauge
jvm_threads_live_threads 90.0
# HELP jvm_memory_used_bytes The amount of used memory
# TYPE jvm_memory_used_bytes gauge
jvm_memory_used_bytes{area="heap",id="Tenured Gen",} 7.5198112E7
jvm_memory_used_bytes{area="nonheap",id="CodeHeap 'profiled nmethods'",} 3.4920064E7
jvm_memory_used_bytes{area="heap",id="Eden Space",} 6.316596E7
jvm_memory_used_bytes{area="nonheap",id="Metaspace",} 1.50974648E8
jvm_memory_used_bytes{area="nonheap",id="CodeHeap 'non-nmethods'",} 1579776.0
jvm_memory_used_bytes{area="heap",id="Survivor Space",} 3697160.0
jvm_memory_used_bytes{area="nonheap",id="Compressed Class Space",} 1.8534568E7
jvm_memory_used_bytes{area="nonheap",id="CodeHeap 'non-profiled nmethods'",} 2.0370688E7
# HELP jvm_threads_states_threads The current number of threads having NEW state
# TYPE jvm_threads_states_threads gauge
jvm_threads_states_threads{state="runnable",} 22.0
jvm_threads_states_threads{state="blocked",} 0.0
jvm_threads_states_threads{state="waiting",} 11.0
jvm_threads_states_threads{state="timed-waiting",} 57.0
jvm_threads_states_threads{state="new",} 0.0
jvm_threads_states_threads{state="terminated",} 0.0
# HELP jvm_classes_loaded_classes The number of classes that are currently loaded in the Java virtual machine
# TYPE jvm_classes_loaded_classes gauge
jvm_classes_loaded_classes 25072.0
# HELP jvm_memory_committed_bytes The amount of memory in bytes that is committed for the Java virtual machine to use
# TYPE jvm_memory_committed_bytes gauge
jvm_memory_committed_bytes{area="heap",id="Tenured Gen",} 7.15849728E8
jvm_memory_committed_bytes{area="nonheap",id="CodeHeap 'profiled nmethods'",} 3.5127296E7
jvm_memory_committed_bytes{area="heap",id="Eden Space",} 2.8639232E8
jvm_memory_committed_bytes{area="nonheap",id="Metaspace",} 1.52240128E8
jvm_memory_committed_bytes{area="nonheap",id="CodeHeap 'non-nmethods'",} 2555904.0
jvm_memory_committed_bytes{area="heap",id="Survivor Space",} 3.5782656E7
jvm_memory_committed_bytes{area="nonheap",id="Compressed Class Space",} 1.9202048E7
jvm_memory_committed_bytes{area="nonheap",id="CodeHeap 'non-profiled nmethods'",} 2.0381696E7
# HELP jvm_buffer_total_capacity_bytes An estimate of the total capacity of the buffers in this pool
# TYPE jvm_buffer_total_capacity_bytes gauge
jvm_buffer_total_capacity_bytes{id="mapped - 'non-volatile memory'",} 0.0
jvm_buffer_total_capacity_bytes{id="mapped",} 0.0
jvm_buffer_total_capacity_bytes{id="direct",} 6496202.0
# HELP jvm_memory_max_bytes The maximum amount of memory in bytes that can be used for memory management
# TYPE jvm_memory_max_bytes gauge
jvm_memory_max_bytes{area="heap",id="Tenured Gen",} 1.431699456E9
jvm_memory_max_bytes{area="nonheap",id="CodeHeap 'profiled nmethods'",} 1.22912768E8
jvm_memory_max_bytes{area="heap",id="Eden Space",} 5.72653568E8
jvm_memory_max_bytes{area="nonheap",id="Metaspace",} -1.0
jvm_memory_max_bytes{area="nonheap",id="CodeHeap 'non-nmethods'",} 5828608.0
jvm_memory_max_bytes{area="heap",id="Survivor Space",} 7.1565312E7
jvm_memory_max_bytes{area="nonheap",id="Compressed Class Space",} 1.073741824E9
jvm_memory_max_bytes{area="nonheap",id="CodeHeap 'non-profiled nmethods'",} 1.22916864E8
# HELP jvm_buffer_count_buffers An estimate of the number of buffers in the pool
# TYPE jvm_buffer_count_buffers gauge
jvm_buffer_count_buffers{id="mapped - 'non-volatile memory'",} 0.0
jvm_buffer_count_buffers{id="mapped",} 0.0
jvm_buffer_count_buffers{id="direct",} 57.0
# HELP jvm_memory_usage_after_gc_percent The percentage of long-lived heap pool used after the last GC event, in the range [0..1]
# TYPE jvm_memory_usage_after_gc_percent gauge
jvm_memory_usage_after_gc_percent{area="heap",pool="long-lived",} 0.0
# HELP jvm_classes_unloaded_classes_total The total number of classes unloaded since the Java virtual machine has started execution
# TYPE jvm_classes_unloaded_classes_total counter
jvm_classes_unloaded_classes_total 0.0
# HELP jvm_gc_overhead_percent An approximation of the percent of CPU time used by GC activities over the last lookback period or since monitoring began, whichever is shorter, in the range [0..1]
# TYPE jvm_gc_overhead_percent gauge
jvm_gc_overhead_percent 0.0
# HELP jvm_buffer_memory_used_bytes An estimate of the memory that the Java virtual machine is using for this buffer pool
# TYPE jvm_buffer_memory_used_bytes gauge
jvm_buffer_memory_used_bytes{id="mapped - 'non-volatile memory'",} 0.0
jvm_buffer_memory_used_bytes{id="mapped",} 0.0
jvm_buffer_memory_used_bytes{id="direct",} 6496203.0
100  191k  10# HELP jvm_threads_daemon_threads The current number of live daemon threads
0# TYPE jvm_threads_daemon_threads gauge
 jvm_threads_daemon_threads 39.0
 191k    0     0  16.9M      0 --:--:-- --:--:-- --:--:-- 16.9M
* Connection #0 to host localhost left intact
# HELP jvm_threads_peak_threads The peak live thread count since the Java virtual machine started or peak was reset
# TYPE jvm_threads_peak_threads gauge
jvm_threads_peak_threads 92.0

JVM parameter passed: -XX:+UseStringDeduplication -XX:+AlwaysPreTouch -Xloggc:/tmp/app_gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/app_heap_dump.bin

Environment

  • Micrometer version: 1.9.16
  • Micrometer registry: Prometheus
  • OS: Linux
  • Java version: 17.0.9
  • Spring boot: 2.7.17

Expected behavior All the GC-related metrics should be fetched. On path: /actuator/prometheus/ Example:

        jvm_gc_pause_seconds_count
        jvm_gc_pause_seconds_sum
        jvm_gc_Pause_seconds

Any help here would really be appreciated. Thanks

Comment From: mhalbritter

Hello,

Spring Boot 2.7.x is out of OSS support. Please upgrade to a supported version (see this page), and if the problem still happens, report back. If you can't or aren't willing to upgrade to at least Spring Boot 3.1.x, commercial support is available.