[Monitoring/Beats] Telemetry Data from Beats#18833
Conversation
There was a problem hiding this comment.
NOTE: it's possible to filter apm-server out of the search, but I figure it's useful for telemetry
There was a problem hiding this comment.
We should probably filter it out since APM Server isn't really supported by monitoring and it will almost certainly have different metrics. If we change our minds later, it's easier to remove the filter than to add it and adjust everything.
There was a problem hiding this comment.
6d010fb - I just added the filter to the query, not updated the mock data for the unit test
💚 Build Succeeded |
pickypg
left a comment
There was a problem hiding this comment.
The code looks great, but I think we can optimize for the expensive scenarios.
There was a problem hiding this comment.
We should probably filter it out since APM Server isn't really supported by monitoring and it will almost certainly have different metrics. If we change our minds later, it's easier to remove the filter than to add it and adjust everything.
|
|
||
| const results = await callCluster('search', params); | ||
|
|
||
| const hitsLength = get(results, 'hits.hits.length', -1); |
There was a problem hiding this comment.
When there is a UI involved, the easiest way to determine if you need to get the next page when you cannot trust the total size is to over-request. So in the request, request HITS_SIZE + 1. Then just process HITS_SIZE and, if the + 1 exists, then request the next page and repeat.
But in this case, there's no extra pain because either way we're stuck requesting that next page -- it may come back empty though. We should default this value to 0 and ignore the whole results payload in that case.
| const results = await callCluster('search', params); | ||
|
|
||
| const hitsLength = get(results, 'hits.hits.length', -1); | ||
| resultSet.push(results); |
There was a problem hiding this comment.
We should pre-process each payload before saving it to minimize the amount of data that we maintain in the heap during this process. Otherwise we will have every unique instance sitting in heap until the end.
Perhaps handleBeatsResultSet could be augmented to have the clusters object passed in so that it can just pickup where it left off while also only expecting a single result set instead of the paged array?
There was a problem hiding this comment.
Sounds good. Are you thinking we pass in results from a single query as well as the clusters object to handleBeatsResultSet, which mutates clusters to have new processed stat data? The object mutation wouldn't worry me since the object's lifecycle exists just in this lib file.
💚 Build Succeeded |
|
The issue to track the progress on getting these metrics from Beats is here: elastic/beats#7027 |
|
Thank you! |
* [Monitoring/Beats] Telemetry Data from Beats * filter apm-server * ignore results payload if hitsLength === 0 * process each payload as stats are saved to clusters object
|
6.x/6.4: #18922 |
This adds anonymous Beats statistics found in the Monitoring data to the telemetry payload.
To test:
NOTE: module stats are still in-progress on the Beats collection side