CostGuardMode
Auto-generated API reference for CostGuardMode.
Type Alias: CostGuardMode
CostGuardMode =
"warn"|"reject"|"kill"
Defined in: observability/src/cost-guard-advanced.ts:24
Production-grade cost guard. Extends the multi-tenant guard with:
- Modes:
warn(log only) Β·reject(per-tenant flag, no abort) Β·kill(disable the tenant runtime via an injecteddisableRuntimecallback; requires explicit re-enable). - Window caps: per-minute / per-day / per-month rolling buckets.
Each window has its own threshold; tripping any one fires alerts
and (in
killmode) disables the tenant. - Linear forecasting: at 50 / 80 / 100 % of any window cap, emit
a
cost:thresholdalert with an extrapolated time-to-cap. - Pluggable alert sinks: the same contract regardless of where the alert lands (Slack webhook, PagerDuty, email gateway).
- Throttled alerting: at most one alert per (tenant, window, threshold) per cap window β avoids alert storms.
Closes #787 (hard-kill), #788 (forecasting + caps), #789 (alert sinks).
Chargeback report (#790) lives in chargebackReport() below.