# MetricBeat - how to define Elasticsearch JVM metrics

**URL:** <https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 4, 2018, 2:20pm UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756 "2018-04-04T14:20:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikita\_Krasnov](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nikita\_Krasnov](https://discuss.elastic.co/u/Nikita_Krasnov)\
**Post date:** [April 4, 2018, 2:20pm UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/1 "2018-04-04T14:20:28Z")

</div>

Hello to everyone.  
I want to know how to define Elasticsearch JVM `heap usage in percentage` and `number of garbage collectors per some period of time`.  
I have already configure Elasticsearch module for Metricbeat and saw these [https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html#\_jvm\_gc\_collectors\_fields](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html#_jvm_gc_collectors_fields) fields but right know don't understand how to get such information from them...

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [April 4, 2018, 2:26pm UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/2 "2018-04-04T14:26:15Z")

</div>

You need to use the Elasticsearch module of Metricbeat. This documentation contains an example configuration: [https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-elasticsearch.html](https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-module-elasticsearch.html)

Please share your config, if you have problems with using the module.

---

<div class="post-metadata">

**Author:** ![Nikita\_Krasnov](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nikita\_Krasnov](https://discuss.elastic.co/u/Nikita_Krasnov)\
**Post date:** [April 4, 2018, 2:37pm UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/3 "2018-04-04T14:37:36Z")

</div>

I have set my configuration. Everything is working and I gather metrics but I don't know how to calculate fields `heap usage in percentage` and `number of garbage collectors per some period of time` for displaying grafics on Kibana/Grafana. To be more exactly, it's not a fields but meanings which I want to get from fields - [https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html](https://www.elastic.co/guide/en/beats/metricbeat/current/exported-fields-elasticsearch.html)

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [April 4, 2018, 8:42pm UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/4 "2018-04-04T20:42:57Z")

</div>

Sorry, I though you had problems with Metricbeat.

Unfortunately, right now Elasticsearch module does not contain enough info to calculate these values.

---

<div class="post-metadata">

**Author:** ![Nikita\_Krasnov](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nikita\_Krasnov](https://discuss.elastic.co/u/Nikita_Krasnov)\
**Post date:** [April 5, 2018, 8:45am UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/5 "2018-04-05T08:45:09Z")

</div>

`elasticsearch.node.stats.jvm.mem.pools.young.used.bytes` - as I understood, it's used bytes (in young gen) by memory pool but not by memory heap. Pool is a part of heap.  
Am I right?

---

<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 6, 2018, 7:53am UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/6 "2018-04-06T07:53:24Z")

</div>

I think the raw json output from the elasticsearch endpoint explains it best. Here you can find it: [https://github.com/elastic/beats/blob/master/metricbeat/module/elasticsearch/node\_stats/\_meta/test/node\_stats.522.json#L176](https://github.com/elastic/beats/blob/master/metricbeat/module/elasticsearch/node_stats/_meta/test/node_stats.522.json#L176)

We plan to add more values to the Elasticsearch metricsets in the near future.

---

<div class="post-metadata">

**Author:** ![Nikita\_Krasnov](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@Nikita\_Krasnov](https://discuss.elastic.co/u/Nikita_Krasnov)\
**Post date:** [April 6, 2018, 8:11am UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/7 "2018-04-06T08:11:45Z")

</div>

Thanks. Please, in the next version of metric beat add values`"heap_used_in_bytes", "heap_used_percent"`.  
Should I write it to some gitHub task or something else?

---

<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 6, 2018, 11:46am UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/8 "2018-04-06T11:46:26Z")

</div>

Best comment here so we don't foget about it: [https://github.com/elastic/beats/issues/5965](https://github.com/elastic/beats/issues/5965)

---

<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:** [May 4, 2018, 11:46am UTC](https://discuss.elastic.co/t/metricbeat-how-to-define-elasticsearch-jvm-metrics/126756/9 "2018-05-04T11:46:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
