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

Add x-pack data for Elasticsearch shard metricset #7097

Merged
merged 1 commit into from
May 17, 2018

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented May 15, 2018

  • Introduces GetNodeInfo method to fetch additional info about the node. This should become obsolete in the future.
  • Refactor shard metricset to use module level hostParser and metricset.

The xpack feature works but will need further testing with new builds of Elasticsearch. The plan is to test all xpack metricsets together when they are all done and do further tweaks.

@ruflin ruflin added in progress Pull request is currently in progress. module Metricbeat Metricbeat labels May 15, 2018
@@ -124,3 +131,24 @@ func fetchPath(http *helper.HTTP, uri, path string) ([]byte, error) {
http.SetURI(u.String())
return http.FetchContent()
}

func GetNodeInfo(http *helper.HTTP, uri string, nodeID string) (*NodeInfo, error) {

Choose a reason for hiding this comment

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

exported function GetNodeInfo should have comment or be unexported

@@ -17,6 +17,13 @@ type Info struct {
ClusterID string `json:"cluster_uuid"`
}

type NodeInfo struct {

Choose a reason for hiding this comment

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

exported type NodeInfo should have comment or be unexported

"node": c.Str("node"),
"index": c.Str("index"),
"shard": c.Int("shard"),
"relocating_node": c.Str("relocating_node"),
Copy link
Member Author

Choose a reason for hiding this comment

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

@pickypg This value is most of the time null. In these cases metricbeat just skips the value instead of sending null. Is that ok?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that should be fine.

"host": nodeInfo.Host,
"transport_address": nodeInfo.TransportAddress,
"ip": nodeInfo.IP,
// This seems to be in the x-pack data a subset of the cluster_uuid not the name?
Copy link
Member Author

Choose a reason for hiding this comment

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

@pickypg Should this be a subest of the cluster_uuid?


// This is currently needed because the cluser_uuid is `na` in stateData in case not the full state is requested.
// This needs to be brought up with the ES team.
clusterID, err := elasticsearch.GetClusterID(m.HTTP, m.HostData().SanitizedURI+statePath, stateData.MasterNode)
Copy link
Member Author

Choose a reason for hiding this comment

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

@pickypg @tlrx You might now more here? On ES master the following request http://localhost:9200/_cluster/state/version,master_node,routing_table?pretty returns:

{
  "cluster_name" : "elasticsearch",
  "compressed_size_in_bytes" : 36170,
  "cluster_uuid" : "_na_",
  "version" : 59,

If I fetch http://localhost:9200/_cluster/state/?pretty I get

{
  "cluster_name" : "elasticsearch",
  "compressed_size_in_bytes" : 36170,
  "cluster_uuid" : "Ir3Dhzo-TluhYWEaz4UZlA",
  "version" : 59,

Is this a bug?

Copy link
Member

Choose a reason for hiding this comment

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

Good catch @ruflin

I created elastic/elasticsearch#30656 and asked Chris to review it.

@ruflin ruflin force-pushed the shard-xpack branch 2 times, most recently from eb9dd0f to 0d5ecec Compare May 17, 2018 09:26
@ruflin ruflin changed the title [WIP] Add x-pack data for Elasticsearch shard metricset Add x-pack data for Elasticsearch shard metricset May 17, 2018
* Introduces GetNodeInfo method to fetch additional info about the node. This should become obsolete in the future.
* Refactor shard metricset to use module level hostParser and metricset.

The xpack feature works but will need further testing with new builds of Elasticsearch. The plan is to test all xpack metricsets together when they are all done and do further tweaks.
@ruflin ruflin added review and removed in progress Pull request is currently in progress. labels May 17, 2018
@jsoriano jsoriano merged commit 95ab81e into elastic:master May 17, 2018
stevea78 pushed a commit to stevea78/beats that referenced this pull request May 20, 2018
* Introduces GetNodeInfo method to fetch additional info about the node. This should become obsolete in the future.
* Refactor shard metricset to use module level hostParser and metricset.

The xpack feature works but will need further testing with new builds of Elasticsearch. The plan is to test all xpack metricsets together when they are all done and do further tweaks.
stevea78 pushed a commit to stevea78/beats that referenced this pull request May 20, 2018
* Introduces GetNodeInfo method to fetch additional info about the node. This should become obsolete in the future.
* Refactor shard metricset to use module level hostParser and metricset.

The xpack feature works but will need further testing with new builds of Elasticsearch. The plan is to test all xpack metricsets together when they are all done and do further tweaks.
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.

5 participants