Unify and manage your data

Retrieve queue size metrics by time interval

Use this API to retrieve queue size metrics over a defined time range. The response returns the size of the message queue at regular time intervals based on the specified resolution.

HTTP method and endpoint

Use the following HTTP method and endpoint path to submit the request for retrieving queue size metrics.
POST /statistics-reporting/{tenantId}/API/queueMetrics/queueSize

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.

FieldTypeRequiredDescriptionAccepted values / Default
from (1)LongYesStart time in epoch milliseconds
to (1)LongYesEnd time in epoch milliseconds
envStringYesTarget environmentExample: prod, qa, dev. Default: none
resolutionIntegerYesTime resolution in milliseconds for aggregating data
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/queueMetrics/queueSize \
  -H "Authorization: Bearer YOUR_BEARER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from": 1760770800000,
    "to": 1760771400000,
    "env": "prod",
    "resolution": 60000
  }'

Response fields

The following table describes the fields returned in the response body.

FieldSubfieldTypeDescription
timestampLongNumeric value representing the start time of the interval in milliseconds
valuesArrayArray containing one or more name-value pairs
_nameStringIdentifier for the destination or topic for which the metric was aggregated
_valueIntegerThe queue size during that time interval

Example response

The following example shows the aggregated queue size for two time intervals.
[
  {
    "timestamp": 1760770800000,
    "values": [
      {
        "name": "A",
        "value": 136421
      }
    ]
  },
  {
    "timestamp": 1760770920000,
    "values": [
      {
        "name": "A",
        "value": 97380
      }
    ]
  }
]