Skip to content

Commit

Permalink
Cherry-pick #9209 to 6.x: Index node.id in elasticsearch/node metrics…
Browse files Browse the repository at this point in the history
…et (#9281)

* Index node.id in elasticsearch/node metricset (#9209)

* Index node.id in elasticsearch/node metricset

* Adding CHANGELOG entries

* Fixing PR number in CHANGELOG entry

* Adding breaking change entry for node.name field correction

* Fixing field name for 6.x
  • Loading branch information
ycombinator committed Dec 19, 2018
1 parent 1a28b31 commit cd1ac2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ https://github.com/elastic/beats/compare/v6.5.0...6.x[Check the HEAD diff]
- Fix race condition when enriching events with kubernetes metadata. {issue}9055[9055] {issue}9067[9067]
- Fix panic on docker healthcheck collection on dockers without healthchecks. {pull}9171[9171]
- Fix issue with not collecting Elasticsearch cross-cluster replication stats correctly. {pull}9179[9179]
- The `node.name` field in the `elasticsearch/node` metricset now correctly reports the Elasticsarch node name. Previously this field was incorrectly reporting the node ID instead. {pull}9209[9209]

*Packetbeat*

Expand Down Expand Up @@ -125,6 +126,8 @@ https://github.com/elastic/beats/compare/v6.5.0...6.x[Check the HEAD diff]

- Collect custom cluster `display_name` in `elasticsearch/cluster_stats` metricset. {pull}8445[8445]
- Test etcd module with etcd 3.3. {pull}9068[9068]
- All `elasticsearch` metricsets now have module-level `cluster.id` and `cluster.name` fields. {pull}8770[8770] {pull}8771[8771] {pull}9164[9164] {pull}9165[9165] {pull}9166[9166] {pull}9168[9168]
- All `elasticsearch` node-level metricsets now have `node.id` and `node.name` fields. {pull}9168[9168] {pull}9209[9209]
- Add settings to disable docker and cgroup cpu metrics per core. {issue}9187[9187] {pull}9194[9194] {pull}9589[9589]
- The `elasticsearch/node` metricset now reports the Elasticsearch cluster UUID. {pull}8771[8771]
- Support GET requests in Jolokia module. {issue}8566[8566] {pull}9226[9226]
Expand Down
9 changes: 5 additions & 4 deletions metricbeat/module/elasticsearch/node/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
},
"elasticsearch": {
"cluster": {
"id": "91RpCx2xSQ21pVPTZfDK0Q",
"name": "elasticsearch"
"id": "wafoCXEDTrGxpYViNueSaA",
"name": "es1"
},
"node": {
"id": "v5gHTHqKSRa4bZ9vbyDy7g",
"jvm": {
"memory": {
"heap": {
Expand All @@ -31,11 +32,11 @@
},
"version": "11.0.1"
},
"name": "DSiWcTyeThWtUXLB9J0BMw",
"name": "es1_1",
"process": {
"mlockall": false
},
"version": "7.0.0-alpha1"
"version": "7.0.0"
}
},
"metricset": {
Expand Down
5 changes: 2 additions & 3 deletions metricbeat/module/elasticsearch/node/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func eventsMapping(r mb.ReporterV2, info elasticsearch.Info, content []byte) err
}

var errs multierror.Errors
for name, node := range nodesStruct.Nodes {
for id, node := range nodesStruct.Nodes {
event := mb.Event{}

event.RootFields = common.MapStr{}
Expand All @@ -93,8 +93,7 @@ func eventsMapping(r mb.ReporterV2, info elasticsearch.Info, content []byte) err
continue
}

// Write name here as full name only available as key
event.MetricSetFields["name"] = name
event.MetricSetFields["id"] = id

r.Event(event)
}
Expand Down

0 comments on commit cd1ac2f

Please sign in to comment.