Docs Menu
Docs Home
/
Atlas
/ /

Monitor Query Shape Statistics with Query Shape Insights

You can monitor operation-level query execution metrics for query shapes with slow-running queries using Query Shape Insights. The Query Shape Insights page displays charts and a table that describe the performance metrics for the query shapes in your project with the highest total execution time. You can filter the displayed query shape data by host, shard, and time range, and select up to five query shapes to visualize in the corresponding metric charts.

Atlas supports Query Shape Insights on only dedicated clusters (M10 and above) running MongoDB version 8.0 and above.

Note

To ensure performance and scalability for clusters with high query volume, Query Shape Insights may display data from a sample set of the total queries run on your cluster.

To view metrics with Query Shape Insights, you must have Project Observability Viewer, Project Data Access Read Only, Project Data Access Read/Write, Project Data Access Admin, or Project Owner access to the project.

Important

Query shapes exposing field names but redacted values may contain user PII. To view truncated or full query shapes in Query Shape Insights, you must have one of the project roles listed above, which each give access to view PII. For users without these permissions, Query Shape Insights identifies query shapes by their query shape hash.

To access Query Shape Insights:

1

Warning

Navigation Improvements In Progress

We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.

  1. If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. If it's not already displayed, click Clusters in the sidebar.

    The Clusters page displays.

2
  1. Click View Monitoring for that instance in the project panel.

  2. Click the Query Insights tab.

    The Query Shapes tab displays by default.

You can filter the Query Insights page by node, node state (primary or secondary), and shard. You can also filter by a custom date range within the last seven days, or select one of the following preset time ranges:

  • 7 days

  • 5 days

  • 2 days

  • 24 hours (default)

  • 12 hours

  • 8 hours

  • 1 hour

When you apply a filter, Atlas re-fetches data for the charts and table on the current screen.

Note

Analytics nodes are included when you filter by secondary node state.

Query Shape Insights displays charts and a table that describe metrics for query shapes in your project with slow-running queries.

The Query Shape Insights table contains one row for each top query shape in your project, where top query shapes are determined by highest total execution time. Each row contains the query shape or its query shape hash, the namespace of the query shape, the query command, and any metrics that you select to display. You can use the Edit Columns button to choose which of the following metrics to include as table columns:

Metric
Description

Total Execution Time

Total time in microseconds spent running queries with the given query shape. If the query resulted in getMore commands, this metric includes the time spent processing the getMore requests. This metric does not include time spent waiting for the client.

Avg Execution Time

Average time in microseconds spent running queries with the given query shape. If the query resulted in getMore commands, this metric includes the time spent processing the getMore requests. This metric does not include time spent waiting for the client.

Execution Count

Total number of times that queries with the given query shape have been executed.

Keys Examined

Total number of in-bounds and out-of-bounds index keys examined by queries with the given query shape.

Keys Examined:Returned

Ratio of in-bounds and out-of-bounds index keys examined to indexes containing documents returned by queries with the given query shape.

Docs Examined

Total number of documents examined by queries with the given query shape.

Docs Returned

Total number of documents returned by queries with the given query shape.

Docs Examined:Returned

Ratio of documents examined to documents returned by queries with the given query shape.

Total Time to Response

Time in microseconds spent from the beginning of query processing to the first server response.

Last Execution Time

Execution runtime in microseconds for the most recent query with the given query shape.

P50 Execution Time

50th percentile in the execution time histogram.

P90 Execution Time

90th percentile in the execution time histogram.

P99 Execution Time

99th percentile in the execution time histogram.

You can also display charts for one or more of the metrics above by selecting ecah metric that you want to chart from the drop-down menu in the Query Shape Statistics component header.

Atlas can chart each metric for up to five query shapes at a time. By default, Atlas charts each metric for the five query shapes with the highest Total Execution Time. You can choose to chart different query shapes by selecting or deselecting the checkbox in the row of your desired query shapes. You can manage which query shapes to chart from the table, by selecting or deselecting the checkbox in the row of your desired query shapes.

To view more details about a query shape, click on the row for the query shape to open the Query Shape Details view. This view contains the full query shape and query shape hash, each table metric listed above, and the following additional metrics:

  • Last Seen Timestamp

  • First Seen Timestamp

  • Last Seen Application

  • Last Seen Driver Name and Version

  • First Seen Application

  • First Seen Driver Name and Version

By default, Query Shape Insights displays metric charts for the top five query shapes with the highest Total Execution Time. You can select up to five query shapes to chart in the Query Shape Insights table.

To search for and select query shapes in the Query Shape Insights table:

1

You can filter the Query Shape Insights table by the following categories:

  • Query Shape: In the Search by Query Shape search box, input the query shape or its associated query hash.

  • Namespace: In the Select Namespaces drop-down menu, select one or more namespaces to filter by.

  • Command: In the Select Commands drop-down menu, select one or more commands to filter by.

2

You can sort the Query Shape Insights table by one or more metric columns to help identify which query shapes to chart.

To sort by a metric in descending or ascending order, click the sort icon next to the associated column name once or twice, respectively. To sort by multiple columns, press Shift and click the sort icons in the order in which you want to multi-sort the table.

3

Click the checkbox in the row of your desired query shape.

You can select up to five query shapes at a time.

Back

Enable or Disable

On this page