Unify and manage your data

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

Use the following HTTP method and endpoint path to submit the request for retrieving grouped API latency statistics.
POST /statistics-reporting/{tenantId}/API/latencyStats/_byInterval

Replace {tenantId} with the ID of the target tenant.

Request headers

The following request headers must be included.
HeaderValueRequired
Content-Typeapplication/jsonYes
AuthorizationBearer {access_token}Yes

Request body

The following table describes the request body parameters, including accepted values and defaults.

ParameterTypeRequiredDescriptionAccepted values / Default
from (1)LongYesStart time in epoch milliseconds
to (1)LongYesEnd time in epoch milliseconds
envStringYesTarget environmentExample: prod, qa, dev. Default: none
intervalMinutesIntegerNoTime interval for aggregationDefault: 15 minutes
queryTypesArrayNoFilter by query typeRead, Write, Search, Merge, Graphs
httpMethodsArrayNoFilter by HTTP methodsExample: POST
apiEndPointsArrayNoFilter by API endpoint pathsExample: /api/{tenantId}/entities
usersArrayNoFilter by user email addressesExample: user1@example.com
Note:
  1. The time range defined by the from and to values must not exceed one month. If the specified range exceeds the allowed limit, the API returns an HTTP 416 Range Not Satisfiable error with the following response:
    {
      "errors": [
        {
          "message": "Invalid time range."
        }
      ]
    }
    

Example request

Use the following example to see how a complete request is structured with headers and a JSON body.
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

The following table describes the fields returned in the response body.
FieldTypeDescription
interval_startLongStart time of the interval in epoch milliseconds
rateIntegerTotal number of API calls during the interval
errorsIntegerNumber of failed API calls
durationLongTotal duration of all API calls in milliseconds
maxLatencyLongMaximum latency of a single request in milliseconds
averageFloatAverage latency of requests in milliseconds
medianFloatMedian latency value (50th percentile)
p90Float90th percentile latency
p95Float95th percentile latency
p99Float99th percentile latency

Example response

The following example shows a response that includes two time intervals with latency statistics.
  [
     {
        "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
    }
  ]