# Topbeat for JVM metrics monitoring

**URL:** https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444
**Category:** Beats
**Created:** [January 5, 2016, 10:40pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444 "2016-01-05T22:40:53Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![kushan85](https://avatars.discourse-cdn.com/v4/letter/k/6f9a4e/32.png) [@kushan85](https://discuss.elastic.co/u/kushan85)
#### Post date: [January 5, 2016, 10:40pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/1 "2016-01-05T22:40:53Z")

</div>

Can we use topbeat for monitoring JVM metrics like heap memory, active threads, garbage collection etc. ?

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [January 5, 2016, 11:28pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/2 "2016-01-05T23:28:52Z")

</div>

No, it cannot. There is no Beat for JVM monitoring at the current time. This was discuss a bit here:

> [@Beat to feed JMX data of Java processes to ES](https://discuss.elastic.co/t/beat-to-feed-jmx-data-of-java-processes-to-es/34465/3):
>
> Was busy with testing RC2, nightly builds recently and can now come back to this question... I was inspired by the nginx beat which uses the same approach to pull the information. Maybe it's more an architecture decision. IMHO, well defined monitoring interfaces to pull information like http, jmx should be handled by a beat implementation itself. Then you can avoid an additional daemon running on the system which feeds the data into your proposed generic beat with an http input. Thanks Oli

---

<div class="post-metadata">

### Author: ![christiangalsterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christiangalsterer/32/6447_2.png) [@christiangalsterer](https://discuss.elastic.co/u/christiangalsterer)
#### Post date: [January 6, 2016, 5:43pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/3 "2016-01-06T17:43:47Z")

</div>

You can give [Httpbeat](https://github.com/christiangalsterer/httpbeat) together with [Jolokia](http://jolokia.org) a try. Httpbeat is a beat which can call any HTTP endpoint and Jolokia is a HTTP/JSON bridge for JMX. I'm currently using this combination to monitor a set of 30+ servers monitoring common metrics like connections, memory usage.

Disclaimer: I'm the owner of Httpbeat.

---

<div class="post-metadata">

### Author: ![kushan85](https://avatars.discourse-cdn.com/v4/letter/k/6f9a4e/32.png) [@kushan85](https://discuss.elastic.co/u/kushan85)
#### Post date: [January 6, 2016, 7:38pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/4 "2016-01-06T19:38:34Z")

</div>

Thanks @christiangalsterer. That is interesting. I will give it a try. we have 100+ servers to monitor.

---

<div class="post-metadata">

### Author: ![jstar](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jstar](https://discuss.elastic.co/u/jstar)
#### Post date: [February 24, 2017, 3:14pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/5 "2017-02-24T15:14:46Z")

</div>

@christiangalsterer, I'm also facing a similar issue. Basically I want to monitor the metrics of a spark cluster. I have the metrics of the master on [http://localhost:8081/metrics/master/json/path](http://localhost:8081/metrics/master/json/path) and those of the workers on [http://localhost:4041/metrics/json/](http://localhost:4041/metrics/json/), [http://localhost:4042/metrics/json/](http://localhost:4042/metrics/json/) [http://localhost:4042/metrics/json/](http://localhost:4042/metrics/json/) and so on.

With this configure please can you help me with some steps or some documentation on how to get those metrics with httpbeat and jolokia.

Thanks.

---

<div class="post-metadata">

### Author: ![christiangalsterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christiangalsterer/32/6447_2.png) [@christiangalsterer](https://discuss.elastic.co/u/christiangalsterer)
#### Post date: [February 25, 2017, 11:58am UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/6 "2017-02-25T11:58:07Z")

</div>

Hi can find the httpbeat [here](https://github.com/christiangalsterer/httpbeat) along with same examples how to query an HTTP endpoint.

E.g. you can point to [http://localhost:8081/metrics/master/json/path](http://localhost:8081/metrics/master/json/path) to query the metrics of your spark master and send those data then to elastic search and/or logstash.

For the document\_type I suggest that you use a value of "spark" or something similar.

---

<div class="post-metadata">

### Author: ![jstar](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jstar](https://discuss.elastic.co/u/jstar)
#### Post date: [February 27, 2017, 12:35pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/7 "2017-02-27T12:35:14Z")

</div>

Thanks for the reply,

Sorry for the delay, I had something more urgent to address. I have done that configuration but the data that I want come in the field body,

```
"body" : "{\"version\":\"3.0.0\",\"gauges\":{\"jvm.PS-MarkSweep.count\":{\"value\":1},\"jvm.PS-MarkSweep.time\":{\"value\":20},\"jvm.PS-Scavenge.count\":{\"value\":3},\"jvm.PS-Scavenge.time\":{\"value\":25},\"jvm.heap.committed\":{\"value\":342360064},\"jvm.heap.init\":{\"value\":526385152},\"jvm.heap.max\":{\"value\":954728448},\"jvm.heap.usage\":{\"value\":0.1372370628260571},\"jvm.heap.used\":{\"value\":131024128},\"jvm.non-heap.committed\":{\"value\":41353216},\"jvm.non-heap.init\":{\"value\":2555904},\"jvm.non-heap.max\":{\"value\":-1},\"jvm.non-heap.usage\":{\"value\":-4.0685104E7},\"jvm.non-heap.used\":{\"value\":40685104},\"jvm.pools.Code-Cache.committed\":{\"value\":7012352},\"jvm.pools.Code-Cache.init\":{\"value\":2555904},\"jvm.pools.Code-Cache.max\":{\"value\":251658240},\"jvm.pools.Code-Cache.usage\":{\"value\":0.02767003377278646},\"jvm.pools.Code-Cache.used\":{\"value\":6964096},\"jvm.pools.Compressed-Class-Space.committed\":{\"value\":4194304},\"jvm.pools.Compressed-Class-Space.init\":{\"value\":0},\"jvm.pools.Compressed-Class-Space.max\":{\"value\":1073741824},\"jvm.pools.Compressed-Class-Space.usage\":{\"value\":0.0038136616349220276},\"jvm.pools.Compressed-Class-Space.used\":{\"value\":4094888},\"jvm.pools.Metaspace.committed\":{\"value\":30146560},\"jvm.pools.Metaspace.init\":{\"value\":0},\"jvm.pools.Metaspace.max\":{\"value\":-1},\"jvm.pools.Metaspace.usage\":{\"value\":0.9827830439028533},\"jvm.pools.Metaspace.used\":{\"value\":29627528},\"jvm.pools.PS-Eden-Space.committed\":{\"value\":132120576},\"jvm.pools.PS-Eden-Space.init\":{\"value\":132120576},\"jvm.pools.PS-Eden-Space.max\":{\"value\":314572800},\"jvm.pools.PS-Eden-Space.usage\":{\"value\":0.263955561319987},\"jvm.pools.PS-Eden-Space.used\":{\"value\":83033240},\"jvm.pools.PS-Old-Gen.committed\":{\"value\":188743680},\"jvm.pools.PS-Old-Gen.init\":{\"value\":351272960},\"jvm.pools.PS-Old-Gen.max\":{\"value\":716177408},\"jvm.pools.PS-Old-Gen.usage\":{\"value\":0.037000530460743045},\"jvm.pools.PS-Old-Gen.used\":{\"value\":26498944},\"jvm.pools.PS-Survivor-Space.committed\":{\"value\":21495808},\"jvm.pools.PS-Survivor-Space.init\":{\"value\":21495808},\"jvm.pools.PS-Survivor-Space.max\":{\"value\":21495808},\"jvm.pools.PS-Survivor-Space.usage\":{\"value\":0.999820244021532},\"jvm.pools.PS-Survivor-Space.used\":{\"value\":21491944},\"jvm.total.committed\":{\"value\":383713280},\"jvm.total.init\":{\"value\":528941056},\"jvm.total.max\":{\"value\":954728447},\"jvm.total.used\":{\"value\":171714072},\"master.aliveWorkers\":{\"value\":1},\"master.apps\":{\"value\":1},\"master.waitingApps\":{\"value\":0},\"master.workers\":{\"value\":1}},\"counters\":{},\"histograms\":{\"CodeGenerator.compilationTime\":{\"count\":0,\"max\":0,\"mean\":0.0,\"min\":0,\"p50\":0.0,\"p75\":0.0,\"p95\":0.0,\"p98\":0.0,\"p99\":0.0,\"p999\":0.0,\"stddev\":0.0},\"CodeGenerator.generatedClassSize\":{\"count\":0,\"max\":0,\"mean\":0.0,\"min\":0,\"p50\":0.0,\"p75\":0.0,\"p95\":0.0,\"p98\":0.0,\"p99\":0.0,\"p999\":0.0,\"stddev\":0.0},\"CodeGenerator.generatedMethodSize\":{\"count\":0,\"max\":0,\"mean\":0.0,\"min\":0,\"p50\":0.0,\"p75\":0.0,\"p95\":0.0,\"p98\":0.0,\"p99\":0.0,\"p999\":0.0,\"stddev\":0.0},\"CodeGenerator.sourceCodeSize\":{\"count\":0,\"max\":0,\"mean\":0.0,\"min\":0,\"p50\":0.0,\"p75\":0.0,\"p95\":0.0,\"p98\":0.0,\"p99\":0.0,\"p999\":0.0,\"stddev\":0.0}},\"meters\":{},\"timers\":{}}",

```

I was wondering if it is possible to configure httpbeat so that those data come in different fields. That is

```
{ 
  "version":"3.0.0",
  "gauges":{"jvm.PS-MarkSweep.count":{"value":1},
  "jvm.PS-MarkSweep.time":{"value":20},
  "jvm.PS-Scavenge.count":{"value":3},
  "jvm.PS-Scavenge.time":{"value":25},
  "jvm.heap.committed":{"value":342360064},
  "jvm.heap.init":{"value":526385152},
  ....
}

```

Thanks.

---

<div class="post-metadata">

### Author: ![christiangalsterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christiangalsterer/32/6447_2.png) [@christiangalsterer](https://discuss.elastic.co/u/christiangalsterer)
#### Post date: [March 2, 2017, 5:34am UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/8 "2017-03-02T05:34:46Z")

</div>

Currently it is not possible to change the root field. Instead of sending the data directly to Elasticsearch you can send the data first to Logstash and use one powerful features and plugins to manipulate the payload before forwarding it to Elasticsearch. You can also try to use the ingest node feature of Elasticsearch which provides similar capabilities  
but I haven't use the ingest node myself yet.

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [March 3, 2017, 12:26pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/9 "2017-03-03T12:26:19Z")

</div>

In case you have jolokia in place, you could also be interested in the jolokia module: [https://github.com/elastic/beats/pull/3570](https://github.com/elastic/beats/pull/3570)

---

<div class="post-metadata">

### Author: ![Kernel\_Panic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kernel_panic/32/12294_2.png) [@Kernel\_Panic](https://discuss.elastic.co/u/Kernel_Panic)
#### Post date: [April 9, 2017, 11:55am UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/10 "2017-04-09T11:55:05Z")

</div>

Hi Ruflin,  
That module seems to be awesome, is it safe to integrate with ES 5? how can I do it? any repo? or should I clone a git repo? can you provide some steps?

Thanks  
Regards

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [April 13, 2017, 11:04am UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/11 "2017-04-13T11:04:07Z")

</div>

The jolokia module is in the nightly builds ([https://beats-nightlies.s3.amazonaws.com/index.html?prefix=metricbeat/](https://beats-nightlies.s3.amazonaws.com/index.html?prefix=metricbeat/)) and will be part of 5.4 release. The data structure is compatible with ES 5.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 9:49pm UTC](https://discuss.elastic.co/t/topbeat-for-jvm-metrics-monitoring/38444/12 "2017-07-05T21:49:41Z")

</div>


