Add Automated Circuit Breaker Regression Detection System#943
Open
nirmitparikh8 wants to merge 146 commits intomainfrom
Open
Add Automated Circuit Breaker Regression Detection System#943nirmitparikh8 wants to merge 146 commits intomainfrom
nirmitparikh8 wants to merge 146 commits intomainfrom
Conversation
Update variable names Fill sliding window with 1 hr worth data Add comment Update experiemnt resource to be deterministic Change deterministic default value to false Cleanup Remove unused variable Make initial seed error rate more customizable Add seed_error_rate as a property
* Prefilling added * Change initial duration to 900 s
* testing different circuit breaking scenarios * adding concurrency * adds more puts to get further information during phases * Fixing concurrency, unprotected ping, extras * update classic sustained test * cleaning up outdated tests, and testing without ping rate * modify ki instead of dividing by window size --------- Co-authored-by: Abdulrahman Alhamali <abdulrahman.alhamali@shopify.com>
Remove unnecessary comments and fix smoother initalization
* add elastic defensiveness * remove kd * update docs and run experiments * fix tests --------- Co-authored-by: Fernando Aguasvivas <fernando.aguasvivas@shopify.com>
…d classic modes (#808) * use lambda to implement dual circuit breaker * fix tests * class method to allow setting a global selector for adaptive config * remove unneeded methods that are no longer used use CircuitBreakerBehaviour * allow adaptive_circuit_breaker_selector to be unset * make dynamic configuration call only on acquire * require resource to be provided * fix: avoid an extra lookup to use_adaptive in metrics * various fixes * nit: cleanup * fix logging to both circuit breakers at the same time * use logic from both acquire methods in dual_circuit_breaker * fix last error tracking test by using properly scoped exceptions variable * fix demos * remove unused attr_reader for name use symbols for active_breaker_type instead of strings create separate acquire methods for readability use active_breaker_type consistently to determine breaker type remove useless AI-generated tests fix useful tests * nit: typo fix * nit: remove TODO comment * don't return if variables are nil (dangerous) use_adaptive proc no longer exists at initialization (proc is set at runtime) * address PR comments * make active_circuit_breaker readable for tests clean up unneeded tests and AI fluff * improve track both breakers test with assert_equal * replace "legacy" with "classic", notify on change in cb type * replace legacy with classic * notify on change in cb type, remove verbose comments, and refactor `handle_adaptive_acquire` * metrics functions for dcb example * have error handling parity between classic and adaptive * fix exceptions parameter passing * reference as instance variable * use acquire directly from circuit breakers * fix dcb test and remove verbose content * fix double counting of errors * undo the move of method to public * make active_breaker_type public * rerun experiments --------- Co-authored-by: Kristofer Gaudel <kris.gaudel@shopify.com> Co-authored-by: Abdulrahman Alhamali <abdulrahman.alhamali@shopify.com>
be0d5c2 to
2d17fc3
Compare
nirmitparikh8
commented
Dec 19, 2025
Contributor
Author
There was a problem hiding this comment.
This is the file to tune configs. Let's iterate on this and make the configs more restrictive. Right now we allow 80 percent of changes in error trend. We should figure out why these violations are so high when we compare new csv to baseline and fix that. Could be something with the test or with hoq we check for regressions (This new system I built)
b730d85 to
2d17fc3
Compare
This reverts commit 70cff45.
aeba5a1 to
2231b64
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What We're Trying to Achieve
Replace manual visual inspection of experiment results with an automated statistical regression detection system that can:
🔧 How We're Achieving It
Statistical Approach: Percentile-Based Control Charts
|actual_rate - target_rate| / target_rate * 100Automated Pipeline Components
collect_baseline_data.rb: Automated baseline collection (runs experiments N times, organizes results)compute_baselines.rb: Statistical analysis (calculates percentiles from historical data)detect_regressions.rb: Main detection engine (compares current results vs baselines)regression_config.rb: Centralized, tunable configuration📊 Pipeline Flow & Math
🚧 Current State & Progress
✅ What's Complete
🔧 What We're Still Tuning
🤖 Current Configuration (Intentionally Generous)
Why So Generous? I wanted to develop a baseline MVP for the team to iterate on before my internship ends. I didn't get time to go deeper.
📈 Next Steps
collect_baseline_data.rb 15across multiple weeks🎯 Success Metrics
This PR establishes the foundation for data-driven circuit breaker regression detection. The generous initial configuration ensures we don't block development while we gather data to optimize the system.