rds.query-insights.list-sessionsClient sessions now: what runs, how long, what it waits for, who blocks it
Request syntax
GET /rds/api/instances/{id}/insights/sessionsPath parameters
idRequiredstring
Constraints: 3-64 chars, /^(?!ewdoc-)[a-z0-9-]+$/
Response
200 with { at, sessions }: each session’s pid, user, database, application, client, state, waitType, waitEvent, query, querySeconds, transactionSeconds, blockedBy and findings.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Fields of data
atAlwaysstring
When the sessions were readsessionsAlwaysarray of object
Client sessions, up to 200sessions[].pidAlwaysnumber
Server process id, for cancel-sessionsessions[].userAlwaysstring, may be null
Rolesessions[].databaseAlwaysstring, may be null
Databasesessions[].applicationAlwaysstring, may be null
application_name the client setsessions[].clientAlwaysstring, may be null
Client addresssessions[].stateAlwaysstring, may be null
active, idle, idle in transaction, …sessions[].waitTypeAlwaysstring, may be null
Kind of wait, e.g. Locksessions[].waitEventAlwaysstring, may be null
What it waits forsessions[].queryAlwaysstring, may be null
Current or last statement; normalised unless values are keptsessions[].querySecondsAlwaysnumber, may be null
Seconds the statement has runsessions[].transactionSecondsAlwaysnumber, may be null
Seconds the transaction has been opensessions[].blockedByAlwaysarray of number
Process ids holding the locks it waits forsessions[].findingsAlwaysarray of object
Findings with suggested actionssessions[].findings[].kindAlwaysone of slow-average, slow-sometimes, missing-index, spills-to-disk, n-plus-one, seq-scan-large-table, unused-index, duplicate-index, vacuum-overdue, long-running, idle-in-transaction, lock-wait
What was foundsessions[].findings[].severityAlwaysone of high, medium, info
How much it matterssessions[].findings[].titleAlwaysstring
One line: what was seensessions[].findings[].evidenceAlwaysstring
The numbers behind itsessions[].findings[].actionAlwaysstring
What to do about itsessions[].findings[].sqlWhen presentstring
A statement to copy and run yourself (CREATE INDEX CONCURRENTLY, …); absent when none
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 list-sessions idcurl -X GET "https://console.platform-development.deutschecloud.app/rds/api/instances/id/insights/sessions" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY"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_list-sessions.