Provider rotation

How Valienz picks which provider account serves each request.

Overview

Every product call walks a four-stage pipeline:

  1. Filter candidates by required capability and tenant ownership.
  2. Drop accounts whose circuit is OPEN or whose health is below threshold.
  3. Apply the per-product strategy (see below) to pick the leader.
  4. On failure, fall through the ordered fallback list.

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.