Appearance
Derived Metrics
Beta
Derived metrics are in beta, on paid plans. Limits are subject to change.
A derived metric counts or measures records as they arrive and writes the result as a real metric: error logs per service per minute, the p95 of a span's duration, revenue summed from checkout events. Once written, it's a metric like any you send over OpenTelemetry. Chart it under Metrics, put it on a dashboard, and alert on it with a telemetry monitor.
Querying a metric is far cheaper than scanning raw logs, so a derived metric is the right home for anything you look at often or keep for longer.
Create one
Open Manage Streams, pick a Stream and go to Derived Metrics → New Metric. As you edit, the preview shows the series it would write over the last hours, from your real data, before anything is saved.
| Setting | |
|---|---|
| Metric name | How it appears in Metrics, charts and monitors, e.g. checkout.errors. It can't be renamed later. |
| From | Logs or traces (OpenTelemetry Streams), or events (Events Streams), and a search choosing which records count. |
| Measure | See the table below. |
| One series per | Up to four fields; each becomes a tag on the metric. |
| Bucket | 10 seconds to 1 hour per point. |
| Lag | Stay this far behind now so late records land first (default 60 s). |
| Run every | How often it catches up (the plan sets a 1 minute floor). |
| Backfill | Hours of history to write when it's created (up to 7 days). |
| Measure | Writes | Read it as |
|---|---|---|
| Count | a counter of matching records | increase or rate |
| Sum of a field | a counter | increase or rate |
| Distribution of a field | a histogram | p50 to p99, avg, count |
| Average, Min, Max of a field | a gauge | avg, min, max |
RED metrics
An OpenTelemetry Stream can add the three standard service metrics in one click, Add RED Metrics: requests, errors and duration from server spans, per service and operation.
Keeping it right
- Each metric shows how far behind now it is and its last run. Expand it for the run log and live runs.
- Run Now catches up straight away instead of waiting for the next run.
- Changing what a metric measures (its search, measure, grouping or bucket) rebuilds it: the points it wrote are replaced from the backfill point. Rebuild does the same on demand.
- Runs are safe to repeat: a retried or overlapping run never counts a record twice.
- Delete removes the points it wrote.
Limits
| Plan | Derived metrics |
|---|---|
| Hobby | 5 |
| Pro, Founders | 25 |
| Team | 200 |
| Enterprise | 1,000 |
API
GET /v1/telemetry/derivedMetrics | List a namespace's (or a Stream's) derived metrics |
POST /v1/telemetry/derivedMetrics/create, /update, /delete | Manage them |
POST /v1/telemetry/derivedMetrics/preview | The series a definition would write, without saving |
POST /v1/telemetry/derivedMetrics/runNow, /rebuild | Catch up now, or rewrite from a point |
GET /v1/telemetry/derivedMetrics/runs | Its materialization runs |
POST /v1/telemetry/derivedMetrics/red | Add the RED metrics to an OpenTelemetry Stream |