Counterfactual metrics quantify spend that would have been wasted without recovery, and billed-but-failed spend you still pay providers for.
Agent hint
Use for loss_avoided, projected_cost, UNFULFILLED_SPEND, dashboard billed_but_failed_cost, migration 002.
In scope
Out of scope
| Field | Description |
|---|---|
| outcome | success | failure | recovered | degraded |
| cost_type | Includes unfulfilled_spend for billed-but-unusable calls |
| projected_cost | Estimated cost if primary route had succeeded |
| loss_avoided | Counterfactual savings from recovery (in extra_metadata too) |
| recovery_provider | Provider used after fallback/retry |
| attempt_index | 0-based attempt number |
| status / error_code / latency_ms / finish_reason | Provider response metadata for analytics |
billed_but_failed_cost — spend on unfulfilled/degraded outcomesloss_avoided — aggregated counterfactual recovery valuerecovery_rate — share of recoverable failures successfully retriedreliability_savingsBackend migration
Run python -m scripts.migrate_002_reliability_fields on your deploy database before relying on reliability dashboard columns.