From 942f59b0248dd5711cbd18f820be6f74102982b9 Mon Sep 17 00:00:00 2001 From: darshanpatel29 Date: Mon, 15 Jul 2019 14:16:21 -0700 Subject: [PATCH] add write metric to thread_pools for 6.3+ versions --- elasticsearch_collectd.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/elasticsearch_collectd.py b/elasticsearch_collectd.py index 33ec7ce..60ea0cd 100755 --- a/elasticsearch_collectd.py +++ b/elasticsearch_collectd.py @@ -926,6 +926,17 @@ def init_stats(self): and not self.es_version.startswith("2.0"): thread_pools.extend(['force_merge']) + # Add the 6.3 metrics + if self.es_version.startswith("6."): + if self.es_version[2:].find(".") != -1: + minor_release_number = self.es_version[2: 2 + self.es_version[2:].find(".")] + else: + minor_release_number = self.es_version[2:] + if int(minor_release_number) > 2: + thread_pools.extend(['write']) + elif int(self.es_version[:self.es_version.find(".")]) > 6: + thread_pools.extend(['write']) + # Legacy support for old configurations without Thread Pools config if len(self.configured_thread_pools) == 0: self.thread_pools = list(self.configured_thread_pools)