0

Is there an example available about how to use jvm.memory.heap.used To get this data in kibana.

kcp
  • 33
  • 1
  • 7

1 Answers1

0

There are few steps to follow before you will be able to create simple visualization for jvm.memory.heap.used metric.

Download and start APM server, you will find instructions here

For osx you can do this with following commands:

curl -L -O https://artifacts.elastic.co/downloads/apm-server/apm-server-7.2.0-darwin-x86_64.tar.gz
tar xzvf apm-server-7.2.0-darwin-x86_64.tar.gz
cd apm-server-7.2.0-darwin-x86_64/

./apm-server -e

Run your app with an attached agent

java -javaagent:/path_to_agent/elastic-apm-agent-1.9.0.jar \
     -Delastic.apm.service_name=my-application \
     -Delastic.apm.server_url=http://localhost:8200 \
     -Delastic.apm.secret_token= \
     -Delastic.apm.application_packages=org.example \
     -jar Main.jar

Make sure elasticsearch is receiving data from apm agent

enter image description here

Prepare index patter for apm indices

enter image description here

Create a visualization

enter image description here

enter image description here

I want to show jvm.memory.heap.used usage over time so I'll select date histogram for a bucket

enter image description here

and max value in a given time by configuring metrics like this

enter image description here

in the end, we should see something like this

enter image description here

You can find an interactive tutorial inside Kibana about gathering APM data from java applications. If you fill find creating visualizations problematic, check this tutorial.

Hope that helps.

Rob
  • 9,664
  • 3
  • 41
  • 43