Skip to content

Commit 3e90d65

Browse files
ruflinjsoriano
authored andcommitted
Add xpack data structure for Elasticsearch index_summary metricset (#7102)
* Add xpack data structure for Elasticsearch index_summary metricset * Add ID to node info and make an empty node ID possible * update interval calculation
1 parent 253bc71 commit 3e90d65

File tree

5 files changed

+1650
-15
lines changed

5 files changed

+1650
-15
lines changed

metricbeat/module/elasticsearch/elasticsearch.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type NodeInfo struct {
2323
TransportAddress string `json:"transport_address"`
2424
IP string `json:"ip"`
2525
Name string `json:"name"`
26+
ID string
2627
}
2728

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

148149
// _local will only fetch one node info. First entry is node name
149150
for k, v := range nodesStruct.Nodes {
150-
if k == nodeID {
151+
// In case the nodeID is empty, first node info will be returned
152+
if k == nodeID || nodeID == "" {
153+
v.ID = k
151154
return v, nil
152155
}
153156
}

0 commit comments

Comments
 (0)