Skip to content

Add host reporting to state API endpoint#7508

Merged
exekias merged 1 commit intoelastic:masterfrom
ruflin:host-reporting
Jul 9, 2018
Merged

Add host reporting to state API endpoint#7508
exekias merged 1 commit intoelastic:masterfrom
ruflin:host-reporting

Conversation

@ruflin
Copy link
Copy Markdown
Contributor

@ruflin ruflin commented Jul 4, 2018

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

exported function ReportInfo should have comment or be unexported

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

exported function MapHostInfo should have comment or be unexported

@ruflin
Copy link
Copy Markdown
Contributor Author

ruflin commented Jul 4, 2018

@urso WDYT about a MapStr visitor that does not support slices and arrays?
@brandonmensing FYI

@ruflin ruflin mentioned this pull request Jul 5, 2018
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.
@exekias exekias merged commit bd273ee into elastic:master Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants