Collect bulk indexing stats for Elasticsearch metricsets#17992
Collect bulk indexing stats for Elasticsearch metricsets#17992ycombinator merged 9 commits intoelastic:masterfrom ycombinator:mb-es-xp-fix-parity
Conversation
|
Pinging @elastic/stack-monitoring (Stack monitoring) |
|
Pinging @elastic/integrations-services (Team:Services) |
|
@igoristic I've requested your review on this PR as a functional reviewer. Please see the "How to test this PR locally" section in the PR description for instructions on how to functionally test this PR. |
💚 Build SucceededExpand to view the summary
Build stats
Test stats 🧪
|
|
Failure in statsd tests should be fixed by #18130, the other failures may be related. |
|
Looking at the CI errors from the This PR adds To address this correctly, we need to add Accordingly, I'm moving this PR back into draft state. Once I've implemented the necessary changes, I'll put it back into review. |
Yeah I was wondering if I should wait for the CI to turn green before I can test it |
That would be ideal but there might be unrelated test failures. I'll ping you here where it's ready to test. |
|
@igoristic CI is looking good now. There are failures but they are unrelated to this PR. Please go ahead and test it. Thanks! |
igoristic
left a comment
There was a problem hiding this comment.
Tested all case scenarios mentioned in step 5, and those fields are no longer null (like they are in master):

Thank you for fixing this @ycombinator 🙇
…8229) * Collecting new index_stats bulk metrics * Collecting new indices_stats bulk metrics * Collecting new node_stats bulk metrics * Adding CHANGELOG entry * Request bulk stats * Request bulk metrics only if supported * Fixing code and tests * Fixing code so only service URI path is replaced * Updating unit tests
| TotalOperations int `json:"total_operations"` | ||
| TotalTimeInMillis int `json:"total_time_in_millis"` | ||
| TotalSizeInBytes int `json:"total_size_in_bytes"` | ||
| AvgTimeInMillis int `json:"throttle_time_in_millis"` |
There was a problem hiding this comment.
@ycombinator Is this a typo? Should it be json:"avg_time_in_millis"?
There was a problem hiding this comment.
Yes, it should 😞. Good eye, nice catch! I assume parity tests failed? I'll put up a PR to fix it. Thanks!
What does this PR do?
Collects new
bulkindexing metrics being reported by Elasticsearch in theindex,index_summary, andnode_statsmetricsets for the Stack Monitoring code path (i.e. whenxpack.enabled: trueis set in these metricsets' configurations).These metricsets correspond to
type:index_stats,type:indices_stats, andtype:node_statsdocuments, respectively, in.monitoring-es-*indices used by the Stack Monitoring UI.Why is it important?
To restore parity between legacy internal collection and Metricbeat collection for Elasticsearch monitoring. The changes corresponding to this PR for legacy internal collection were made in elastic/elasticsearch#52208.
Checklist
I have commented my code, particularly in hard-to-understand areasI have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test this PR locally
Run the latest
8.0.0-SNAPSHOTbuild of Elasticsearch so it exposes the newbulkindexing metrics being collected by the code in this PR.Build Metricbeat with the changes in this PR.
Enable the
elasticsearch-xpackmodule.Create a minimal Metricbeat configuration for testing.
Here, we only enable
monitoring.elasticsearchto generate some bulk indexing requests to Elasticsearch so we can see non-zero bulk metrics.Run Metricbeat with the minimal configuration and look for the new
bulkindexing metrics' fields. You may need to run these for ~30 seconds for some bulk indexing to happen and corresponding metrics to be generated by Elasticsearch.indexmetricset, i.e.type:index_statsdocuments:index_summarymetricset, i.e.type:indices_statsdocuments:node_statsmetricset, i.e.type:node_statsdocuments:Related issues