From 9d3d683677d9d7e58640a7ae06df8cfd6ad7633b Mon Sep 17 00:00:00 2001 From: David Zane Date: Fri, 30 Aug 2024 14:54:47 -0700 Subject: [PATCH 1/3] 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 f07fd2dfef..21cc9d9502 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 time window. +{: .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: From b4573b2c8cc8427e8eca1d01cacb1f9ee8699a9b Mon Sep 17 00:00:00 2001 From: David Zane <38449481+dzane17@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:12:11 -0700 Subject: [PATCH 2/3] Update _observing-your-data/query-insights/top-n-queries.md Co-authored-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Signed-off-by: David Zane <38449481+dzane17@users.noreply.github.com> --- _observing-your-data/query-insights/top-n-queries.md | 8 +++++--- 1 file changed, 5 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 21cc9d9502..71fdc34a01 100644 --- a/_observing-your-data/query-insights/top-n-queries.md +++ b/_observing-your-data/query-insights/top-n-queries.md @@ -7,7 +7,7 @@ nav_order: 10 # Top N queries -Monitoring the top N queries in query insights features can help you gain real-time insights into the top queries with high latency within a certain time frame (for example, the last hour). +Monitoring the top N queries using query insights allows you to gain real-time visibility into the queries with the greatest latency or resource consumption over a specified time period (for example, the last hour). ## Configuring top N query monitoring @@ -72,13 +72,15 @@ PUT _cluster/settings ## Monitoring the top N queries -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. +You can use the Insights API endpoint to retrieve the top N queries. This API returns top N `latency` results by default. ```json GET /_insights/top_queries ``` {% include copy-curl.html %} +Specify the `type` parameter to retrieve the top N results for other metric types. The results will be sorted in descending order based on the specified metric type. + ```json GET /_insights/top_queries?type=latency ``` @@ -94,7 +96,7 @@ 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 time window. +If your query returns no results, ensure that top N is enabled for the target metric type and that search requests were made within the current [time window](#configuring-the-window-size). {: .important} ## Exporting top N query data From bea3622a0676fc13703ca62b0c622484d9338b98 Mon Sep 17 00:00:00 2001 From: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:43:39 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Nathan Bower Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> --- _observing-your-data/query-insights/top-n-queries.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_observing-your-data/query-insights/top-n-queries.md b/_observing-your-data/query-insights/top-n-queries.md index 71fdc34a01..b63d670926 100644 --- a/_observing-your-data/query-insights/top-n-queries.md +++ b/_observing-your-data/query-insights/top-n-queries.md @@ -7,7 +7,7 @@ nav_order: 10 # Top N queries -Monitoring the top N queries using query insights allows you to gain real-time visibility into the queries with the greatest latency or resource consumption over a specified time period (for example, the last hour). +Monitoring the top N queries using query insights allows you to gain real-time visibility into the queries with the highest latency or resource consumption in a specified time period (for example, the last hour). ## Configuring top N query monitoring @@ -96,7 +96,7 @@ GET /_insights/top_queries?type=memory ``` {% include copy-curl.html %} -If your query returns no results, ensure that top N is enabled for the target metric type and that search requests were made within the current [time window](#configuring-the-window-size). +If your query returns no results, ensure that top N query monitoring is enabled for the target metric type and that search requests were made within the current [time window](#configuring-the-window-size). {: .important} ## Exporting top N query data