{"id":50318641,"url":"https://github.com/cemakan/pastaay","last_synced_at":"2026-05-29T02:01:03.752Z","repository":{"id":360820612,"uuid":"1187973687","full_name":"CemAkan/pastaay","owner":"CemAkan","description":"Cloud native chaos engineering toolkit for Go. Inject faults across HTTP, gRPC, Kafka, Redis, SQL, and MongoDB. YAML defined policies, multi model Oracle AI (DeepSeek, Gemini, Anthropic, OpenAI), built in blast radius guard, and a drag and drop web console with live telemetry.","archived":false,"fork":false,"pushed_at":"2026-05-28T03:04:49.000Z","size":62966,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T03:10:17.265Z","etag":null,"topics":["aiops","chaos-engineering","deepseek","fault-injection","gitops","golang","kafka","kubernetes-operator","llm","mongodb","observability","prometheus","rabbitmq","resilience","telemetry","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CemAkan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["cemakan"],"buy_me_a_coffee":"cema"}},"created_at":"2026-03-21T12:55:08.000Z","updated_at":"2026-05-27T22:06:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/CemAkan/pastaay","commit_stats":null,"previous_names":["cemakan/pastaay"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/CemAkan/pastaay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemAkan%2Fpastaay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemAkan%2Fpastaay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemAkan%2Fpastaay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemAkan%2Fpastaay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CemAkan","download_url":"https://codeload.github.com/CemAkan/pastaay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CemAkan%2Fpastaay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33633468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiops","chaos-engineering","deepseek","fault-injection","gitops","golang","kafka","kubernetes-operator","llm","mongodb","observability","prometheus","rabbitmq","resilience","telemetry","yaml"],"created_at":"2026-05-29T02:01:01.708Z","updated_at":"2026-05-29T02:01:03.740Z","avatar_url":"https://github.com/CemAkan.png","language":"Go","funding_links":["https://github.com/sponsors/cemakan","https://buymeacoffee.com/cema"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/main_header.png\" alt=\"Pastaay Logo\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"docs/assets/main_description.png\" alt=\"Pastaay Description\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Release-v2.3.1-stable.svg\" alt=\"Release\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Go-1.25+-00ADD8?logo=go\" alt=\"Go Version\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\" alt=\"License\"\u003e\n\u003c/p\u003e\n\n## Core Architecture \u0026 Features\n\n**The Chaos Engine**\n* **Universal Interceptors:** Native fault injection for Kafka, RabbitMQ, HTTP, gRPC, SQL, MongoDB, and Redis.\n* **Resource Sabotage:** Simulate CPU starvation and memory leaks with guaranteed cleanup via the Amnesia Protocol.\n* **Security Hardened:** Constant time token verification, memory bounded payload processing (`io.LimitReader`), and native evasion protection.\n* **Deterministic Cascading:** Complex gRPC stream rules with stable session hashing that do not short circuit.\n\n**Control \u0026 Observability**\n* **AI SRE Copilot (Oracle):** Native multi LLM integration (Gemini, Claude, GPT) that autonomously analyzes live telemetry to generate and inject optimal chaos configurations.\n* **Kinetic Control Plane:** Fleet wide orchestration via the **`pastaayctl`** CLI, featuring imperative strikes, SLA guarded autopilot, and real time telemetry dashboards.\n* **Distributed Tracing:** Zero allocation OpenTelemetry (OTLP) integration for visualizing chaos events across microservices without goroutine leaks.\n* **Self aware Sensors:** Real time health monitoring and asynchronous telemetry for remote control providers.\n* **Web Console:** Centralized dashboard with real time telemetry grid, drag and drop policy builder, and the **Resilience Probe**, an Apdex based system resilience monitor with server side proxy probing and diagnostic field popovers.\n\n**Cloud native \u0026 GitOps**\n* **Kubernetes Native:** Seamlessly manage chaos via Custom Resource Definitions (`ChaosPolicy`) powered by the Pastaay Operator.\n* **GitOps Ready:** Full reference architectures for ArgoCD and Flux with autonomous rollbacks powered by the new `duration` spec.\n* **CI/CD Integration:** Native GitHub Action (`pastaay-strike`) to execute SLA guarded chaos experiments directly in your pipelines.\n---\n\n## Hot reloading \u0026 Reactivity\n\nPastaay is built to be reactive. The engine monitors configuration states via an **amnesia proof filesystem watcher** and remote telemetry channels. It instantly transitions between stable, high latency (Glitch), and disconnected (Void) states without dropping underlying connections or requiring service restarts.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/hot_reload_demo.gif\" width=\"850\" alt=\"Pastaay Hot reloading Demonstration\"\u003e\n\u003c/p\u003e\n\n---\n\n## Distributed Tracing (OpenTelemetry)\n\nPastaay features zero allocation distributed tracing out-of-the-box. It automatically injects high-fidelity spans into your active context during a chaos event, providing granular visibility into exactly *where*, *when*, and *how* your system was disrupted.\n\nTo enable tracing, configure the following environment variable on your host application:\n\n| Environment Variable | Description | Example |\n| :--- | :--- | :--- |\n| `OTEL_EXPORTER_OTLP_ENDPOINT` | The gRPC endpoint of your OTel Collector. If left empty, tracing safely defaults to a zero overhead `No-Op` mode. | `http://otel-collector:4317` |\n\n### The Zero overhead Guarantee\nPastaay utilizes OpenTelemetry's `BatchSpanProcessor`. This means chaos spans are flushed asynchronously. Even if your tracing backend (like Jaeger or Zipkin) goes offline, experiences severe latency, or is overwhelmed by trace volume, Pastaay will **never block your application's critical path** or leak goroutines.\n\n---\n\n## Zero Allocation\n\nPastaay is built to survive high throughput data streams. Our core evaluator guarantees **O(1)** policy lookups and **0 Bytes** of memory allocation per operation, ensuring your application never suffers from Garbage Collection (GC) spikes.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/benchmark.png\" alt=\"Pastaay Zero Allocation Benchmark\"\u003e\n\u003c/p\u003e\n\n---\n\n## Evolution \u0026 Roadmap\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/milkshake4drBishop.gif\" alt=\"FRINGE \u003c3\"\u003e\n\u003c/p\u003e\n\nPastaay is a continuously evolving enterprise chaos engineering suite. Our development phases are strictly focused on cloud native scalability and GitOps integrations.\n\n| Phase              | Theme | Architecture Goals |\n|:-------------------| :--- | :--- |\n| **Current (v2.3)** | **Web Console** | Centralized web dashboard for direct fleet management, visual impact analysis, and interactive documentation. |\n| **Next**           | **CEL driven Rule Engine** | **Dynamic Evaluation:** Integrating Google's Common Expression Language (CEL) to allow complex, AST-compiled conditional chaos rules (e.g., payload limits, header regex) with zero allocation overhead. |\n| **Future**         | **Trace aware Injection** | **context propagated Chaos:** Leveraging OpenTelemetry Baggage to inject faults based on the complete distributed request journey, targeting specific end-to-end transaction flows across the fleet. |\n\n## Web Console\n\nPastaay v2.3 introduces a fully client side **Web Console**, a real time observability hub served directly from the engine's embedded filesystem at `http://localhost:2112/console`. No external dependencies, no Node.js, no React.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/web_console_demo.gif\" width=\"850\" alt=\"Pastaay Web Console Demo\"\u003e\n\u003c/p\u003e\n\n**Telemetry Panels**, A modular, drag and drop grid with persistent layout:\n\n* **Global Fault Velocity:** Real time line chart of total fault injection rate (req/s). Powered by ECharts, reading `pastaay_injected_faults_total` directly from the engine's Prometheus gatherer.\n* **Blast Radius Matrix:** Stacked bar chart correlating errors, latency spikes, and dropped connections across the top 5 most targeted services.\n* **System Output Journal:** Lock free circular log viewer with hierarchical filtering (Pod → Protocol → Method), text search, live/pause toggle, and click to decrypt payload tracing. Streams Kubernetes pod logs via the Watch API.\n* **Resilience Probe:** Apdex based health monitor probing target URLs through a **server side proxy** (`POST /console/api/probe`) to bypass CORS. Features multi target round robin, EMA smoothed scoring, adjustable thresholds, and clickable diagnostic popovers.\n\n**Key Capabilities:**\n* **Sortable \u0026 Persistent:** Drag and drop reordering saved to `localStorage`.\n* **Expand/Collapse:** Each panel expands to show detailed diagnostics and tuning controls.\n* **Engine Status Bar:** Live sensor fabric, active policy count, and emergency `HALT EXPERIMENTS`.\n* **Dark/Light Theme:** Toggle persisted across sessions.\n\n**Additional Views:**\n\n* **Builder**: Visual policy configurator with type specific sabotage fields (gRPC stream modes, RAM chunks, CPU throttles). Generates YAML payloads validated by a blast radius guard.\n* **Oracle**: AI SRE Copilot: paste infrastructure context and let LLMs autonomously generate optimal chaos configurations.\n* **Docs**: Interactive documentation with full text search, navigation tree, and API reference.\n\n\u003e **Full architecture, API reference \u0026 diagnostic field docs:** [docs/web_console.md](docs/web_console.md)\n\n---\n\n## Documentation\n\nDive deep into Pastaay's mechanics using our official documentation:\n* [The Configuration Guide](docs/configuration.md) - Learn how to write policies, target endpoints, and control the blast radius.\n* [Architecture \u0026 Engine](docs/architecture.md) - Understand how the Policy Engine achieves zero latency lookups, and how we solved deep OS/Compiler integration constraints.\n* [Remote Control \u0026 Cloud native Sensors](docs/remote_control.md) - Learn how to securely control chaos across massive fleets via Redis, Kubernetes, or Webhooks.\n* [pastaayctl: Kinetic Control Plane Reference](docs/pastaayctl.md) - Master the CLI to orchestrate fleet wide chaos, run SLA guarded autopilot experiments, and monitor real time kinetic impact.\n* [Pastaay Kubernetes Operator](docs/operator.md) - Learn how to deploy the operator and manage chaos natively using Kubernetes CRDs.\n* [GitOps \u0026 CI/CD Integrations](examples/gitops/README.md) - Reference architectures for declarative chaos management via ArgoCD and pipeline automation.\n* [Web Console](docs/web_console.md) - Explore the centralized dashboard for fleet management and impact visualization.\n\n---\n\n##  Installation\n\n```bash\ngo get github.com/CemAkan/pastaay\n```\n\n---\n\n## Quick Start\n\n### 1. Create a Configuration File (`pastaay.yaml`):\n\n```yaml\nversion: 1\nwarmup_duration: \"10s\"\nenable_default_ignored: true\n\npolicies:\n   - name: \"custom-http-failure\"\n     target: \"/api/hello\"\n     type: \"http\"\n     error_chance: 1.0\n     error_code: 429\n     error_body: '{\"error\": \"Pastaay Chaos: Rate Limit Exceeded\"}'\n\n   - name: \"mongo-kill-switch\"\n     target: \"all\"\n     type: \"mongo\"\n     drop_connection: true\n```\n\n### 2. Integrate into your Go application:\n\n```go\npackage main\n\nimport (\n    \"net/http\"\n    \"github.com/CemAkan/pastaay/pkg/config\"\n    \"github.com/CemAkan/pastaay/pkg/ritual\"\n    \"github.com/CemAkan/pastaay/pkg/metrics\"\n)\n\nfunc main() {\n   // Load config \u0026 enable amnesia proof hot reload\n   cfg, _ := config.LoadConfig(\"pastaay.yaml\")\n   cfgManager := config.NewManager(cfg)\n   config.WatchConfig(\"pastaay.yaml\", cfgManager.Update)\n\n   // Start Prometheus metrics server\n   go metrics.StartServer(\":2112\")\n\n   // Setup your standard router\n   mux := http.NewServeMux()\n   mux.HandleFunc(\"/api/hello\", func(w http.ResponseWriter, r *http.Request) {\n      w.Write([]byte(\"Hello, World!\"))\n   })\n\n   // Wrap with Pastaay Chaos Middleware\n   chaosHandler := ritual.Middleware(cfgManager)(mux)\n   http.ListenAndServe(\":8080\", chaosHandler)\n}\n```\n\n### 3. Deploy the Operator (Optional, for Kubernetes environments):\n\n```bash\n# Register the CRD\nmake -C operator install\n\n# Deploy the operator to your cluster\nmake -C operator deploy IMG=\u003cyour-registry\u003e/pastaay-operator:v2.3.1\n```\n\n---\n\n## Running the Demos\n\nPastaay ships with two distinct examples to help you understand both its integration mechanics and its real time reactivity.\n1. The Integration Demo\n   A complete, hardened microservice stack (URL Shortener API, PostgreSQL, Redis, MongoDB, Kafka, RabbitMQ) showing how to securely integrate Pastaay without race conditions.\n\n```bash\ncd examples/demo\ndocker compose up -d --build\ndocker compose logs -f app\n```\n\n* **API:** `http://localhost:8080`\n* **Metrics:** `http://localhost:2112/metrics`\n* **Prometheus UI:** `http://localhost:9090`\n* **Grafana:** `http://localhost:3000`\n\n\u003cbr\u003e\n\n2. The TUI Visualizer (Vortex)\n   A standalone terminal user interface built to demonstrate Pastaay's amnesia proof hot reloading. This is the source of the GIF shown above.\n   cd examples/visualizer\n\n```bash\ncd examples/visualizer\n   # Note: Use 'run' instead of 'up' to ensure a clean TTY for the visualizer\n   docker compose run --rm --service-ports app\n```\n\u003cbr\u003e\n\n---\n\n## Contributing\n\nContributions from the community are always welcome❤️ Whether you are looking to build a new protocol interceptor, patch a core bug, or refine the documentation, your input is highly valued.\n\nPlease read the [Contributing Guide](CONTRIBUTING.md) for detailed instructions on the development workflow, core architectural guidelines (including pointer safety and interceptor fallbacks), and how to submit a Pull Request.\n\n---\n\n##  License\n\nPastaay is open source software licensed under the [MIT License](LICENSE).\n\n---\n\n## Read the Deep Dive\n\n[I Built a Chaos Engine That Goes Where No Tool Has Gone Before](https://medium.com/@cemakan/i-built-a-chaos-engineering-engine-that-goes-where-no-tool-has-gone-before-65d88fb141f3)\n\n16 sections covering every interceptor, the watcher, the guard, the Oracle prompt engineering, and the production bugs I hit along the way.\n\n---\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/main_footer.png\" alt=\"Pastaay QR Code\"\u003e\n\u003c/p\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemakan%2Fpastaay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcemakan%2Fpastaay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemakan%2Fpastaay/lists"}