Add node_name to tags.
This commit is contained in:
parent
55cfd5c904
commit
3f6c46e1ec
|
@ -13,6 +13,7 @@ const indicesStatsPathLocal = "/_nodes/_local/stats/indices"
|
||||||
|
|
||||||
type node struct {
|
type node struct {
|
||||||
Host string `json:"host"`
|
Host string `json:"host"`
|
||||||
|
Name string `json:"name"`
|
||||||
Indices map[string]map[string]interface{} `json:"indices"`
|
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 {
|
for _, n := range esRes.Nodes {
|
||||||
tags := map[string]string{
|
tags := map[string]string{
|
||||||
"node_host": n.Host,
|
"node_host": n.Host,
|
||||||
|
"node_name": n.Name,
|
||||||
"cluster_name": esRes.ClusterName,
|
"cluster_name": esRes.ClusterName,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -249,6 +249,7 @@ func TestElasticsearch(t *testing.T) {
|
||||||
|
|
||||||
tags := map[string]string{
|
tags := map[string]string{
|
||||||
"node_host": "test",
|
"node_host": "test",
|
||||||
|
"node_name": "test.host.com",
|
||||||
"cluster_name": "es-testcluster",
|
"cluster_name": "es-testcluster",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue