From dc1bce4151eb58d904faf0793f88e282e17dbf99 Mon Sep 17 00:00:00 2001 From: David Zane Date: Fri, 30 Aug 2024 14:44:43 -0700 Subject: [PATCH] Update GET top N api documentation Signed-off-by: David Zane --- _observing-your-data/query-insights/top-n-queries.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_observing-your-data/query-insights/top-n-queries.md b/_observing-your-data/query-insights/top-n-queries.md index f07fd2dfef7..7303b29eba9 100644 --- a/_observing-your-data/query-insights/top-n-queries.md +++ b/_observing-your-data/query-insights/top-n-queries.md @@ -72,15 +72,13 @@ PUT _cluster/settings ## Monitoring the top N queries -You can use the Insights API endpoint to obtain the top N queries for all metric types: +You can use the Insights API endpoint to obtain the top N queries. Specify the `type` parameter to get top N results for each metric type. Calling this API without `type` returns top N `latency` results by default. ```json GET /_insights/top_queries ``` {% include copy-curl.html %} -Specify a metric type to filter the response: - ```json GET /_insights/top_queries?type=latency ``` @@ -96,6 +94,9 @@ GET /_insights/top_queries?type=memory ``` {% include copy-curl.html %} +If you are not seeing results, verify top N is enabled for the target metric type and ensure search requests were sent during the current `window_size`. +{: .important} + ## Exporting top N query data You can configure your desired exporter to export top N query data to different sinks, allowing for better monitoring and analysis of your OpenSearch queries. Currently, the following exporters are supported: