Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index node.id in elasticsearch/node metricset #9209

Merged
merged 4 commits into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha1...master[Check the HEAD d
- Fix issue preventing diskio metrics collection for idle disks. {issue}9124[9124] {pull}9125[9125]
- 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 @@ -207,6 +208,8 @@ https://github.com/elastic/beats/compare/v6.5.0...v7.0.0-alpha1[View commits]
- Add experimental socket summary metricset to system module {pull}6782[6782]
- 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]

*Packetbeat*

Expand Down
11 changes: 6 additions & 5 deletions metricbeat/module/elasticsearch/node/_meta/data.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"@timestamp": "2017-10-12T08:05:34.853Z",
"beat": {
"agent": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: Remember that this needs to be beat in the 6.x backport PR.

"hostname": "host.example.com",
"name": "host.example.com"
},
"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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this a "bug" before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it was. We were actually assigning the node ID to the name field in the event. It's easy to get them confused because by default ES will set the node name as the node ID.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is potentially a breaking change or a bug fix, so we should probably mention it in the changelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Added CHANGELOG entry in breaking changes section in d3750ad7e.


r.Event(event)
}
Expand Down