Provider rotation
How Valienz picks which provider account serves each request.
Overview
Every product call walks a four-stage pipeline:
- Filter candidates by required capability and tenant ownership.
- Drop accounts whose circuit is OPEN or whose health is below threshold.
- Apply the per-product strategy (see below) to pick the leader.
- On failure, fall through the ordered fallback list.
Edit per-product strategy at /providers/rotation. Use the dry-run button to preview the picked account without billing.
Strategies
- ROUND_ROBIN — cycle through healthy accounts. Default for new tenants.
- WEIGHTED — split traffic by the weight field per account.
- LEAST_COST — pick the cheapest healthy account first.
- LEAST_USED — pick the lowest in-flight count.
- STRICT_PRIORITY — always pick the first account in the explicit chain; only fall through on failure.
- FAILOVER — like strict priority but the chain is the explicit failover order.
Circuit breaker
Each provider account has a circuit (CLOSED → OPEN → HALF_OPEN → CLOSED). Five consecutive failures opens the circuit; the rotation engine skips OPEN accounts until the half-open probe succeeds.
Failover tagging
When a request fails over to a secondary account, the resulting log row carries failoverFromAccountId so you can measure rotation churn. The dashboard surfaces this with a ⤴ glyph on the row.