
:guide-id: metrics-for-troubleshooting-jvm
:guide-parent: 
:guide-title: JVM metrics
:guide-summary: Use JVM metrics to observe performance of {project_name}.
:guide-priority: 999
:guide-tile-visible: false
:version: 26.4.0

include::../attributes.adoc[]

[[metrics-for-troubleshooting-jvm]]
= JVM metrics

ifeval::["" == "true"]
WARNING: This {section} is describing a feature which is currently in preview.
ifeval::["" == ""]
Please provide your feedback while we’re continuing to work on this.
endif::[]
ifeval::["" != ""]
Please provide your feedback by link:[joining this discussion] while we’re continuing to work on this.
endif::[]
endif::[]



This is part of the link:{links_observability_metrics-for-troubleshooting_url}[{links_observability_metrics-for-troubleshooting_name}] {section}.

== Prerequisites

* Metrics need to be enabled for {project_name}. Follow the link:{links_observability_configuration-metrics_url}[{links_observability_configuration-metrics_name}] {section} for more details.
* A monitoring system collecting the metrics.

== Metrics

=== JVM info

|===
|Metric |Description

m| jvm_info_total
| Information about the JVM such as version, runtime and vendor.

|===

=== Heap memory usage

|===
|Metric |Description

m| jvm_memory_committed_bytes
| The amount of memory that the JVM has committed for use, reflecting the portion of the allocated memory that is guaranteed to be available for the JVM to use.

m| jvm_memory_used_bytes
| The amount of memory currently used by the JVM, indicating the actual memory consumption by the application and JVM internals.

|===

=== Garbage collection

|===
|Metric |Description

m| jvm_gc_pause_seconds_max

| The maximum duration, in seconds, of garbage collection pauses experienced by the JVM due to a particular cause, which helps you quickly differentiate between types of GC (minor, major) pauses.

m| jvm_gc_pause_seconds_sum
| The total cumulative time spent in garbage collection pauses, indicating the impact of GC pauses on application performance in the JVM.

m| jvm_gc_pause_seconds_count
| Counts the total number of garbage collection pause events, helping to assess the frequency of GC pauses in the JVM.

m| jvm_gc_overhead
| The percentage of CPU time spent on garbage collection, indicating the impact of GC on application performance in the JVM. It refers to the proportion of the total CPU processing time that is dedicated to executing garbage collection (GC) operations, as opposed to running application code or performing other tasks. This metric helps determine how much overhead GC introduces, affecting the overall performance of the {project_name}'s JVM.

|===

=== CPU Usage in Kubernetes

|===
|Metric |Description

m| container_cpu_usage_seconds_total

| Cumulative CPU time consumed by the container in core-seconds.

|===

== Next steps

Return back to the link:{links_observability_metrics-for-troubleshooting_url}[{links_observability_metrics-for-troubleshooting_name}] or proceed to link:{links_observability_metrics-for-troubleshooting-database_url}[{links_observability_metrics-for-troubleshooting-database_name}].


