I recently released Mutineer, a chaos engineering library designed specifically for Elixir applications.
If you've ever wondered whether your error handling actually works under pressure, this might be useful.
What It Does
Mutineer lets you annotate individual functions to randomly fail at configurable rates. Think of it as Netflix's Chaos Monkey, but instead of taking down entire services, it operates at the function level—making it practical for development and staging environments.
How It Works
You can mark functions for chaos testing in two ways:
- Using the
@chaosattribute - Using the
defchaosordefchaospmacros
Once annotated, Mutineer randomly triggers failures based on your configuration, helping you validate that your supervision trees, GenServers, retry logic, and error handling actually behave as expected!
Failure Modes
Mutineer supports six different failure types:
-
:error- Returns error tuples -
:raise- Raises exceptions -
:timeout- Simulates timeouts -
:delay- Introduces latency -
:nil- Returns nil unexpectedly -
:exit- Triggers process exits
You can specify a single failure type or provide a list—Mutineer will randomly select one for each invocation. This also works with custom errors, exceptions, and exit reasons, helping simulate realistic production scenarios.
Links
GitHub: https://github.com/rum-and-code/mutineer
Hex: https://hex.pm/packages/mutineer
This is an early release, and I'd love to hear from the community about what would make it more useful. If you've worked with chaos engineering in Elixir (or other languages), I'm especially interested in your thoughts on what failure modes or configuration options would be valuable.
Have you used chaos engineering in your Elixir projects? What challenges have you faced testing fault tolerance?
Top comments (0)