Unify and manage your data

Retrieve total event counts by time interval

Use this API to retrieve the total number of events during each time interval within a specified time range. The response includes event counts grouped by topic and timestamp.

HTTP method and endpoint

Use the following HTTP method and endpoint path to submit the request for retrieving total event counts.
POST /statistics-reporting/{tenantId}/API/queueMetrics/totalEvents

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/totalEvents \
  -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
valueIntegerTotal events during that time interval

Example response

The following example shows total event counts for two time intervals.
[
  {
    "timestamp": 1760770800000,
    "values": [
      {
        "name": "A",
        "value": 136421
      }
    ]
  },
  {
    "timestamp": 1760770920000,
    "values": [
      {
        "name": "A",
        "value": 97380
      }
    ]
  }
]