Read a database's connections and long-running sessions
Returns connections grouped by client, each mapped to the compose service it comes from where its address is a pod of the app, and the sessions running or holding a transaction for five seconds or more, waiting on a lock or blocking another, with their query text. Needs the developer role. Sending `Accept: text/event-stream` instead follows it live, a frame every five seconds.
Authorization
cloady Personal API token (cldy_…)
In: header
Path Parameters
Query Parameters
Value in
- "production"
- "preview"
- "development"
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/apps/string/services/string/engine/sessions"{ "ts": 0, "engine": "postgres", "total": 0, "clients": [ { "name": "string", "service": "string", "count": 0, "active": 0, "idleInTransaction": 0 } ], "sessions": [ { "id": "string", "client": "string", "service": "string", "user": "string", "database": "string", "address": "string", "state": "active", "wait": "string", "ageSeconds": 0, "query": "string", "blocking": 0, "blockedBy": [ "string" ] } ]}Read a database's top statements GET
Returns the statements with the most time, the most calls and the slowest means, with their normalized text: pg_stat_statements on Postgres, performance_schema digests on MySQL and MariaDB, system.query_log over `range` on ClickHouse, per-collection totals on MongoDB. Statement text can carry data, so this needs the developer role. A one-shot read gives cumulative values; sending `Accept: text/event-stream` instead follows it live, a frame every fifteen seconds with calls and time over the interval.
Cancel a session's query or terminate the session DELETE
Cancels the statement a session is running (`mode=cancel`) or ends its connection (`mode=terminate`, the default): pg_cancel_backend or pg_terminate_backend, KILL QUERY or KILL, killOp on MongoDB, KILL QUERY on ClickHouse. `sessionId` comes from streamEngineSessions.