The metrics method requires a JSON string query with the following schema:
| Key | Type | Description |
|---|
view | string | Required. One of: observations, scores-numeric, scores-boolean, scores-categorical |
metrics | array | Required. List of objects with measure (string) and aggregation (string) |
fromTimestamp | string | Required. ISO datetime string for start of range |
toTimestamp | string | Required. ISO datetime string for end of range |
dimensions | array | Optional. List of objects with field to group by |
filters | array | Optional. List of objects with column, operator, value, and type |
timeDimension | object | Optional. Contains granularity (auto, minute, hour, day, week, month) |
orderBy | array | Optional. List of objects with field and direction (asc, desc) |
config | object | Optional. Contains bins (1-100) and row_limit (1-1000) |
Aggregation functions: sum, avg, count, max, min, p50, p75, p90, p95, p99, histogram.
{
"view": "observations",
"dimensions": [
{ "field": "type" }
],
"metrics": [
{ "measure": "latency", "aggregation": "avg" }
],
"fromTimestamp": "2023-01-01T00:00:00Z",
"toTimestamp": "2023-01-02T00:00:00Z"
}