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

[Doc] QueryInsightsDashboard #9157

Merged
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8258693
Doc-QueryInsightsDashboard
Feb 5, 2025
e19e0de
Doc-QueryInsightsDashboard-Combined
Feb 5, 2025
15490f4
Doc-QueryInsightsDashboard-Combined
Feb 5, 2025
504e5d1
Doc-QueryInsightsDashboard-Combined
Feb 5, 2025
1554f9d
Doc-QueryInsightsDashboard-Corrections
Feb 6, 2025
b4d2be8
Merge branch 'main' into QueryInsightsDashboard
Naarcha-AWS Feb 6, 2025
709dccb
Update Query-insights-Dashboard.md
KishoreKicha14 Feb 7, 2025
b42ab65
Update Query-insights-Dashboard.md
Naarcha-AWS Feb 10, 2025
653b7ec
Merge branch 'main' into QueryInsightsDashboard
Naarcha-AWS Feb 10, 2025
2f1669a
Fix typos
Naarcha-AWS Feb 10, 2025
43e22c2
Update and rename Query-insights-Dashboard.md to query-insights-dashb…
Naarcha-AWS Feb 10, 2025
5954d84
Update query-insights-dashboard.md
KishoreKicha14 Feb 10, 2025
ba4be6c
Update query-insights-dashboard.md
Naarcha-AWS Feb 10, 2025
b266ed7
Update query-insights-dashboard.md
Naarcha-AWS Feb 10, 2025
dc37e22
Apply suggestions from code review
Naarcha-AWS Feb 10, 2025
3c89083
Update query-insights-dashboard.md
KishoreKicha14 Feb 10, 2025
d4b4e17
Delete redundant sentences
Naarcha-AWS Feb 10, 2025
c34ffe7
Update query-insights-dashboard.md
KishoreKicha14 Feb 10, 2025
160385f
Apply suggestions from code review
Naarcha-AWS Feb 10, 2025
6252d80
Apply suggestions from code review
Naarcha-AWS Feb 10, 2025
d1dde0d
Small tweaks
Naarcha-AWS Feb 10, 2025
c55bff3
Update _observing-your-data/query-insights/query-insights-dashboard.md
KishoreKicha14 Feb 10, 2025
baa302f
Update _observing-your-data/query-insights/query-insights-dashboard.md
KishoreKicha14 Feb 10, 2025
335d898
Update query-insights-dashboard.md
KishoreKicha14 Feb 10, 2025
7d7cb11
Merge branch 'main' into QueryInsightsDashboard
Naarcha-AWS Feb 10, 2025
257e3cf
Apply suggestions from code review
Naarcha-AWS Feb 11, 2025
045b18e
Update _observing-your-data/query-insights/query-insights-dashboard.md
KishoreKicha14 Feb 11, 2025
ef8ebce
Update _observing-your-data/query-insights/query-insights-dashboard.md
KishoreKicha14 Feb 11, 2025
0a65c05
Apply suggestions from code review
Naarcha-AWS Feb 11, 2025
2ab10a0
Apply suggestions from code review
Naarcha-AWS Feb 11, 2025
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
178 changes: 178 additions & 0 deletions _observing-your-data/query-insights/query-insights-dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
---
title: Query insights dashboards
layout: default
parent: Query insights
nav_order: 60
---

# Query insights dashboards

You can interact with the query insights feature using the Query Insights Dashboards plugin. This plugin gives you real-time and historical insights into query performance, providing analytics, and monitoring to improve how queries are run in your cluster.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

## Prerequisites

The Query Insights Dashboards plugin requires [OpenSearch 2.19 or later]({{site.url}}{{site.baseurl}}/install-and-configure/).

## Installing the plugin

To install the Query Insights Dashboards plugin, see [Managing OpenSearch Dashboards plugins]({{site.url}}{{site.baseurl}}/install-and-configure/install-dashboards/plugins/).

## Navigation

After logging in to OpenSearch Dashboards, you can find the Query Insights page by navigating to **OpenSearch Plugins** > **Query Insights**.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
If you have [multiple data sources]({{site.url}}{{site.baseurl}}/dashboards/management/multi-data-sources/) enabled, the Query insights page can be found by navigating to **Data administration** > **Performance** > **Query insights**.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
{: .note}

The **Query insights** dashboard contains the following pages:

- [Top N queries](#top-n-queries): Displays the query metrics and details for the top queries.
- [Query details](#query-details): Displays details for individual queries and query groups.
- [Configuration](#configuration): Customizes all monitoring and data retention settings for the query insights feature.


## Top N queries

The **Top N queries** page provides a detailed overview of the queries that have the highest impact on system resources or performance. There, you can analyze query metrics such as **latency**, **CPU time**, and **memory usage**.

The following image of the **Top N Queries** page contains letter labels for each component:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

![Top N Queries Interface](../../images/Query-Insights/QueryInsights.png)

Each label corresponds with the following components:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

- [A. Navigation tabs](#a-navigation-tabs)
- [B. Search queries bar](#b-search-queries-bar)
- [C. Filters](#c-filters)
- [D. Date range selector](#d-date-range-selector)
- [E. Refresh button](#e-refresh-button)
- [F. Metrics table](#f-metrics-table)

### A. Navigation tabs

The navigation tabs allow you to switch between the Configuration and Top N Queries pages.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

### B. Search queries bar

The search queries bar filters queries based on specific attributes such as **query type** or **indexes**. You can use additional filters as shown in the [filters](#c-filters) section.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

### C. Filters

The filters dropdown menus allow you to select the following query filters.

| Filter | Description | Example |
|-------------------------|---------------------------------------------------------------------|--------------------|
| **Type** | Filter by query type. | `query`, `group` |
| **Indexes** | Filter queries based on specific OpenSearch indexes. | `index1`, `index2` |
| **Search Type** | Filter by search execution method. | `query then fetch` |
| **Coordinator Node ID** | Focus on queries executed by a specific coordinator node. | `node-1`, `node-2` |
| **Time Range** | Adjust the time range for the queries displayed. | `last 1 day` |

### D. Date range selector

The **data range selector** analyze queries in a set time frame. You can also select **Show dates** to provide detailed time stamps for each query.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

### E. Refresh button

The **Refresh** option reloads the query data based on the selected filters and time range.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

### F. Metrics table

The table displays the following metrics for each query:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

| Metric | Description |
|-------------------------|-----------------------------------------------------------------------------|
| **ID** | The unique identifier for the query |
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
| **Type** | The type of query, such as `query`or `group`. |
| **Query Count** | The number of times the query has been executed. |
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
| **Timestamp** | When the query was ran. |
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
| **Latency** | The time taken for the query to execute. |
| **CPU Time** | The CPU resources consumed by the query. |
| **Memory Usage** | The memory usage of the query. |
| **Indexes** | The index or indexes on which the query was executed. |
| **Search Type** | The type of search used, for example, `query then fetch`. |
| **Coordinator Node ID** | The node that coordinated the query. |
| **Total Shards** | The total number of shards involved in running the query. |


## Query details

The **Query Details** page in OpenSearch Dashboards provides insights into query behavior, performance, and structure. This page can have two variations based on the context:
KishoreKicha14 marked this conversation as resolved.
Show resolved Hide resolved

![Query Insights List](../../images/Query-Insights/Querieslist.png)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the preceding text introduce this image? The image appears to shows a list of "IDs" and a list of "Types", with three rows (not "two variations based on the context" [to what context are we referring?]).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@natebower: Adjusted the language.


### Viewing individual query details

You can access detailed information about a single query by select the Query ID, such as `51c68a1a-7507-4b3e-aea1-32ddd74dbac4`. The query details page will appear, as shown in the following image:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

![Individual Query Details](../../images/Query-Insights/IndividualQueryDetails.png)

In the query details view, you can view the following information such as **Timestamp**, **CPU Time**, **Memory Usage**, **Indexes**, **Search Type**, **Coordinator Node ID**, and **Total Shards**.
KishoreKicha14 marked this conversation as resolved.
Show resolved Hide resolved

### Viewing query group details
KishoreKicha14 marked this conversation as resolved.
Show resolved Hide resolved

This query group details view provides insights into aggregated metrics for a group of similar queries.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

To view query group details, select a Query ID marked as a "group" in the **Top N queries** list. In the query group details view, you can view the following information:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

![Query Group Details](../../images/Query-Insights/GroupQueryDetails.png)

- The **Aggregate summary for Queries** section, gives a view of key query metrics for the entire group, including **Average latency**, **Average CPU time**, **Average memory usage**, and, **Group by** criteria.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
- The **Sample query details** section provides information about a single representative query including its **Timestamp**, **Indexes**, **Search Type**, **Coordinator Node ID**, and the **Total Shards**.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
- The **Query** section displays the JSON structure of the query.
- The **Latency Breakdown** section presents a graphical representation of the run phases for the query.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not seeing this section in the images. It is just named the Latency section?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

## Configuration

The **Query insights - Configuration** page is designed to gives you control over how query insights collects, monitors, groups, and retains data. The following image shows the configuration page:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

![Configuration](../../images/Query-Insights/Configuration.png)

On configuration page, you can configure the following settings.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

### Top N queries monitoring

The **Top n queries monitoring configuration settings** allows you to track query performance metrics, such as **Latency, CPU Usage, and Memory**, to analyze and optimize query performance. The configuration interface provides a structured, menu-driven setup where you can define the specific metrics to monitor, set thresholds for analysis, and customize monitoring durations.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

To configuring the Top N Queries settings:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

1. From the **Query insights** page, Navigate to the **Configuration** tab from the **Query insights** page.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
2. Select the metric type from **Latency, CPU Usage, or Memory**.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
3. Toggle the Enabled setting to turn Top N Queries feature on or off for the selected metric.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
4. Specify the monitoring **Window size**, which determines the duration of time queries are collected for analysis.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
5. Enter the value of **N**, which defines the number of top queries to track in each window.
6. Select **Save**.
7. Check the **Statuses for configuration metrics** panel to see the enabled metrics.

### Top N queries grouping

The **Top n queries group configuration settings** sets the grouping settings for queries.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

You can set the following specific grouping attributes using these steps.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

1. Select a grouping option under **Group By**, such as **Similarity**.
2. Select **Save**.
3. Check the **Statues for group by** panel to see if **Group by** criteria is enabled.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
### Data export and retention

To configuring data export and retention, use the **Query insights export and data retention settings** panel. There, you can set the following settings:

1. Under **Exporter**, choose a destination where to export the insight data, such as **Local index**.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
2. Set the **Delete After (days)** field with a data retention period.
3. Select **Save**.
4. In the **Statuses for data retention** panel, make sure that the **Exporter** setting is enabled.

### Configuration best practices

When configuring the query insights feature, remember the following best practices:

- Begin with a smaller value for N (count) and increase it based on your system's load.
KishoreKicha14 marked this conversation as resolved.
Show resolved Hide resolved
- Choose your **Window size** carefully. A longer window size can save compute resources because the insights found are less granular. Inversely, a shorter window size can output more comprehensive query insights, but uses more resources.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
- When setting the retention periods for insight data, consider a shorter retention period that saves storage but reduces long-term insights.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
- Enable metrics based on your monitoring needs. Monitoring fewer metrics prevents system overload.





Binary file added images/Query-Insights/Configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Query-Insights/GroupQueryDetails.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Query-Insights/Querieslist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Query-Insights/QueryInsights.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.