JVM Metrics - Jolokia 2

Dashboard

This dashboard will provide JVM metrics for a Java application instrumented with Jolokia Agent.
Last updated: 4 years ago

Start with Grafana Cloud and the new FREE tier. Includes 10K series Prometheus or Graphite Metrics and 50gb Loki Logs

Downloads: 1603

Reviews: 0

  • Screen Shot 2018-11-14 at 3.48.01 pm.png
    Screen Shot 2018-11-14 at 3.48.01 pm.png
  • Screen Shot 2018-11-14 at 3.47.38 pm.png
    Screen Shot 2018-11-14 at 3.47.38 pm.png
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"]
Get this dashboard:
8991