[Infra Monitoring UI] Change node metrics tables to use a terms agg #128645
Labels
Feature:Metrics UI
Metrics UI feature
info-needed
Team:Infra Monitoring UI - DEPRECATED
DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Currently the tables use a composite aggregation that asks for a single page of 10 000 items, the result is then sorted on the client side (via the Metrics Explorer API).
This means we risk missing a node that is higher relevance due to the shard ordering and that the browser has to do work that Elasticsearch could do for us.
Rather we should aim to have the tables run their own custom aggregation query that uses a terms agg and lets Elasticsearch do the searching. We can do this by using the data plugins default search strategy.
The key part of this query is the bucketing size in the date_range sub aggregation, the Metrics Explorer API has code for this that would be good to re-use. The date_range buckets can then be calculated moving backwards from the end of the timerange (which improves the predictability compared to using a date_histogram).
As a result of doing this we can also simplify the data hooks for the tables, a lot of that code is only there to transform the response from the Metrics Explorer API to something more suited for the tables.
AC
TBD
The text was updated successfully, but these errors were encountered: