Skip to content

Add java gc exporter to exporter list#2387

Merged
juliusv merged 2 commits intoprometheus:mainfrom
loyispa:java-gc-exporter
Sep 27, 2023
Merged

Add java gc exporter to exporter list#2387
juliusv merged 2 commits intoprometheus:mainfrom
loyispa:java-gc-exporter

Conversation

@loyispa
Copy link
Contributor

@loyispa loyispa commented Sep 26, 2023

Please add this new exporter to exporter list. Please let me know if something missing, thanks.

Sample metrics:

# HELP jgc_event_duration Duration(ms) of gc event
# TYPE jgc_event_duration summary
jgc_event_duration_count{path="/Users/momo/Desktop/zgc.log",category="zgc",} 11.0
jgc_event_duration_sum{path="/Users/momo/Desktop/zgc.log",category="zgc",} 12530.878999999999
# HELP jgc_log_line_total Number of process log lines
# TYPE jgc_log_line_total counter
jgc_log_line_total{path="/Users/momo/Desktop/zgc.log",} 4230.0
# HELP jgc_zgc_metaspace_used zgc metaspace usage
# TYPE jgc_zgc_metaspace_used gauge
jgc_zgc_metaspace_used{path="/Users/momo/Desktop/zgc.log",} 646144.0

Signed-off-by: loyispa <litiegen456250@gmail.com>
@juliusv
Copy link
Member

juliusv commented Sep 26, 2023

Thanks!

CC-ing @fstab here just for a quick glance because I know nothing about Java, and he can judge the metrics and possible overlap with any of the other Java exporters better :)

Some notes from my side:

Please keep the list lexicographically sorted:

  • ...
  • Java GC exporter
  • JavaMelody
  • JMX exporter
  • ...

And if we link it here, we'll want to make sure that the exporter somewhat sticks to the general and exporter-specific metrics naming guidelines, see https://prometheus.io/docs/practices/naming/ and https://prometheus.io/docs/instrumenting/writing_exporters/#metrics.

Specifically:

  • jgc_event_duration... should have a unit suffix, and it should be in base units (so seconds instead of milliseconds, so jgc_event_duration_seconds_...). Should jgc_zgc_metaspace_used also have a unit, like bytes (jgc_zgc_metaspace_used_bytes), or is that unitless for some valid reason?
  • jgc_log_line_total would more commonly be named jgc_log_lines_total (plural).

Signed-off-by: loyispa <litiegen456250@gmail.com>
@loyispa
Copy link
Contributor Author

loyispa commented Sep 26, 2023

Thanks!

CC-ing @fstab here just for a quick glance because I know nothing about Java, and he can judge the metrics and possible overlap with any of the other Java exporters better :)

Some notes from my side:

Please keep the list lexicographically sorted:

  • ...
  • Java GC exporter
  • JavaMelody
  • JMX exporter
  • ...

And if we link it here, we'll want to make sure that the exporter somewhat sticks to the general and exporter-specific metrics naming guidelines, see https://prometheus.io/docs/practices/naming/ and https://prometheus.io/docs/instrumenting/writing_exporters/#metrics.

Specifically:

  • jgc_event_duration... should have a unit suffix, and it should be in base units (so seconds instead of milliseconds, so jgc_event_duration_seconds_...). Should jgc_zgc_metaspace_used also have a unit, like bytes (jgc_zgc_metaspace_used_bytes), or is that unitless for some valid reason?
  • jgc_log_line_total would more commonly be named jgc_log_lines_total (plural).

Thanks for your explaination, i will make an update next.

@loyispa
Copy link
Contributor Author

loyispa commented Sep 27, 2023

Hi @juliusv, dou you have time to review the changes? I have renamed the metrics as per the guidelines, thanks.

Sample metrics:

# HELP jgc_g1_phantom_reference_pause_duration_seconds phantom reference pause duration
# TYPE jgc_g1_phantom_reference_pause_duration_seconds summary
# HELP jgc_g1_old_assign_regions amount of g1 old assign regions
# TYPE jgc_g1_old_assign_regions gauge
jgc_g1_old_assign_regions{path="/Users/momo/Desktop/g1gc.log",} 341.0
# HELP jgc_g1_phantom_free_references amount of g1 phantom free references
# TYPE jgc_g1_phantom_free_references gauge
# HELP jgc_safepoint_waiting_to_block_threads amount of safepoint waiting to block threads
# TYPE jgc_safepoint_waiting_to_block_threads gauge
# HELP jgc_g1_humongous_after_collection_regions amount of g1 humongous regions after collection
# TYPE jgc_g1_humongous_after_collection_regions gauge
jgc_g1_humongous_after_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 41.0
# HELP jgc_zgc_2ms_mmu_ratio zgc 2ms mmu ratio
# TYPE jgc_zgc_2ms_mmu_ratio gauge
# HELP jgc_zgc_allocated_mark_end_bytes zgc allocated mark end
# TYPE jgc_zgc_allocated_mark_end_bytes gauge
# HELP jgc_g1_final_reference_pause_duration_seconds final reference pause duration
# TYPE jgc_g1_final_reference_pause_duration_seconds summary
# HELP jgc_zgc_1m_cpu_load zgc latest 1 minute cpu load average
# TYPE jgc_zgc_1m_cpu_load gauge
# HELP jgc_g1_survivor_before_collection_regions amount of g1 survivor region before collection
# TYPE jgc_g1_survivor_before_collection_regions gauge
jgc_g1_survivor_before_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 5.0
# HELP jgc_g1_metaspace_size_after_collection_bytes metaspace size bytes after collection
# TYPE jgc_g1_metaspace_size_after_collection_bytes gauge
jgc_g1_metaspace_size_after_collection_bytes{path="/Users/momo/Desktop/g1gc.log",} 4.9545216E8
# HELP jgc_zgc_20ms_mmu_ratio zgc 20ms mmu ratio
# TYPE jgc_zgc_20ms_mmu_ratio gauge
# HELP jgc_zgc_relocate_start_free_bytes zgc relocate start free
# TYPE jgc_zgc_relocate_start_free_bytes gauge
# HELP jgc_zgc_metaspace_reserved_bytes metaspace reserved memory
# TYPE jgc_zgc_metaspace_reserved_bytes gauge
# HELP jgc_g1_old_after_collection_regions amount of g1 old regions after collection
# TYPE jgc_g1_old_after_collection_regions gauge
jgc_g1_old_after_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 341.0
# HELP jgc_generational_heap_occupancy_before_collection_bytes heap occupancy before collection
# TYPE jgc_generational_heap_occupancy_before_collection_bytes gauge
# HELP jgc_zgc_concurrent_mark_duration_seconds zgc concurrent mark duration
# TYPE jgc_zgc_concurrent_mark_duration_seconds summary
# HELP jgc_generational_classspace_occupancy_after_collection_bytes class space occupancy after collection
# TYPE jgc_generational_classspace_occupancy_after_collection_bytes gauge
# HELP jgc_generational_metaspace_size_after_collection_bytes metaspace size after collection
# TYPE jgc_generational_metaspace_size_after_collection_bytes gauge
# HELP jgc_zgc_mark_start_used_bytes zgc mark start used
# TYPE jgc_zgc_mark_start_used_bytes gauge
# HELP jgc_g1_survivor_after_collection_regions amount of g1 survivor region after collection
# TYPE jgc_g1_survivor_after_collection_regions gauge
jgc_g1_survivor_after_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 12.0
# HELP jgc_zgc_pause_relocate_start_duration_seconds zgc pause relocate start duration
# TYPE jgc_zgc_pause_relocate_start_duration_seconds summary
# HELP jgc_generational_young_occupancy_before_collection_bytes young generation occupancy before collection
# TYPE jgc_generational_young_occupancy_before_collection_bytes gauge
# HELP jgc_zgc_concurrent_relocate_duration_seconds zgc concurrent relocate duration
# TYPE jgc_zgc_concurrent_relocate_duration_seconds summary
# HELP jgc_zgc_allocated_reclaim_end_bytes zgc allocated reclaim end
# TYPE jgc_zgc_allocated_reclaim_end_bytes gauge
# HELP jgc_generational_metaspace_occupancy_before_collection_bytes metaspace occupancy before collection
# TYPE jgc_generational_metaspace_occupancy_before_collection_bytes gauge
# HELP jgc_g1_archive_assign_regions amount of g1 archive assign regions
# TYPE jgc_g1_archive_assign_regions gauge
jgc_g1_archive_assign_regions{path="/Users/momo/Desktop/g1gc.log",} 0.0
# HELP jgc_generational_tenured_size_after_collection_bytes tenured generation size after collection
# TYPE jgc_generational_tenured_size_after_collection_bytes gauge
# HELP jgc_g1_eden_before_collection_regions amount of g1 eden region before collection
# TYPE jgc_g1_eden_before_collection_regions gauge
jgc_g1_eden_before_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 1100.0
# HELP jgc_generational_phantom_references amount of phantom references
# TYPE jgc_generational_phantom_references gauge
# HELP jgc_safepoint_initially_running_threads amount of safepoint initially running threads
# TYPE jgc_safepoint_initially_running_threads gauge
# HELP jgc_generational_young_size_before_collection_bytes young generation size before collection
# TYPE jgc_generational_young_size_before_collection_bytes gauge
# HELP jgc_startup_timestamp_seconds Timestamp of exporter startup
# TYPE jgc_startup_timestamp_seconds gauge
jgc_startup_timestamp_seconds 1.695793619203E9
# HELP jgc_zgc_concurrent_select_relocationset_duration_seconds zgc concurrent select relocationset duration
# TYPE jgc_zgc_concurrent_select_relocationset_duration_seconds summary
# HELP jgc_g1_soft_references amount of g1 soft references
# TYPE jgc_g1_soft_references gauge
# HELP jgc_generational_classspace_size_after_collection_bytes class space size after collection
# TYPE jgc_generational_classspace_size_after_collection_bytes gauge
# HELP jgc_generational_free_phantom_references amount of free phantom references
# TYPE jgc_generational_free_phantom_references gauge
# HELP jgc_generational_nonclassspace_size_before_collection_bytes non-class space size before collection
# TYPE jgc_generational_nonclassspace_size_before_collection_bytes gauge
# HELP jgc_zgc_reclaimed_reclaim_end_bytes zgc reclaim end
# TYPE jgc_zgc_reclaimed_reclaim_end_bytes gauge
# HELP jgc_zgc_reclaimed_reclaim_start_bytes zgc reclaim start
# TYPE jgc_zgc_reclaimed_reclaim_start_bytes gauge
# HELP jgc_g1_archive_after_collection_regions amount of g1 archive regions after collection
# TYPE jgc_g1_archive_after_collection_regions gauge
jgc_g1_archive_after_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 0.0
# HELP jgc_generational_heap_occupancy_after_collection_bytes heap occupancy after collection
# TYPE jgc_generational_heap_occupancy_after_collection_bytes gauge
# HELP jgc_generational_soft_reference_pause_duration_seconds soft reference pause duration
# TYPE jgc_generational_soft_reference_pause_duration_seconds summary
# HELP jgc_safepoint_block_duration_seconds safepoint block duration
# TYPE jgc_safepoint_block_duration_seconds summary
# HELP jgc_survivor_max_tenuring_threshold survivor max threshold to promote tenured generation
# TYPE jgc_survivor_max_tenuring_threshold gauge
# HELP jgc_g1_archive_before_collection_regions amount of g1 archive regions before collection
# TYPE jgc_g1_archive_before_collection_regions gauge
jgc_g1_archive_before_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 0.0
# HELP jgc_g1_old_before_collection_regions amount of g1 old regions before collection
# TYPE jgc_g1_old_before_collection_regions gauge
jgc_g1_old_before_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 341.0
# HELP jgc_zgc_5ms_mmu_ratio zgc 5ms mmu ratio
# TYPE jgc_zgc_5ms_mmu_ratio gauge
# HELP jgc_generational_soft_references amount of soft references
# TYPE jgc_generational_soft_references gauge
# HELP jgc_generational_weak_reference_pause_seconds weak reference pause duration
# TYPE jgc_generational_weak_reference_pause_seconds summary
# HELP jgc_zgc_mark_end_free_bytes zgc mark end free
# TYPE jgc_zgc_mark_end_free_bytes gauge
# HELP jgc_generational_tenured_occupancy_after_collection_bytes tenured generation occupancy after collection
# TYPE jgc_generational_tenured_occupancy_after_collection_bytes gauge
# HELP jgc_generational_nonclassspace_occupancy_after_collection_bytes non-class space occupancy after collection
# TYPE jgc_generational_nonclassspace_occupancy_after_collection_bytes gauge
# HELP jgc_safepoint_cleanup_duration_seconds safepoint cleanup duration
# TYPE jgc_safepoint_cleanup_duration_seconds summary
# HELP jgc_g1_meta_space_occupancy_after_collection_bytes meta space occupancy bytes after collection
# TYPE jgc_g1_meta_space_occupancy_after_collection_bytes gauge
jgc_g1_meta_space_occupancy_after_collection_bytes{path="/Users/momo/Desktop/g1gc.log",} 4.89951232E8
# HELP jgc_zgc_metaspace_used_bytes metaspace used memory
# TYPE jgc_zgc_metaspace_used_bytes gauge
# HELP jgc_generational_jni_weak_references amount of jni weak references
# TYPE jgc_generational_jni_weak_references gauge
# HELP jgc_g1_survivor_size_bytes survivor size
# TYPE jgc_g1_survivor_size_bytes gauge
# HELP jgc_g1_weak_references amount of g1 weak references
# TYPE jgc_g1_weak_references gauge
# HELP jgc_generational_young_occupancy_after_collection_bytes young generation occupancy after collection
# TYPE jgc_generational_young_occupancy_after_collection_bytes gauge
# HELP jgc_g1_weak_reference_pause_duration_seconds weak reference pause duration
# TYPE jgc_g1_weak_reference_pause_duration_seconds summary
# HELP jgc_zgc_metaspace_committed_bytes metaspace committed memory
# TYPE jgc_zgc_metaspace_committed_bytes gauge
# HELP jgc_generational_string_table_process_duration_seconds string table process duration
# TYPE jgc_generational_string_table_process_duration_seconds summary
# HELP jgc_generational_metaspace_size_before_collection_bytes metaspace size before collection
# TYPE jgc_generational_metaspace_size_before_collection_bytes gauge
# HELP jgc_zgc_relocate_end_free_bytes zgc relocate end free
# TYPE jgc_zgc_relocate_end_free_bytes gauge
# HELP jgc_safepoint_spin_duration_seconds safepoint spin duration
# TYPE jgc_safepoint_spin_duration_seconds summary
# HELP jgc_zgc_allocated_reclaim_start_bytes zgc allocated reclaim start
# TYPE jgc_zgc_allocated_reclaim_start_bytes gauge
# HELP jgc_generational_tenured_occupancy_before_collection_bytes tenured generation occupancy before collection
# TYPE jgc_generational_tenured_occupancy_before_collection_bytes gauge
# HELP jgc_generational_nonclassspace_occupancy_before_collection_bytes non-class space occupancy before collection
# TYPE jgc_generational_nonclassspace_occupancy_before_collection_bytes gauge
# HELP jgc_generational_symbol_and_string_table_process_seconds symbol and string table process duration
# TYPE jgc_generational_symbol_and_string_table_process_seconds summary
# HELP jgc_log_lines_total Number of process log lines
# TYPE jgc_log_lines_total counter
jgc_log_lines_total{path="/Users/momo/Desktop/g1gc.log",} 302.0
# HELP jgc_g1_jni_weak_references amount of g1 jni references
# TYPE jgc_g1_jni_weak_references gauge
# HELP jgc_generational_final_reference_pause_duration_seconds final reference pause duration
# TYPE jgc_generational_final_reference_pause_duration_seconds summary
# HELP jgc_zgc_mark_end_used_bytes zgc mark end used
# TYPE jgc_zgc_mark_end_used_bytes gauge
# HELP jgc_zgc_garbage_reclaim_end_bytes zgc garbage reclaim end
# TYPE jgc_zgc_garbage_reclaim_end_bytes gauge
# HELP jgc_generational_phantom_reference_pause_duration_seconds phantom reference pause duration
# TYPE jgc_generational_phantom_reference_pause_duration_seconds summary
# HELP jgc_zgc_memory_reclaim_end_bytes zgc memory reclaim end
# TYPE jgc_zgc_memory_reclaim_end_bytes gauge
# HELP jgc_g1_eden_assign_regions amount of g1 eden assign regions
# TYPE jgc_g1_eden_assign_regions gauge
jgc_g1_eden_assign_regions{path="/Users/momo/Desktop/g1gc.log",} 1140.0
# HELP jgc_zgc_pause_mark_start_duration_seconds zgc pause mark start duration
# TYPE jgc_zgc_pause_mark_start_duration_seconds summary
# HELP jgc_zgc_50ms_mmu_ratio zgc 50ms mmu ratio
# TYPE jgc_zgc_50ms_mmu_ratio gauge
# HELP jgc_generational_classspace_occupancy_before_collection_bytes class space occupancy before collection
# TYPE jgc_generational_classspace_occupancy_before_collection_bytes gauge
# HELP jgc_g1_final_references amount of g1 final references
# TYPE jgc_g1_final_references gauge
# HELP jgc_g1_metaspace_heap_occupancy_before_collection_bytes metaspace occupancy bytes before collection
# TYPE jgc_g1_metaspace_heap_occupancy_before_collection_bytes gauge
jgc_g1_metaspace_heap_occupancy_before_collection_bytes{path="/Users/momo/Desktop/g1gc.log",} 4.89951232E8
# HELP jgc_generational_tenured_size_before_collection_bytes tenured generation size before collection
# TYPE jgc_generational_tenured_size_before_collection_bytes gauge
# HELP jgc_g1_eden_size_before_collection_bytes eden size before collection
# TYPE jgc_g1_eden_size_before_collection_bytes gauge
# HELP jgc_g1_eden_after_collection_regions amount of g1 eden region after collection
# TYPE jgc_g1_eden_after_collection_regions gauge
jgc_g1_eden_after_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 0.0
# HELP jgc_g1_eden_occupancy_after_collection_bytes eden occupancy bytes after collection
# TYPE jgc_g1_eden_occupancy_after_collection_bytes gauge
# HELP jgc_zgc_live_mark_end_bytes zgc live mark end
# TYPE jgc_zgc_live_mark_end_bytes gauge
# HELP jgc_g1_soft_reference_pause_duration_seconds soft reference pause duration
# TYPE jgc_g1_soft_reference_pause_duration_seconds summary
# HELP jgc_zgc_relocate_end_used_bytes zgc relocate end used
# TYPE jgc_zgc_relocate_end_used_bytes gauge
# HELP jgc_generational_final_references amount of final references
# TYPE jgc_generational_final_references gauge
# HELP jgc_survivor_desired_occupancy_after_collection_bytes survivor occupancy after collection
# TYPE jgc_survivor_desired_occupancy_after_collection_bytes gauge
# HELP jgc_generational_nonclassspace_size_after_collection_bytes non-class space size after collection
# TYPE jgc_generational_nonclassspace_size_after_collection_bytes gauge
# HELP jgc_generational_class_unloading_process_duration_seconds class unloading process time
# TYPE jgc_generational_class_unloading_process_duration_seconds summary
# HELP jgc_generational_weak_references amount of weak references
# TYPE jgc_generational_weak_references gauge
# HELP jgc_zgc_garbage_reclaim_start_heap_bytes zgc garbage reclaim start
# TYPE jgc_zgc_garbage_reclaim_start_heap_bytes gauge
# HELP jgc_zgc_relocate_start_used_bytes zgc relocate start used
# TYPE jgc_zgc_relocate_start_used_bytes gauge
# HELP jgc_safepoint_application_threads amount of application threads
# TYPE jgc_safepoint_application_threads gauge
# HELP jgc_event_duration_seconds Duration of gc event
# TYPE jgc_event_duration_seconds summary
jgc_event_duration_seconds_count{path="/Users/momo/Desktop/g1gc.log",category="YoungGC",} 1.0
jgc_event_duration_seconds_sum{path="/Users/momo/Desktop/g1gc.log",category="YoungGC",} 0.014334
# HELP jgc_g1_survivor_heap_occupancy_after_collection_bytes survivor heap occupancy bytes after collection
# TYPE jgc_g1_survivor_heap_occupancy_after_collection_bytes gauge
# HELP jgc_g1_humongous_before_collection_regions amount of g1 humongous regions before collection
# TYPE jgc_g1_humongous_before_collection_regions gauge
jgc_g1_humongous_before_collection_regions{path="/Users/momo/Desktop/g1gc.log",} 422.0
# HELP jgc_survivor_calculated_tenuring_threshold survivor threshold to promote tenured generation
# TYPE jgc_survivor_calculated_tenuring_threshold gauge
# HELP jgc_zgc_live_reclaim_end_bytes zgc live reclaim end
# TYPE jgc_zgc_live_reclaim_end_bytes gauge
# HELP jgc_real_cpu_seconds real cpu time
# TYPE jgc_real_cpu_seconds summary
jgc_real_cpu_seconds_count{path="/Users/momo/Desktop/g1gc.log",} 1.0
jgc_real_cpu_seconds_sum{path="/Users/momo/Desktop/g1gc.log",} 0.01
# HELP jgc_generational_heap_size_before_collection_bytes heap size before collection
# TYPE jgc_generational_heap_size_before_collection_bytes gauge
# HELP jgc_zgc_concurrent_mark_free_duration_seconds zgc concurrent mark free duration
# TYPE jgc_zgc_concurrent_mark_free_duration_seconds summary
# HELP jgc_zgc_100ms_mmu_ratio zgc 100ms mmu ratio
# TYPE jgc_zgc_100ms_mmu_ratio gauge
# HELP jgc_zgc_live_reclaim_start_bytes zgc live reclaim start
# TYPE jgc_zgc_live_reclaim_start_bytes gauge
# HELP jgc_zgc_process_non_strong_references_duration_seconds zgc process non-strong references duration
# TYPE jgc_zgc_process_non_strong_references_duration_seconds summary
# HELP jgc_zgc_15m_cpu_load zgc latest 15 minute cpu load average
# TYPE jgc_zgc_15m_cpu_load gauge
# HELP jgc_sys_cpu_seconds sys cpu time
# TYPE jgc_sys_cpu_seconds summary
jgc_sys_cpu_seconds_count{path="/Users/momo/Desktop/g1gc.log",} 1.0
jgc_sys_cpu_seconds_sum{path="/Users/momo/Desktop/g1gc.log",} 0.01
# HELP jgc_generational_young_size_after_collection_bytes young generation size after collection
# TYPE jgc_generational_young_size_after_collection_bytes gauge
# HELP jgc_zgc_concurrent_reset_relocationset_duration_seconds zgc concurrent reset relocationset duration
# TYPE jgc_zgc_concurrent_reset_relocationset_duration_seconds summary
# HELP jgc_g1_phantom_references amount of g1 phantom references
# TYPE jgc_g1_phantom_references gauge
# HELP jgc_g1_humongous_assign_regions amount of g1 humongous assign regions
# TYPE jgc_g1_humongous_assign_regions gauge
jgc_g1_humongous_assign_regions{path="/Users/momo/Desktop/g1gc.log",} 41.0
# HELP jgc_generational_classspace_size_before_collection_bytes class space size before collection
# TYPE jgc_generational_classspace_size_before_collection_bytes gauge
# HELP jgc_zgc_memory_reclaim_start_bytes zgc memory reclaim start
# TYPE jgc_zgc_memory_reclaim_start_bytes gauge
# HELP jgc_generational_symbol_table_process_duration_seconds symbol table process time
# TYPE jgc_generational_symbol_table_process_duration_seconds summary
# HELP jgc_g1_eden_size_after_collection_bytes eden size after collection
# TYPE jgc_g1_eden_size_after_collection_bytes gauge
# HELP jgc_g1_jni_weak_reference_pause_duration_seconds jni weak reference pause duration
# TYPE jgc_g1_jni_weak_reference_pause_duration_seconds summary
# HELP jgc_safepoint_vmop_duration_seconds safepoint vmop duration
# TYPE jgc_safepoint_vmop_duration_seconds summary
# HELP jgc_generational_metaspace_occupancy_after_collection_bytes metaspace occupancy after collection
# TYPE jgc_generational_metaspace_occupancy_after_collection_bytes gauge
# HELP jgc_g1_survivor_heap_occupancy_before_collection_bytes survivor heap occupancy bytes before collection
# TYPE jgc_g1_survivor_heap_occupancy_before_collection_bytes gauge
# HELP jgc_zgc_10ms_mmu_ratio zgc 10ms mmu ratio
# TYPE jgc_zgc_10ms_mmu_ratio gauge
# HELP jgc_zgc_garbage_mark_end_bytes zgc garbage mark end
# TYPE jgc_zgc_garbage_mark_end_bytes gauge
# HELP jgc_generational_heap_size_after_collection_bytes heap size after collection
# TYPE jgc_generational_heap_size_after_collection_bytes gauge
# HELP jgc_zgc_pause_mark_end_duration_seconds zgc concurrent mark end duration
# TYPE jgc_zgc_pause_mark_end_duration_seconds summary
# HELP jgc_safepoint_sync_duration_seconds safepoint sync duration
# TYPE jgc_safepoint_sync_duration_seconds summary
# HELP jgc_g1_survivor_assign_regions amount of g1 survivor assign regions
# TYPE jgc_g1_survivor_assign_regions gauge
jgc_g1_survivor_assign_regions{path="/Users/momo/Desktop/g1gc.log",} 144.0
# HELP jgc_generational_jni_weak_reference_pause_duration_seconds jni weak reference pause duration
# TYPE jgc_generational_jni_weak_reference_pause_duration_seconds summary
# HELP jgc_g1_metaspace_size_before_collection_bytes metaspace size bytes before collection
# TYPE jgc_g1_metaspace_size_before_collection_bytes gauge
jgc_g1_metaspace_size_before_collection_bytes{path="/Users/momo/Desktop/g1gc.log",} 4.9545216E8
# HELP jgc_user_cpu_seconds user cpu time
# TYPE jgc_user_cpu_seconds summary
jgc_user_cpu_seconds_count{path="/Users/momo/Desktop/g1gc.log",} 1.0
jgc_user_cpu_seconds_sum{path="/Users/momo/Desktop/g1gc.log",} 0.05
# HELP jgc_zgc_5m_cpu_load zgc latest 5 minute cpu load average
# TYPE jgc_zgc_5m_cpu_load gauge
# HELP jgc_zgc_mark_start_free_bytes zgc mark start free
# TYPE jgc_zgc_mark_start_free_bytes gauge
# HELP jgc_g1_eden_heap_occupancy_before_collection_bytes eden heap occupancy bytes before collection
# TYPE jgc_g1_eden_heap_occupancy_before_collection_bytes gauge

@juliusv
Copy link
Member

juliusv commented Sep 27, 2023

👍 Thanks for the updates! Yeah that looks much better at a glance. I don't know anything about Java, but should be good to merge at least :)

@juliusv juliusv merged commit 1dacdf1 into prometheus:main Sep 27, 2023
@fstab
Copy link
Member

fstab commented Sep 27, 2023

Thanks for the new exporter @loyispa. This parses GC log files, right? I guess in that case it makes sense to have it as an independent exporter, because parsing GC log files doesn't really fit with client_java or jmx_exporter. However, if you ever have any plans for GC metrics via JMX or via JFR please contribute to client_java, contributions there are highly appreciated!

@loyispa
Copy link
Contributor Author

loyispa commented Sep 27, 2023

@fstab Yes, It parses the raw gc log as an independent exporter. Thanks for the advice, I will consider how to implement it appropriately with client_java :)

@loyispa loyispa deleted the java-gc-exporter branch September 27, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants