diff --git a/plugins/elasticsearch/elasticsearch.go b/plugins/elasticsearch/elasticsearch.go index 2600a583c..a9d52d7b5 100644 --- a/plugins/elasticsearch/elasticsearch.go +++ b/plugins/elasticsearch/elasticsearch.go @@ -22,6 +22,7 @@ type node struct { ThreadPool interface{} `json:"thread_pool"` Network interface{} `json:"network"` FS interface{} `json:"fs"` + Transport interface{} `json:"transport"` } const sampleConfig = ` @@ -123,6 +124,9 @@ func (e *Elasticsearch) gatherUrl(url string, acc plugins.Accumulator) error { if err := e.parseInterface(acc, "fs", tags, n.FS); err != nil { return err } + if err := e.parseInterface(acc, "transport", tags, n.Transport); err != nil { + return err + } } return nil diff --git a/plugins/elasticsearch/elasticsearch_test.go b/plugins/elasticsearch/elasticsearch_test.go index 36bf46ae3..3d82877ab 100644 --- a/plugins/elasticsearch/elasticsearch_test.go +++ b/plugins/elasticsearch/elasticsearch_test.go @@ -78,4 +78,8 @@ func TestElasticsearch(t *testing.T) { for key, val := range fsExpected { assert.NoError(t, acc.ValidateTaggedValue(key, val, tags)) } + + for key, val := range transportExpected { + assert.NoError(t, acc.ValidateTaggedValue(key, val, tags)) + } } diff --git a/plugins/elasticsearch/testdata_test.go b/plugins/elasticsearch/testdata_test.go index 1d57c7404..055a20e3a 100644 --- a/plugins/elasticsearch/testdata_test.go +++ b/plugins/elasticsearch/testdata_test.go @@ -400,6 +400,13 @@ const statsResponse = ` "available_in_bytes": 15894814720 } ] + }, + "transport": { + "server_open": 13, + "rx_count": 6, + "rx_size_in_bytes": 1380, + "tx_count": 6, + "tx_size_in_bytes": 1380 } } } @@ -667,3 +674,11 @@ var fsExpected = map[string]float64{ "fs_total_available_in_bytes": 15894814720, "fs_total_total_in_bytes": 19507089408, } + +var transportExpected = map[string]float64{ + "transport_server_open": 13, + "transport_rx_count": 6, + "transport_rx_size_in_bytes": 1380, + "transport_tx_count": 6, + "transport_tx_size_in_bytes": 1380, +}