rds.query-insights.get-slow-log

Slow query log settings and the statements (and plans) it captured

GET /rds/api/instances/{id}/insights/slow-logIAM rds:DescribeDBQueryInsightsRead

Request syntax

GET /rds/api/instances/{id}/insights/slow-log

Path parameters

  • idRequired

    string

    Constraints: 3-64 chars, /^(?!ewdoc-)[a-z0-9-]+$/

Query parameters

  • rangeOptional

    enum

    1h by the minute, 24h by 15 minutes, 7d by 2 hours

    One of: 1h, 24h, 7d

    Default: "24h"

Response

200 with range, settings (null with settingsError when they cannot be read), plansWithValues, topology and entries: the slow statements logged in the range.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Fields of data

  • rangeAlways

    one of 1h, 24h, 7d

    The range shown
  • settingsAlways

    object, may be null

    The settings in force; null when they could not be read
  • settings.​minDurationMsAlways

    number

    Statements slower than this are logged, ms; -1: off
  • settings.​autoExplainAlways

    boolean

    Plans of slow statements are logged
  • settings.​explainMinMsAlways

    number, may be null

    Plans are logged above this, ms; null: not set
  • settingsErrorAlways

    string, may be null

    Why the settings could not be read; null when they were
  • plansWithValuesAlways

    boolean

    Whether statements and plans are kept with their literal values
  • topologyAlways

    one of single, cluster

    Topology of the database
  • entriesAlways

    array of object

    Slow statements logged in the range
  • entries[].​atAlways

    string

    When it was logged
  • entries[].​nodeAlways

    string

    Node it ran on
  • entries[].​durationMsAlways

    number

    How long it took, ms
  • entries[].​statementAlways

    string, may be null

    Statement, normalised unless values are kept
  • entries[].​fingerprintAlways

    string, may be null

    sqlfp1 fingerprint
  • entries[].​planLoggedAlways

    boolean

    A plan was logged for this run
  • entries[].​planAlways

    string, may be null

    The logged plan; only when values are kept

Checked against the handlers: every route test validates their answers against this schema.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow rds:DescribeDBQueryInsights on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud rds query-insights get-slow-log id

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_rds_query-insights_get-slow-log.