Unify and manage your data

Retrieve failed queue messages by time interval

Use this API to retrieve the number of failed messages in the queue over a defined time range. The response includes failure counts grouped by subscription topic and timestamp.

HTTP method and endpoint

Use the following HTTP method and endpoint path to submit the request for retrieving failed queue message counts.
POST /statistics-reporting/{tenantId}/API/queueMetrics/failedMessages

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
subscriptionPatternStringYesRegex 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/failedMessages \
  -H "Authorization: Bearer YOUR_BEARER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "from": 1760770800000,
    "to": 1760771400000,
    "env": "prod",
    "resolution": 60000,
    "subscriptionPattern": ".*crud.*"
  }'

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
valueIntegerThe number of failed messages during that time interval

Example response

The following example shows the number of failed messages in the queue for two time intervals.
[
  {
    "timestamp": 1760770800000,
    "values": [
      {
        "name": "API_na07_prod_crud-events_6ZS1234567ef8b97",
        "value": 136421
      }
    ]
  },
  {
    "timestamp": 1760770920000,
    "values": [
      {
        "name": "API_na07_prod_crud-events_6ZS1234567ef8b97",
        "value": 97380
      }
    ]
  }
]