Route experiments
Last updated: 2026-11-26T03:21:52-03:00 (UTC-3)
A canary already splits an alias’s traffic between a stable side and a canary side. A route experiment scores the two sides with one of your evaluators: for each side, how many of your team’s traces went there, how many passed and failed the evaluator, their errors, tokens, cost per trace and p95 duration, and how much better or worse the canary is. With guarded rollback the gateway rolls the canary back when its pass rate falls too far below stable.
No feature flag service and no subject tag are needed: the side of a trace is the gateway’s own routing decision, recorded on the trace (canary.side).
| Flag | What it turns on |
|---|---|
route_experiments |
Route experiments: Evals → Route experiments and /api/v1/admin/route-experiments. Off by default. A tenant resource: with plan entitlements a team’s plan must include it. Needs canary_routing, evaluators and span_store |
Permissions: route_experiments:read (every built-in role that reads evals, within its teams) and route_experiments:manage (team administrators of their teams, administrators everywhere).
How to run one
Section titled “How to run one”-
The operator gives the alias a canary policy (
canaryon the model, flagcanary_routing). For guarded rollback the operator also turns oncanary_auto_rollback, setscanary.auto_rollbackon the alias and lists your team incanary.auto_rollback.evaluation_teams: the alias is shared, so the operator names whose quality verdict may roll it back, team by team.models:- id: support-chatcanary:target: 1percent: 10auto_rollback:max_error_rate: 0.2evaluation_teams: [support] # at most 64 team IDs; empty: no team may -
Your team has an evaluator live on the alias’s traffic (Evals → Evaluators, scope span or trace, a filter such as
model:support-chat), with pass criteria. -
Create the experiment (Evals → Route experiments → New experiment, or the API):
POST /api/v1/admin/route-experiments{ "team_id": "support", "name": "New model on support-chat", "alias": "support-chat", "evaluator_id": "ev_6a1f0c2b9d3e4f5a6b7c8d9e", "min_samples": 50, "max_drop": 10, "window_minutes": 1440, "guarded_rollback": true}| Field | Default | Bounds | Meaning |
|---|---|---|---|
min_samples |
50 | 5-100000 | Judged traces each side needs before a decision |
max_drop |
10 | more than 0, at most 100 | Percentage points the canary’s pass rate may fall below stable’s |
window_minutes |
1440 | 5-10080 | The trailing window the readout reads (never before the experiment started) |
guarded_rollback |
false | Roll the canary back on a regression (needs the operator’s opt-in above, and routing_versions on so the rollback reaches every replica) |
A team holds at most 50 experiments. The team and the alias never change; create another experiment instead.
Reading the result
Section titled “Reading the result”GET /api/v1/admin/route-experiments/{id} (and the experiment’s page) returns the readout:
- per side:
traces,errors,pass,fail,judged,pass_rate(percent),cost_usdandcost_per_trace_usd(exact decimals; null when unknown),tokens_per_traceandp95_ms; pass_rate_lift: canary minus stable, in points;cost_per_trace_lift: in percent;decision:collecting(a side has fewer thanmin_samplesjudged traces),holding(withinmax_drop),regressed(the canary is more thanmax_droppoints below stable) orno_canary(the alias lost its canary policy);- what counts: the evaluator’s own runs, by its ID. A score a client or a reviewer sent under the same name never counts, nor a judge guardrail’s check with the same evaluator. A trace with a failing run is a fail, and a pass only without one. A reviewer who corrects one of the evaluator’s results (with result write access) changes it here too, as everywhere else the result is read;
truncated: an evaluation read reached 2,000 traces, so the counts are lower bounds and no rollback is decided on them. Shorten the window.
Only your team’s traffic counts, and of it only what was recorded in its current organization; another organization’s traces on the same alias never enter your numbers. The readout reads the span engine the trace explorer reads (the database or the analytics store).
Guarded rollback
Section titled “Guarded rollback”On every tick of the monitor scheduler (evaluation.monitors.tick, 1 minute by default) the gateway reads every running experiment with guarded rollback. When the decision is regressed and the alias trusts the experiment’s team, it sets the canary percent to 0 through the canary auto-rollback (immediately on the replica, and as an audited routing version written once, reason evaluation_pass_rate), and ends the experiment as rolled_back once the rollback is stored (or held on the replica without the store). A rollback that could not be written as a routing version (the GitOps file owns the alias, another change came first, the write failed) is logged as route_experiment_rollback_not_written and ends the experiment as stopped with the reason rollback_not_written:<state>; check the alias by hand. Promotion stays a human action. An experiment also ends as stopped when the alias loses its canary (canary_removed), when the canary is already at 0 (canary_at_zero) or when its evaluator is deleted (evaluator_removed).
Stop an experiment with POST /route-experiments/{id}/stop; delete it with DELETE. A rollback it made stays: it is a routing version.
| Route | Permission |
|---|---|
GET /api/v1/admin/route-experiments |
route_experiments:read |
POST /api/v1/admin/route-experiments |
route_experiments:manage |
GET /api/v1/admin/route-experiments/{id} |
route_experiments:read |
PUT /api/v1/admin/route-experiments/{id} (with expected_version) |
route_experiments:manage |
POST /api/v1/admin/route-experiments/{id}/stop |
route_experiments:manage |
DELETE /api/v1/admin/route-experiments/{id} |
route_experiments:manage |
Change a running experiment with PUT /api/v1/admin/route-experiments/{id} (the same fields and expected_version), end it with POST /api/v1/admin/route-experiments/{id}/stop, and remove it with DELETE /api/v1/admin/route-experiments/{id}.
Every write is audited (route_experiment.create, .update, .stopped, .rolled_back, .delete); the watcher logs route_experiment_regressed and route_experiment_ended.
Upgrade notes
Section titled “Upgrade notes”Migration 290 adds the experiments table. Nothing changes with the flag off.
See also
Section titled “See also”Canary routing · Evaluators · Evaluation monitors · Judge guardrails