-
Notifications
You must be signed in to change notification settings - Fork 5k
Adding cluster_stats metricset for elasticsearch module #7638
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
Adding cluster_stats metricset for elasticsearch module #7638
Conversation
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.
don't use an underscore in package 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.
don't use an underscore in package 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.
don't use an underscore in package 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.
don't use an underscore in package 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.
don't use an underscore in package 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.
How does the cluster index data overlap with the index and node_stats metricset data?
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.
-
indexmetricset hasdocs,segments, andstorewhich are also present in this metricset here. -
node_statsmetricset hasdocs,segments, andstore, which are also present in this metricset here. -
node_statsmetricset also hasfsandjvmstats, which are currently not present in this metricset here but are available from the ElasticsearchGET _cluster/statsAPI. -
This metricset here has
shardswhich is absent in theindexmetricset and also not available from the ElasticsearchGET _statsAPI. -
This metricset here has
shardswhich is absent in thenode_statsmetricset and also not available from the ElasticsearchGET _nodes/_localAPI or theGET _nodex/_local/statsAPI. -
This metricset here has
fielddatawhich is absent in theindexmetricset but is available from the ElasticsearchGET _statsAPI. -
This metricset here has
fielddatawhich is absent in thenode_statsmetricset and also not available from the ElasticsearchGET _nodes/_localAPI. However it is available from the ElasticsearchGET _nodes/_local/statsAPI. Of course, the latter API is missing a bunch of other fields that are present in the former API so either we call both or we ask the ES team to enhance the latter API's response to include all the fields we use from the former API's response as well.
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.
I do need to fix the field names in this metricset here so they match up with the ones in other elasticsearch metricsets (e.g. I need to use count instead of total, etc.)
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.
Field names fixed in 6662787.
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.
Should we report all the data we have in the index and node_stats metricset here too? Or should we focus on the data points that other metricsets don't have?
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.
I think to start off we can only report the stats that are not already covered by other metricsets. Concretely, those would be fielddata and shards fields.
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.
++
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.
Fixed in 27ef3fb.
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.
++
I think both values are a must to be returned y cluster stats API
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.
Created elastic/elasticsearch#32205 to request cluster UUID from cluster stats API itself.
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.
... and put up PR as well: elastic/elasticsearch#32206
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.
Keep in mind that older versions of ES will not have it in, so in these cases we need to skip it.
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 point! Should we skip it or make the extra API call in that case (I realize that complicates the logic/organization of the code a fair bit)?
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.
Lets skip it to not add more complexity. New versions, new features :-)
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.
Fixed in ed74319b4.
ruflin
left a comment
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.
Code LGTM. Could you add a CHANGELOG entry?
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.
Apply to all lines: I think normally we put a dot at the end for the docs.
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.
Can we also have one for 630?
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.
Added in a5953bd.
|
@ycombinator Looks like this could be merged before the ES PR is merged as we do check if the field exists? Could you rebase and directly squash the commits? |
|
Yes, good point @ruflin. I will fix up this PR now so it can be reviewed/merged soon. |
This PR adds a
cluster_statsmetricset for theelasticsearchMetricbeat module. Only an initial set of fields are added by this PR.For follow up PRs