I hope this message finds you well. I have been working with Elastic APM to monitor the performance of my Java application, and I'm particularly interested in tracking the time spend in Garbage Collector or suspension. I would like to know if there is a solution or recommended approach to achieve this.
Currently, I have set up Elastic APM successfully to capture various metrics and traces from my Java application, which has been immensely helpful in identifying performance bottlenecks. However, I haven't been able to find a straightforward way to monitor GC time.
Is there a specific configuration or instrumentation that I can implement to gain insights into GC activities within APM? I believe that monitoring GC time is crucial for optimizing the application's memory management and overall performance.
Any guidance or suggestions from the community would be greatly appreciated.
Regarding GC the simplest approach would be to use the GC time that is captured by default by the Java APM Agent, with that you should get a good overview of how much time is spent on GC in your application.
GC monitoring and log collection is a very broad topic, thus in this case it's crucial to know what are the things that you want to monitor and prevent (for example from known issues in the past).
With the Java APM agent you can capture all metrics that are exposed through JMX, however most of the details of the GC behavior is captured only in the GC logs.
You should be able to start with the following metrics that report respectively the time and count of GC executions (captured from JMX interface, thus the same you have on jconsole).
jvm.gc.time
jvm.gc.count
Those metrics have a breakdown per area of the JVM memory, for example there is labels.name = G1 Young Generation when using the G1 garbage collector.
I don't have any experience with those metrics in the context of machine learning, but I am pretty sure that you should be able to detect trends and anomalies with that.
Hi Gastón, it's great to see your proactive approach to optimizing your Java application with Elastic APM. Monitoring GC time is indeed crucial for performance. Have you considered exploring custom instrumentation or leveraging APM's built-in Java agent for more insights into GC activities? Community members might have some valuable tips!. AC Football Cases.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.