Unify and manage your data

Retrieve maximum queue dwell time by interval

Use this API to retrieve the longest time a message remained in the queue during each time interval. The response includes maximum dwell time values grouped by topic and timestamp across the specified time range.

HTTP method and endpoint

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

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
resolutionIntegerYesTime resolution in milliseconds for aggregating data
subscriptionPatternStringNoRegex pattern to filter queuesDefault: *
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/maxTimeInQueue \
  -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 maximum queue dwell time during that time interval

Example response

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