All Products
Search
Document Center

ApsaraDB for MongoDB:View slow query logs

Last Updated:Mar 28, 2026

Slow query logs help you find database operations that exceed a latency threshold, so you can target them for index optimization or query rewriting. Use the ApsaraDB for MongoDB console to view, filter, and download these logs.

Note

Slow query log analysis is provided by Database Autonomy Service (DAS), not by the MongoDB instance itself. RAM users need separate DAS permissions to access this feature.

Prerequisites

Before you begin, make sure that you have:

Limitations

LimitationDetails
Log retention7 days; logs cannot be manually deleted
Supported instance typesReplica set and sharded cluster only; standalone instances are not supported
Regional availabilityNot available in all regions; check the console to confirm availability

View slow query logs

  1. Go to the Replica Set Instances or Sharded Cluster Instances page. Select a resource group and a region, then click the ID of your instance.

  2. In the left-side navigation pane, choose Logs > Slow Query Logs.

  3. Filter the results based on your instance type:

    • Replica set instance: Filter by database name and time range.

    • Sharded cluster instance: Filter by database name, shard node, and time range.

  4. To download the displayed logs, click the image icon in the upper-right corner.

Slow operation threshold

An operation is recorded as slow when its execution time exceeds the value of operationProfiling.slowOpThresholdMs (default: 100 ms).

To adjust the threshold, see Set instance parameters.

FAQ

Why are some slow operations missing from the logs?

Check the following in order:

  1. Threshold: Confirm that operationProfiling.slowOpThresholdMs is set low enough to capture the operations you expect. Operations that do not exceed the threshold are not recorded.

  2. Instance version: On MongoDB 4.0 instances where the audited operation types have been modified, slow update and delete operations may not appear in the slow query logs. By default, only admin and slow operation types are audited. If you changed these defaults, you have two options:

Why can't a RAM user access slow query logs?

Slow query log analysis is provided by Database Autonomy Service (DAS). RAM users need DAS permissions to access this feature. For setup instructions, see How can a RAM user use DAS?.

What's next

For detailed slow query log analysis and export options, see Slow query logs.