Custom Metrics
Record and query custom application metrics.Record Metric
Request
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Metric name |
value | number | Yes | Metric value |
type | string | No | Type: gauge, counter, histogram (default: gauge) |
tags | object | No | Key-value tags for filtering |
timestamp | string | No | ISO8601 timestamp (default: now) |
Response
Metric Types
Gauge
A point-in-time value that can go up or down:Counter
A cumulative value that only increases:Histogram
A distribution of values:Bulk Record
Send multiple metrics in one request:Request
Response
List Metrics
Get available metrics:Response
Query Metric Stats
Get statistics for a specific metric:Query Parameters
| Parameter | Type | Description |
|---|---|---|
since | string | Time range: 1h, 24h, 7d |
interval | string | Group by: minute, hour, day |
tags | string | Filter by tags (JSON encoded) |
Example Request
Response (Gauge)
Response (Counter)
Response (Histogram)
Tags
Use tags to segment metrics:Rate Limits
- Single metric: Standard rate limit
- Batch: 10 requests/minute, up to 1000 metrics per request
Errors
| Code | Description |
|---|---|
invalid_type | Type must be gauge/counter/histogram |
invalid_value | Value must be a number |
name_too_long | Name exceeds 255 characters |
too_many_tags | More than 10 tags provided |
batch_too_large | Batch exceeds 1000 metrics |