v50

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-102991198.1 KB
Metrics

Get Event Metrics

Returns aggregated event publish metrics. Supports time bucketing via granularity, dimensional grouping, and filtering.

Measures: count, rate

Dimensions: tenant_id (admin-only), topic, destination_id

Filters: tenant_id (admin-only), topic, destination_id

get/metrics/events

Query parameters

startstring date-time required

Start of the time range (inclusive). ISO 8601 timestamp.

endstring date-time required

End of the time range (exclusive). ISO 8601 timestamp.

Time range for the metrics query.

{
  "start": "2026-03-02T00:00:00Z",
  "end": "2026-03-03T00:00:00Z"
}
granularitystring

Time bucketing granularity. Pattern: <number><unit>. Units: s (1-60), m (1-60), h (1-24), d (1-31), w (1-4), M (1-12). When omitted, returns a single aggregate row per dimension combination.

'count' | 'rate' required
OR
string[] required

Measures to compute. At least one required. rate is events/second throughput. Use bracket notation for multiple values (e.g., measures[0]=count).

'tenant_id' | 'topic' | 'destination_id'
OR
string[]

Dimensions to group results by. Use bracket notation for multiple values (e.g., dimensions[0]=topic&dimensions[1]=destination_id).

string
OR
string[]

Filter by topic name(s). Use bracket notation for multiple values (e.g., filters[topic][0]=user.created&filters[topic][1]=user.updated).

string
OR
string[]

Filter by destination ID(s). Use bracket notation for multiple values (e.g., filters[destination_id][0]=d1&filters[destination_id][1]=d2).

string
OR
string[]

Filter by tenant ID(s). Admin-only — rejected with 403 for JWT callers. Use bracket notation for multiple values (e.g., filters[tenant_id][0]=t1&filters[tenant_id][1]=t2).

Response

Aggregated event metrics.

Example response

{
  "data": [
    {
      "time_bucket": "2026-03-02T14:00:00Z",
      "dimensions": {
        "destination_id": "dest_abc",
        "topic": "user.created"
      },
      "metrics": {
        "count": 1423,
        "error_rate": 0.02
      }
    }
  ],
  "metadata": {
    "granularity": "1h",
    "query_time_ms": 42,
    "row_count": 2,
    "row_limit": 100000
  }
}