Add node_name to tags.

This commit is contained in:
Orne Brocaar 2015-07-08 23:07:10 +02:00
parent 55cfd5c904
commit 3f6c46e1ec
2 changed files with 3 additions and 0 deletions

View File

@ -13,6 +13,7 @@ const indicesStatsPathLocal = "/_nodes/_local/stats/indices"
type node struct {
Host string `json:"host"`
Name string `json:"name"`
Indices map[string]map[string]interface{} `json:"indices"`
}
@ -85,6 +86,7 @@ func (e *Elasticsearch) gatherUrl(url string, acc plugins.Accumulator) error {
for _, n := range esRes.Nodes {
tags := map[string]string{
"node_host": n.Host,
"node_name": n.Name,
"cluster_name": esRes.ClusterName,
}

View File

@ -249,6 +249,7 @@ func TestElasticsearch(t *testing.T) {
tags := map[string]string{
"node_host": "test",
"node_name": "test.host.com",
"cluster_name": "es-testcluster",
}