server:
port: 8080
workers: 4
endpoints:
- name: "Probabilistic Failure"
method: GET
path: "/api/chaos"
responses:
- status: 200
probability: 0.9
body: '{"status": "success", "message": "Standard response"}'
- status: 503
probability: 0.1
body: '{"error": "Service Unavailable", "type": "chaos_injection"}'
- name: "Flaky Service"
method: GET
path: "/api/flaky"
stateful: true
responses:
- status: 500
condition: "request_count <= 2"
body: '{"error": "Internal Server Error", "attempt": {{request_count}}}'
- status: 200
condition: "request_count > 2"
body: '{"status": "success", "message": "Recovered after {{request_count}} attempts"}'
- name: "Slow Timeout"
method: POST
path: "/api/timeout"
responses:
- status: 504
delay: 1s-3s
body: '{"error": "Gateway Timeout", "latency": "random"}'
- name: "Rate Limit Simulation"
method: GET
path: "/api/limited"
stateful: true
responses:
- status: 200
condition: "request_count <= 5"
body: '{"status": "ok", "remaining": {{5 - request_count}}}'
- status: 429
condition: "request_count > 5"
headers:
Retry-After: "60"
body: '{"error": "Too Many Requests", "limit": 5}'