Get database query stats
GEThttps://api.instacloud.com/projects/{projectId}/database/query-stats
Token scope: account · org · project — read-only tokens allowed.
Top statements by execution time (pg_stat_statements/provider API). Provider-specific; may wake a suspended database.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
branch | query | string | no | branch name (default branch if omitted) |
group | query | string | no | postgres service name (default: the sole postgres service) |
limit | query | integer | no | max rows (1–100, default 20) |
sort | query | "total" | "mean" | "calls" | no | order by (default total) |
projectId | path | string | yes |
Responses
200
Default Response
| Field | Type | Required | Description |
|---|---|---|---|
stats | object[] | no | |
stats.queryId | string | no | |
stats.query | string | no | |
stats.calls | number | no | |
stats.meanMs | number | no | |
stats.totalMs | number | no | |
stats.rows | number | no | |
extensionReady | boolean | no |
400
Default Response
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes |
403
Default Response
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes |
404
Default Response
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes |
409
Default Response
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes |
502
Default Response
| Field | Type | Required | Description |
|---|---|---|---|
error | string | yes |