Add host reporting to state API endpoint#7508
Merged
exekias merged 1 commit intoelastic:masterfrom Jul 9, 2018
Merged
Conversation
houndci-bot
reviewed
Jul 4, 2018
libbeat/metric/system/host/host.go
Outdated
There was a problem hiding this comment.
exported function ReportInfo should have comment or be unexported
libbeat/metric/system/host/host.go
Outdated
There was a problem hiding this comment.
exported function MapHostInfo should have comment or be unexported
Contributor
Author
|
@urso WDYT about a MapStr visitor that does not support slices and arrays? |
9 tasks
Calling the `/state` API endpoint the data returned looks as following:
```
{
"beat": {
"name": "ruflin"
},
"host": {
"architecture": "x86_64",
"name": "ruflin",
"os": {
"build": "17E202",
"family": "darwin",
"platform": "darwin",
"version": "10.13.4"
}
},
"module": {
"count": 3,
"names": [
"system"
]
},
"service": {
"id": "ac7c8804-42da-4aa3-911c-eea5dd9a460b",
"name": "metricbeat",
"version": "7.0.0-alpha1"
}
}
```
This is the same data as is added by the add_host_metadata processor. It is also reported as part of the monitoring endpoint and means it has to be added to the Elasticsearch monitoring template after merging.
The code for the reporter generation and MapStr was moved into the same file to simplify to keep them in sync. An idea would be to have a Visitor for MapStr which would make the additional code obsolete.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling the
/stateAPI endpoint the data returned looks as following:This is the same data as is added by the add_host_metadata processor. It is also reported as part of the monitoring endpoint and means it has to be added to the Elasticsearch monitoring template after merging.
The code for the reporter generation and MapStr was moved into the same file to simplify to keep them in sync. An idea would be to have a Visitor for MapStr which would make the additional code obsolete.