Skip to content

Commit

Permalink
Add xpack data structure for Elasticsearch index_summary metricset
Browse files Browse the repository at this point in the history
* Add ID to node info and make an empty node ID possible
  • Loading branch information
ruflin committed May 22, 2018
1 parent 9f499c0 commit 6493bcd
Show file tree
Hide file tree
Showing 5 changed files with 1,650 additions and 15 deletions.
5 changes: 4 additions & 1 deletion metricbeat/module/elasticsearch/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type NodeInfo struct {
TransportAddress string `json:"transport_address"`
IP string `json:"ip"`
Name string `json:"name"`
ID string
}

// GetClusterID fetches cluster id for given nodeID
Expand Down Expand Up @@ -147,7 +148,9 @@ func GetNodeInfo(http *helper.HTTP, uri string, nodeID string) (*NodeInfo, error

// _local will only fetch one node info. First entry is node name
for k, v := range nodesStruct.Nodes {
if k == nodeID {
// In case the nodeID is empty, first node info will be returned
if k == nodeID || nodeID == "" {
v.ID = k
return v, nil
}
}
Expand Down
Loading

0 comments on commit 6493bcd

Please sign in to comment.