You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If user calls Top N api without any type param (ex GET /_insights/top_queries) we use type=latency by default. That is why no results are returned anytime latency is disabled but cpu and/or memory are enabled.
final String metricType = request.param("type", MetricType.LATENCY.toString());
@dzane17 is right, I think this is a bug introduced when adding CPU and memory as additional metric types. IMO we should not set the default metric type subjectively. But in this case we should also update the API to disallow users to call the API without the type parameter.
What is the bug?
Top N API returns no results when only cpu or only memory is enabled.
In
RestTopQueriesAction
we have a single check for MetricType.LATENCY which is causing this issue:https://github.com/opensearch-project/query-insights/blob/main/src/main/java/org/opensearch/plugin/insights/rules/resthandler/top_queries/RestTopQueriesAction.java#L69
How can one reproduce the bug?
search.query.metrics.enabled
are disabled.API will return no results even though top N cpu is enabled
What is the expected behavior?
Top N should return results if any 1 or more metrics (latency, cpu, memory) are enabled.
The text was updated successfully, but these errors were encountered: