Skip to main content
POST

Authorizations

Authorization
string
header
required

Timbal API key. Obtain your API key from the Timbal platform settings. See Authentication for more information.

Path Parameters

org_id
string
required

Body

application/json

Body for POST /orgs/{org_id}/metrics/definitions/preview.

The same predicate fields as create, minus everything about persistence.

has_error
boolean | null
label_source
string
limit
integer<int64> | null

Runs to inspect, newest first. Default 20, max 50.

min_duration_ms
integer<int32> | null
project_id
string | null

Sample runs from one project only.

span_name
string | null
span_name_prefix
string | null
status_code
string | null
value_source
string
workforce_id
string | null

Sample runs from one agent/workflow (OrgsApps.id). Strongly recommended: it makes the sample representative of what you're filtering, instead of whatever the org ran most recently.

Response

What the definition would record

labels
object[]
required

Per-label aggregates, exactly as they'd land in Metrics. More than a handful of entries here means label_source: span_name over a high-cardinality predicate — every label is another bin per minute.

observations
integer<int64>
required

Total matching spans across the sample.

runs_matched
integer<int64>
required

Of those, how many produced at least one observation.

runs_sampled
integer<int64>
required

Runs with a trace that were actually inspected.

samples
object[]
required