Q&A: SleepPhaseOrchestrator config — budget, circuit-breaker thresholds, custom hooks, and PromQL monitoring #274
Unanswered
web3guru888
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Frequently Asked Questions about
SleepPhaseOrchestratorQ1: What
wall_clock_budget_sshould I set?A: Start with the default of 30 s and observe
asi_sleep_orchestrator_duration_seconds{quantile="0.99"}. For a typical 7-hook configuration on a CPU-only deployment:Set
wall_clock_budget_sto ~2× your observed p99. Monitorasi_sleep_budget_exceeded_total— if it increments, increase the budget or parallelize same-priority hooks.Q2: What happens if a hook fails? Does the whole SLEEP_PHASE abort?
A: No. The orchestrator is fault-tolerant, not fail-fast. On hook failure:
hook.rollback(ctx)is called.CircuitBreakerrecords the failure; afterfailure_thresholdconsecutive failures it opens and the hook is skipped untilrecovery_window_selapses.To get abort-on-first-failure behaviour, set
failure_threshold=1.Q3: How do I add a custom hook?
A: Implement the
AdaptationHookProtocol:Because
AdaptationHookis a@runtime_checkableProtocol, mypy will verify compliance at annotation sites without requiring inheritance.Q4: Can I run hooks in parallel?
A: Not in the 7.5 release — hooks run sequentially in priority order. Parallel execution is an open question (see Discussion #273). The API is forward-compatible: same-priority hooks could be gathered in a future minor release without breaking existing code.
Q5: How do I disable a single hook without removing it?
A: Two options:
orchestrator.deregister_hook("hook_name")andorchestrator.register_hook(hook)to re-enable later.Nonefor that component inbuild_sleep_orchestrator()— the factory simply omits it from the hook list.failure_threshold=0to keep the circuit permanently open (not recommended for production).Q6: Is circuit-breaker state persisted across restarts?
A: No — in 7.5 circuit state is in-memory only. Use
orchestrator.snapshot()/orchestrator.restore(snap)to serialise state before shutdown and reload it on startup. Persisting to Redis is straightforward:Q7: How do I monitor orchestrator health with PromQL?
Beta Was this translation helpful? Give feedback.
All reactions