JVM Metrics - Jolokia 2

This dashboard will provide JVM metrics for a Java application instrumented with Jolokia Agent.

JVM Metrics - Jolokia 2 screenshot 1
JVM Metrics - Jolokia 2 screenshot 2
Note: This dashboard uses [[inputs.jolokia2_agent]] for Telegraf. The original Jolokia plugin was disconinued.

Steps for instrumenting your Java application:

  1. Download Jolokia agent (I tested with jolokia-jvm-1.6.0-agent.jar)
  2. Start your java application by adding an aditional argument:
java -javaagent:<jolokia_path>/jolokia-jvm-1.6.0-agent.jar [OTHER_ARGUMENTS]
  1. 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"]
Revisions
RevisionDescriptionCreated
Java Virtual Machine (JVM)

Java Virtual Machine (JVM)

by Grafana Labs
Grafana Labs solution

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

Get this dashboard

Import the dashboard template

or

Download JSON

Datasource
Dependencies