-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
@@ -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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
eb9dd0f
to
0d5ecec
Compare
* 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.
* 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.
* 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.
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.