Netflix popularized Chaos Engineering. In 2022, it should be standard practice. We deliberately inject failures to verify our systems handle them gracefully.
Simmy Library
Polly’s Simmy extension allows injecting faults in .NET.
var chaosPolicy = MonkeyPolicy.InjectException(with =>
with.Fault(new HttpRequestException("Simulated failure"))
.InjectionRate(0.05) // 5% of requests fail
.Enabled(IsChaosEnabled));
var result = await chaosPolicy.ExecuteAsync(() => _httpClient.GetAsync("/api/orders"));
Run this in a staging environment and verify your retry logic, circuit breakers, and fallback mechanisms work correctly.
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.