Retrieve API metrics grouped by factor and time interval
Use this API to retrieve aggregated API performance metrics for a tenant. The API groups results based on time intervals and filters such as HTTP methods, endpoint paths, users, or query types.
HTTP method and endpoint
POST /statistics-reporting/{tenantId}/API/latencyStats/_byInterval
Replace {tenantId} with the ID of the target tenant.
Request headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
Authorization | Bearer {access_token} | Yes |
Request body
The following table describes the request body parameters, including accepted values and defaults.
| Parameter | Type | Required | Description | Accepted values / Default |
|---|---|---|---|---|
from (1) | Long | Yes | Start time in epoch milliseconds | — |
to (1) | Long | Yes | End time in epoch milliseconds | — |
env | String | Yes | Target environment | Example: prod, qa, dev. Default: none |
intervalMinutes | Integer | No | Time interval for aggregation | Default: 15 minutes |
queryTypes | Array | No | Filter by query type | Read, Write, Search, Merge, Graphs |
httpMethods | Array | No | Filter by HTTP methods | Example: POST |
apiEndPoints | Array | No | Filter by API endpoint paths | Example: /api/{tenantId}/entities |
users | Array | No | Filter by user email addresses | Example: user1@example.com |
Note:
| ||||
Example request
curl -X POST https://{baseUrl}/statistics-reporting/{tenantId}/API/latencyStats/_byInterval \
-H "Authorization: Bearer YOUR_BEARER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"from": 1721012400000,
"to": 1721016000000,
"env": "prod",
"intervalMinutes": 15,
"httpMethods": ["POST"],
"apiEndPoints": ["/api/{tenantId}/entities"],
"users": ["user1@example.com"]
}'
Response fields
| Field | Type | Description |
|---|---|---|
interval_start | Long | Start time of the interval in epoch milliseconds |
rate | Integer | Total number of API calls during the interval |
errors | Integer | Number of failed API calls |
duration | Long | Total duration of all API calls in milliseconds |
maxLatency | Long | Maximum latency of a single request in milliseconds |
average | Float | Average latency of requests in milliseconds |
median | Float | Median latency value (50th percentile) |
p90 | Float | 90th percentile latency |
p95 | Float | 95th percentile latency |
p99 | Float | 99th percentile latency |
Example response
[
{
"interval_start": 17210124000000,
"rate": 96,
"errors": 0,
"duration": 6294,
"maxLatency": 269,
"average": 65.56,
"median": 30.0,
"p90": 205.0,
"p95": 237.0,
"p99": 267.0
},
{
"interval_start": 17210160000000,
"rate": 92,
"errors": 0,
"duration": "7.318",
"maxLatency": 506,
"average": 79.54,
"median": 31.0,
"p90": 211.0,
"p95": 261.0,
"p99": 297.0
}
]