prod-safety-rails

command
v1.30.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 9 Imported by: 0

README

prod-safety-rails

The production bounds that stop chaos from becoming the outage.

newEngine wraps an always-fire error rule with:

  • WithFailureBudget(0.5, 10) — stop injecting once the error rate over the last 10 calls reaches 50%, so chaos backs off instead of taking the dependency fully down;
  • WithMaxConcurrent(5) — cap simultaneously faulted calls;
  • WithProductionGuard(...)New panics if CHAOS_FORBIDDEN=1;
  • WithKillSwitch(...) — all faults suppressed if CHAOS_KILL=1.

run makes 50 calls; the test asserts that some are faulted but not all — the budget engaged. Try CHAOS_KILL=1 go run . to see chaos fully suppressed.

Documentation

Overview

Command prod-safety-rails shows the production bounds that keep chaos from becoming the outage: a failure budget, a max-concurrent cap, a production guard, and a kill switch. Run with `go run .`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL