Skip to content

Add proportional equivalent for CircuitBreaker.SetFailureThreshold #1026

Open
@cooperbenson-qz

Description

@cooperbenson-qz

I was really impressed to see Resty had circuit breaking built in but when setting up a Circuit Breaker for a Resty client, I noticed that the failure threshold could only be configured as an absolute number of requests during the timeout window. This can cause issues because the number of failures required doesn't scale with the number of requests being made over the window and makes it harder to reason about the correct threshold to set since you need to factor in the expected requests per second to be performed. A threshold of 3 makes sense for a client making 10 requests every 10s, but would make the breaker on a client handling 10x that number of requests far too sensitive.

As such, I'd like the option to be able to configure the threshold as a ratio of failures / total requests within the timeout window. That would allow me to have a rule of thumb like "the breaker should trip when 50% of requests fail" and remove the complexity of having to predict the request load and compute the correct absolute threshold ahead of time.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions