Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GET top N api documentation #8139

Merged
merged 5 commits into from
Sep 11, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions _observing-your-data/query-insights/top-n-queries.md
dzane17 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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.
dzane17 marked this conversation as resolved.
Show resolved Hide resolved
{: .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:
Expand Down
Loading