JVM Metrics - Jolokia 2
This dashboard will provide JVM metrics for a Java application instrumented with Jolokia Agent.
Note: This dashboard uses [[inputs.jolokia2_agent]] for Telegraf. The original Jolokia plugin was disconinued.
Steps for instrumenting your Java application:
- Download Jolokia agent (I tested with jolokia-jvm-1.6.0-agent.jar)
- Start your java application by adding an aditional argument:
java -javaagent:<jolokia_path>/jolokia-jvm-1.6.0-agent.jar [OTHER_ARGUMENTS]
- Update your Telegraf config file:
# # Read JMX metrics from a Jolokia REST agent endpoint
[[inputs.jolokia2_agent]]
urls = ["http://localhost:8778/jolokia"]
[[inputs.jolokia2_agent.metric]]
name = "java_runtime"
mbean = "java.lang:type=Runtime"
paths = ["Uptime"]
[[inputs.jolokia2_agent.metric]]
name = "java_memory"
mbean = "java.lang:type=Memory"
paths = ["HeapMemoryUsage", "NonHeapMemoryUsage", "ObjectPendingFinalizationCount"]
[[inputs.jolokia2_agent.metric]]
name = "java_garbage_collector"
mbean = "java.lang:name=*,type=GarbageCollector"
paths = ["CollectionTime", "CollectionCount"]
tag_keys = ["name"]
[[inputs.jolokia2_agent.metric]]
name = "java_last_garbage_collection"
mbean = "java.lang:name=*,type=GarbageCollector"
paths = ["LastGcInfo"]
tag_keys = ["name"]
[[inputs.jolokia2_agent.metrics]]
name = "java_threading"
mbean = "java.lang:type=Threading"
paths = ["TotalStartedThreadCount", "ThreadCount", "DaemonThreadCount", "PeakThreadCount"]
[[inputs.jolokia2_agent.metrics]]
name = "java_class_loading"
mbean = "java.lang:type=ClassLoading"
paths = ["LoadedClassCount", "UnloadedClassCount", "TotalLoadedClassCount"]
[[inputs.jolokia2_agent.metrics]]
name = "java_memory_pool"
mbean = "java.lang:name=*,type=MemoryPool"
paths = ["Usage", "PeakUsage", "CollectionUsage"]
tag_keys = ["name"]
Data source config
Collector config:
Upload an updated version of an exported dashboard.json file from Grafana
Revision | Description | Created | |
---|---|---|---|
Download |
Java Virtual Machine (JVM)
Easily monitor a Java virtual machine, which allows computers to run Java programs, with Grafana Cloud's out-of-the-box monitoring solution.
Learn more