Skip to content

Commit

Permalink
Update elasticsearch.node_stats to use ReporterV2 (#6917)
Browse files Browse the repository at this point in the history
To allow more flexibility the Elasticsearch node_stats metricset is updated to use the ReporverV2 interface. This is a subset of #6807.

* Test data set for ES 6.2.3 added
* Reporting of error if json decoding fails
* Update node_stats integration tests to use reporter interface
* Update generator to also add metricset info
* Update data.json for node_stats and index
* Set namespace as part of registration
* Add service.name to event
  • Loading branch information
ruflin authored and exekias committed Apr 25, 2018
1 parent 3420f93 commit b35a7a0
Show file tree
Hide file tree
Showing 8 changed files with 607 additions and 76 deletions.
2 changes: 1 addition & 1 deletion metricbeat/mb/testing/data_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func WriteEventsReporterV2(f mb.ReportingMetricSetV2, t testing.TB) error {
return fmt.Errorf("no events were generated")
}

e := StandardizeEvent(f, events[0])
e := StandardizeEvent(f, events[0], mb.AddMetricSetInfo)

WriteEventToDataJSON(t, e)
return nil
Expand Down
18 changes: 12 additions & 6 deletions metricbeat/module/elasticsearch/index/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@
"name": "docker-cluster"
},
"index": {
"name": ".watches",
"name": ".monitoring-es-6-2018.04.22",
"total": {
"docs": {
"count": 6,
"deleted": 0
"count": 241933,
"deleted": 525
},
"segments": {
"count": 3,
"count": 16,
"memory": {
"bytes": 11505
"bytes": 565573
}
},
"store": {
"size": {
"bytes": 67980
"bytes": 135541290
}
}
}
}
},
"metricset": {
"host": "127.0.0.1:9200",
"module": "elasticsearch",
"name": "index",
"rtt": 115
},
"service": {
"name": "elasticsearch"
}
Expand Down
57 changes: 30 additions & 27 deletions metricbeat/module/elasticsearch/node_stats/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,35 @@
"name": "docker-cluster"
},
"node": {
"name": "ab1_1Gw3Rtax_2l78Gq_CQ",
"name": "VnS118cKS7-8mz8l2jZZKQ",
"stats": {
"fs": {
"summary": {
"available": {
"bytes": 50680381440
"bytes": 36334804992
},
"free": {
"bytes": 54133080064
"bytes": 39551520768
},
"total": {
"bytes": 67371577344
"bytes": 62725623808
}
}
},
"indices": {
"docs": {
"count": 52,
"deleted": 4
"count": 1141228,
"deleted": 42042
},
"segments": {
"count": 3,
"count": 154,
"memory": {
"bytes": 20655
"bytes": 2862018
}
},
"store": {
"size": {
"bytes": 107559
"bytes": 642756442
}
}
},
Expand All @@ -46,14 +46,14 @@
"collectors": {
"old": {
"collection": {
"count": 7,
"ms": 3801
"count": 105,
"ms": 14100
}
},
"young": {
"collection": {
"count": 56,
"ms": 14782
"count": 43895,
"ms": 423308
}
}
}
Expand All @@ -62,44 +62,44 @@
"pools": {
"old": {
"max": {
"bytes": 62914560
"bytes": 362414080
},
"peak": {
"bytes": 53816432
"bytes": 275023840
},
"peak_max": {
"bytes": 62914560
"bytes": 362414080
},
"used": {
"bytes": 40017472
"bytes": 255660936
}
},
"survivor": {
"max": {
"bytes": 3145728
"bytes": 17432576
},
"peak": {
"bytes": 3145728
"bytes": 17432576
},
"peak_max": {
"bytes": 3145728
"bytes": 17432576
},
"used": {
"bytes": 3145728
"bytes": 4414672
}
},
"young": {
"max": {
"bytes": 25165824
"bytes": 139591680
},
"peak": {
"bytes": 25165824
"bytes": 139591680
},
"peak_max": {
"bytes": 25165824
"bytes": 139591680
},
"used": {
"bytes": 21071064
"bytes": 91758824
}
}
}
Expand All @@ -108,11 +108,14 @@
}
}
},
"event": {
"service": "elasticsearch"
},
"metricset": {
"host": "elasticsearch:9200",
"host": "127.0.0.1:9200",
"module": "elasticsearch",
"name": "node_stats",
"namespace": "node.stats",
"namespace": "elasticsearch.node.stats",
"rtt": 115
}
}
Loading

0 comments on commit b35a7a0

Please sign in to comment.