Metrics API
Track gauges, counters, distributions, and sets via the API.Track Metric
Request
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Metric name |
type | string | Yes | gauge, counter, distribution, or set |
value | number/string | Yes | Metric value (string for sets) |
timestamp | string | No | ISO8601 timestamp (defaults to now) |
tags | object | No | Indexed metadata for filtering |
Metric Types
Gauge - Current value (overwrites previous):Response
Batch Track
Send multiple metrics in one request:Request
Response
List Metrics
Get all metric definitions:Request
Response
Get Metric
Get a specific metric definition:Request
Response
Query Metric
Query metric time series:Parameters
| Parameter | Type | Description |
|---|---|---|
from | string | Start timestamp (ISO8601) |
to | string | End timestamp (ISO8601) |
aggregation | string | Aggregation function |
interval | string | Time bucket (1m, 5m, 1h, 1d) |
tags[key] | string | Filter by tag value |
Aggregations by Type
| Type | Available Aggregations |
|---|---|
| Gauge | last, avg, min, max |
| Counter | sum, rate |
| Distribution | avg, sum, min, max, p50, p90, p95, p99, count |
| Set | count (cardinality) |
Request
Response
Multiple Aggregations
Request multiple aggregations at once:Group By Tags
Combined Batch
Send events and metrics together:Request
Response
Rate Limits
- Single metric: Standard rate limit
- Batch: 10 requests/minute, up to 500 metrics per request
- Query: 60 requests/minute
Errors
| Code | Description |
|---|---|
missing_name | Metric name is required |
invalid_type | Type must be gauge/counter/distribution/set |
invalid_value | Value must be numeric (string for sets) |
batch_too_large | Batch exceeds 500 metrics |