- API >
- Public API Resources >
- Measurements and Alerts >
- Performance Advisor >
- Get Slow Query Logs
Get Slow Query Logs¶
On this page
Retrieves log lines for slow queries as determined by the Performance Advisor.
Note
Performance Advisor users must have the necessary access
privileges to view performance
data. Users who do not have the necessary permissions will not be
able to view any log data in the slowQueryLogs
API endpoint
responses.
Base URL: https://cloud.mongodb.com/api/public/v1.0
Resource¶
Request Path Parameters¶
Parameter | Type | Description |
---|---|---|
PROJECT-ID | string | (Required.) Unique identifier of the project that owns this MongoDB process. |
HOST-ID | string | (Required.) Unique identifier of the host for the MongoDB process. |
Request Query Parameters¶
All parameters are optional.
pretty | boolean | Indicates whether the response body should be in a prettyprint format. | false |
---|---|---|---|
envelope | boolean | Indicates whether or not to wrap the response in an envelope. | false |
since | long | Point in time from which to retrieve slow query logs, stated in milliseconds since epoch. | previous 24 hours |
duration | long | Length of time in milliseconds during which to find slow query logs among the managed namespaces in the cluster. | up to the present time |
namespaces | string | Namespaces from which to retrieve suggested slow query logs.
A namespace consists of the database and collection resource
separated by a To specify multiple namespaces, pass the parameter multiple times
using an ampersand ( Example ?namespaces=data.stocks&namespaces=data.zips&pretty=true |
all |
nLogs | long | Maximum number of log lines to return. | 20000 |
Request Body Parameters¶
This endpoint does not use HTTP request body parameters.
Response¶
Name | Type | Description |
---|---|---|
slowQueries | array of documents | A list of documents with information about slow queries as detected by the Performance Advisor. |
slowQueries[n].line | string | The raw log line pertaining to the slow query. |
slowQueries[n].namespace | string | The namespace in which the slow query ran. |