Skip to content

[Draft] use current metrics for adaptive circuit breaker reporting#913

Draft
adriangudas wants to merge 129 commits intomainfrom
adriangudas/use-current-metrics-for-adaptive-reporting
Draft

[Draft] use current metrics for adaptive circuit breaker reporting#913
adriangudas wants to merge 129 commits intomainfrom
adriangudas/use-current-metrics-for-adaptive-reporting

Conversation

@adriangudas
Copy link
Copy Markdown
Contributor

@adriangudas adriangudas commented Dec 8, 2025

Use current metrics instead of last window for the error state transition message. This way, we get an up-to-date understanding of the error rate at the moment of transition.

This is also missing last_error_message and error_last_at to be parity with legacy.

On a 100% error rate spike, now prints:

I, [2025-12-07T18:53:39.989926 #98450] INFO -- : [Semian::AdaptiveCircuitBreaker] State transition from closed to open. success_count= error_count= rejected_count= rejection_rate=87.64% error_rate=98.38% ideal_error_rate=1.0% integral=9.7378 name="my_service"

AbdulRahmanAlHamali and others added 30 commits October 22, 2025 17:08
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>
kris-gaudel and others added 28 commits November 4, 2025 19:50
…reads

Different Semians between different threads
* Set up automated test for PID controller

Reset

Update experiment graphs

Delete existing image

Done

Update experiment graphs

Update experiment graphs

Refactor experiments folder and CI

Update scope of commit

Update experiment graphs

Update experiment graphs

Update Gemfile

Update experiment graphs

Move windup file into test folder

Update experiment graphs

CI should only commit main graphs

Update experiment graphs

New bot

Fail fast

Test

Delete comment

Update experiment graphs

test

Revert

test

Add the commit

Test

Test

* Rework CI check

Done

Final
* allow max threads, and introduce slow query experiment

* fix my experiment, and run all other experiments
* add tables, and fix bug in helper

* remove useless check

* replace with csv tables for better display
)

* Replace p2 estimator with SES

* Fix PID tests to use new smoother

* Remove p2

* update images

* Correct comment

* update images

* Clean up comments, address Abed's concerns

* Update comment

* Update images

* run all experiments

* Unit tests for success criteria

* Add incident detection and adaptive convergence

* Update success criteria version 2

* Address Abed's comments

* Update experiments Gemfile to prevent error

* Update experiments

* Address Abed comments again

* Remove init

* Experiments

---------

Co-authored-by: Abdulrahman Alhamali <abdulrahman.alhamali@shopify.com>
* switch algorithm to a sliding window instead of discrete

* clean up AI slop PR

* provide observations per minute to the smoother from the pid controller

* fix tests

* remove unused smoother in setup

* fix alpha value

* fix tests and run experiments

* fix max size for sliding window and rerun experiments
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>
@adriangudas adriangudas changed the base branch from main to pid-take-2 December 8, 2025 01:40
Base automatically changed from pid-take-2 to main March 19, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants