Skip to main content

Risk-driven chaos experiment scheduler โ€” rank which microservice to chaos-test next

Project description

ChaosRank (Public SDK)

Chaos engineering requires a hypothesis. ChaosRank tells you where to point it.

๐Ÿ’ฌ Questions? Feedback? Join our GitHub Discussions to connect with the team.

PyPI CI Python License

ChaosRank analyzes your service dependency graph and incident history to rank which service to target next.

This is the Open Core SDK. It works by collecting your system data and sending it to the ChaosRank Engine for secure, high-performance scoring.


Open Core Architecture

ChaosRank is split into two components to protect core mathematical IP while allowing public development of adapters:

  1. Public SDK (This repo): CLI, trace parsing, and incident collection.
  2. Private Engine: Core scoring algorithms (Blast Radius, Fragility, Adaptive).

Choose Your Hosting Model:

  • SaaS (Community): Point your SDK to a managed ChaosRank Engine URL.
  • Self-Hosted (Enterprise): Run the engine Docker container in your own infrastructure.

Results

Evaluated on the DeathStarBench social-network topology (31 services) from the UIUC/FIRM dataset (OSDI 2020). ChaosRank's engine identifies high-risk services by combining structural importance (traces) and history (incidents).

Metric ChaosRank Random Improvement
Mean experiments to first weakness 1.0 9.8 9.8x
Mean experiments to all weaknesses 3.0 23.2 7.8x

ChaosRank found all 3 weaknesses in exactly 3 experiments across all 20 trials. Random selection needed 23.2 experiments on average.


How It Works

ChaosRank uses a Client-Server model. The SDK (this repo) acts as the "Body," collecting traces and incidents from your environment. These are summarized and sent to the ChaosRank Engine (The "Brain") for scoring.

traces.json  โ”€โ”€โ–บ [ SDK Parser ] โ”€โ”€โ–บ [ EngineClient ] โ”€โ”€โ–บ [ Hosted Engine ]
incidents.csv โ”€โ”€โ–บ [ SDK Parser ] โ”€โ”€โ–บ [ EngineClient ] โ”€โ”€โ–บ [ Risk Ranking ]

The engine provides deterministic rankings based on:

  • Blast Radius: Transitive impact of failure (Impact).
  • Fragility: Load-normalized incident history (Likelihood).
  • Adaptive Weights: Self-correcting risk factors based on experiment outcomes.

See docs/algorithm.md for a summary of the mathematical foundation.


Installation

ChaosRank is distributed via PyPI. We recommend installing in a virtual environment:

pip install chaosrank-cli

From Source

git clone https://github.com/Medinz01/chaosrank
cd chaosrank
pip install -e .

Configuration

ChaosRank works out-of-the-box with a shared public key for testing. Update your chaosrank.yaml:

engine:
  url: "https://m3ed35tnfb.execute-api.ap-south-1.amazonaws.com"  # Managed SaaS Endpoint
  api_key: "chaosrank-public-dev"                                # Shared Public Key (Rate Limited)

Or use environment variables: export CHAOSRANK_API_KEY=chaosrank-public-dev

API Access Tiers

Tier Key Limits Support
Public chaosrank-public-dev Shared, Heavy Rate Limits Community (Discussions)
Pro Private Key High Throughput, Dedicated Email/Direct

Getting a Pro Key

For production-scale environments or high-frequency CI pipelines, please request a private key by starting a thread in our GitHub Discussions with the access-request label.


Usage

Basic ranking

chaosrank rank --traces ./traces.json --incidents ./incidents.csv

With async topology (Kafka, SQS, RabbitMQ)

# Step 1 โ€” convert your async topology source
chaosrank convert --from kafka --input ./kafka-topics.json --output ./async-deps.yaml

# Step 2 โ€” rank with async deps merged
chaosrank rank --traces ./traces.json --async-deps ./async-deps.yaml

Fetch incidents from alerting system

# From PagerDuty (no manual CSV needed)
chaosrank incidents --from pagerduty --token $PD_TOKEN --window 30d --output incidents.csv
chaosrank rank --traces ./traces.json --incidents incidents.csv

Repository Structure

chaosrank/
โ”œโ”€โ”€ chaosrank/
โ”‚   โ”œโ”€โ”€ cli.py                    # Typer entrypoint: rank, graph, convert
โ”‚   โ”œโ”€โ”€ engine/                   # Remote Engine Client (Communication layer)
โ”‚   โ”œโ”€โ”€ adapters/                 # Async topology adapters (AsyncAPI, Kafka)
โ”‚   โ”œโ”€โ”€ incident_adapters/        # Alerting system adapters (PagerDuty, etc.)
โ”‚   โ”œโ”€โ”€ parser/                   # Local Trace/Incident parsing & normalization
โ”‚   โ””โ”€โ”€ output/                   # Table, JSON, Litmus renderers
โ”œโ”€โ”€ tests/                        # 244+ tests
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ algorithm.md              # Mathematical Summary
โ”‚   โ”œโ”€โ”€ architecture.md           # Component map & Data flow
โ”œโ”€โ”€ chaosrank.yaml                # Default configuration
โ””โ”€โ”€ pyproject.toml

Contributing

See CONTRIBUTING.md for setup, testing, and PR guidelines.

Documentation

Changelog

See CHANGELOG.md for version history.

License

Apache 2.0 โ€” see LICENSE for full text.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chaosrank_cli-1.0.1.tar.gz (85.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chaosrank_cli-1.0.1-py3-none-any.whl (69.7 kB view details)

Uploaded Python 3

File details

Details for the file chaosrank_cli-1.0.1.tar.gz.

File metadata

  • Download URL: chaosrank_cli-1.0.1.tar.gz
  • Upload date:
  • Size: 85.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for chaosrank_cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5725af939b9d6c83bae09c7724ca9370b6a5fb1625d803289cc38e47b8569069
MD5 60332cf3c51ae5fe0d25921970520d9a
BLAKE2b-256 f81a620992362c07e606850f13141892b42a160a2152a261346ccf7df3bd476f

See more details on using hashes here.

File details

Details for the file chaosrank_cli-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: chaosrank_cli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 69.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for chaosrank_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff7260051d87cb26e034ff318e20fb8d7782264e9755f18a7af89d54c874c589
MD5 5928d61a561a7d6a95087d9228bfdeeb
BLAKE2b-256 208772660bfe49f15eeb7bb3049a474393b0654bd93697aad1050437374d65b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page