This topic describes how to view slow query logs of ApsaraDB for MongoDB instances. You can identify, analyze, diagnose, and track slow query logs to create indexes. This improves the utilization of the instance resources.
- Log on to the ApsaraDB for MongoDB console.
- In the upper-left corner of the page, select the resource group and the region of the target instance.
- In the left-side navigation pane, click Replica Set Instances, or Sharded Cluster Instances based on the instance type.
- Find the target instance and click its ID.
- In the left-side navigation pane, choose .Note By default, slow query logs generated in the past 15 minutes are displayed in the trend chart. You can specify the time range and click Search to view slow query logs. The maximum time range is one day.
- View details of slow query logs based on the following methods:Method 1:
- Click the Slow Log Details tab under the trend chart.
- On the Slow Log Details tab, select the database that you want to query.Note If the request content of the database is hidden, you can move the pointer over the request content and view the complete content.
- In the trend chart, click the time point of a specific slow query log and view its
details on the Slow Log Statistics tab.
- On the Slow Log Statistics tab, click Sample in the Actions column.In the Slow query log sample dialog box, you can view details of the slow query log.Note If the request content of the database is hidden, you can move the pointer over the request content and view the complete content.
Export slow query logs
You can click Export slow query logs on the Slow Log Statistics tab to save the slow query logs information to your computer.