Read a database's top statements
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.
Authorization
cloady Personal API token (cldy_…)
In: header
Path Parameters
Query Parameters
Value in
- "production"
- "preview"
- "development"
How far back to look; the answer has 30 to 96 points across it
"1h"Value in
- "15m"
- "1h"
- "6h"
- "24h"
- "7d"
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/statements"{ "ts": 0, "engine": "postgres", "interval": 0, "since": 0, "source": "pg_stat_statements", "evicted": 0, "hidden": 0, "note": "string", "statements": [ { "id": "string", "text": "string", "database": "string", "user": "string", "calls": 0, "totalMs": 0, "rows": 0, "meanMs": 0, "maxMs": 0, "stddevMs": 0, "p95Ms": 0, "p99Ms": 0, "callsPerSec": 0, "intervalMs": 0, "noIndex": 0, "missingIndex": true, "lockMs": 0, "lockWaits": 0, "tables": [ "string" ], "since": 0 } ]}Read a database or cache service's live statistics GET
Reads the engine behind a compose service (Postgres, MySQL, MariaDB, ClickHouse, MongoDB, Redis, Valkey or KeyDB) through its own protocol: throughput, latency, connections, cache hit ratio and memory, with the settings and opt-ins that shape them. Returns one frame of cumulative counters with every per-second value null. Sending `Accept: text/event-stream` instead follows it live, a frame every five seconds with rates over the interval, which never completes on its own.
Read a database's connections and long-running sessions GET
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.