Database endpoints
Find slow queries
Read recent queries and their latency, optionally filtering by a minimum duration.
GET /v1/tenants/{tenant}/slow-queries
- Set the duration thresholdChoose the minimum latency to inspect.
- Read matching query entriesExamine the recent operations that meet the threshold.
- Compare query and latencyUse the evidence to investigate the workload.
Before you start
Use your database bearer token.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
Query parameters
| Field | Type | Required |
|---|---|---|
threshold_ms | integer | Optional |
Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-oc-db-user | string | Optional | Acting database user (role, grant and row-policy checks). Send with x-oc-db-key. |
x-oc-db-key | string | Optional | API key of the x-oc-db-user user. |
Read the result
entries reports observed queries meeting threshold_ms since collection began. An empty list means none were reported under that threshold and history, not that the database has never run slowly.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 200 | OK |
| 400 | Correct the request before retrying. |
| 401 | Check the credential and Authorization header. |
| 402 | Check feature access or available credits. |
| 403 | Check tenant access, roles and permissions. |
| 429 | Honor Retry-After when present; back off. |
| 500 | Check the outcome before retrying a write. |
| 503 | Honor Retry-After when present; check write outcomes. |