Database endpoints
Read query metrics
Read query completion counts and mean latency from the running process, without collecting query text.
GET /v1/tenants/{tenant}/query-metrics
- Choose the time bucketsSet the window and bucket size.
- Read calls and failuresInspect counts and mean latency per bucket.
- Calculate rates carefullyUse observed_seconds; idle latency may be null.
Before you start
Use your database bearer token.
Use a tenant service credential or query administrator; supported windows are 60/60, 1440/600 and 10080/3600 minutes/bucket_seconds.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
Query parameters
| Field | Type | Required |
|---|---|---|
minutes | integer | Required |
bucket_seconds | integer | Required |
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
Read calls, failed and mean_latency_ms per bucket. Divide by observed_seconds when calculating rates. The history belongs to the local process and restarts with it; idle latency can be null.
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. |
| 422 | Correct the values or unsupported combination. |
| 429 | Honor Retry-After when present; back off. |
| 503 | Honor Retry-After when present; check write outcomes. |