Beat for Java HotSpot VM
Go Makefile
Latest commit d2ecf0f Dec 27, 2016 @fjgal fjgal committed with support for multiple java processes and process auto-discovery
Closes #8

  - If pid is configured as 0 or not configured (default is 0), running Java processes are auto-discovered at each Fetch interval
  - Fetch returns a list of events instead of a single event, one event per running java process
  - Processes are discovered by looking under the <temp>/hsperfdata_* directories, typically one file per running java process exists
  - A map of running java processes is stored inside MetricSet, the map is initialized as empty and updated (add or remove) at each Fetch interval
  - hsperfdata file path is not tied to the user running hsbeat so that if run as root it can collect data from Java processes ran by any user (assuming all users have the same <temp> directory)
  - errors found in the Fetch loop are accumulated instead of returned breaking the loop, which means that no events are returned (previous behavior)
  - if there is at least one successful event no error is returned, instead the errors are logged
  - if there are no sucessful events, the errors are returned
  - a new utility package (multierror) was added. run unit tests with go test ./utils/multierror from the hsbeat directory

README.md

HSBeat

Beats for Java HotSpot VM. This beat ships all performance counters in HotSpot VM.

Features

  • HSBeat collects periodically all raw performance counter values in Java HotSpot VM.
    • Constant values are shipped only once (first time) to Elasticsearch.
    • Monotonic and Variable values are shipped in all collection time.
  • If you want to calculate these values (e.g. ratio, time), you have to implement it in your client apps.
    • HSBeat Kibana dashboard sample use dynamic scripting on Elasticsearch.
  • Collects values for multiple Java processes or for a given PID
    • When a PID is not given, it collects counter values from all running Java processes that create a hsperfdata file under /hsperfdata_*

Getting started

Collecting counters from a single Java process

$ go get github.com/YaSuenag/hsbeat
$ hsbeat -E hsbeat.modules.0.pid=<PID>

Collecting counters from all running Java processes

$ go get github.com/YaSuenag/hsbeat
$ hsbeat

Note: only process for which the user running hsbeat has read access to /hsperfdata_*/ are monitored

If you want to use sample dashboard, you can import as below:

$ import_dashboards --dir $GOPATH/src/github.com/YaSuenag/hsbeat/etc/kibana

import_dashboards is provided by Beats binary. Please see reference manual if you want to know more details.

  • If you want to use sample dashboard, you have to enable scripting on $ES_HOME/config/elasticsearch.yml as below:
script.engine.groovy.inline: true