Skip to content

Switch from consecutive errors to error rate traffic control strategy #472

@bolshakov

Description

@bolshakov

Error rate is a more universal approach that enables better circuit breaker decisions across varying traffic patterns. Proposed new default configuration:

  • window_size: 60 (seconds)
  • threshold: 0.5 (50% error rate)

Before introducing this change, we'll have a deprecation period in the v5.x series. To avoid annoying deprecation warnings, users will be able to opt in to v6 defaults while still using v5:

Stoplight.configure(defaults_version: :v6) do 
  ...
end

Acceptance Criteria

  • A warning should be issued if users rely on the default settings (consecutive errors strategy)
# Assumes consecutive errors strategy, therefore produces a warning
Stoplight('legacy-service', threshold: 5)

# Assumes consecutive errors strategy, therefore produces a warning
Stoplight('new-service', window_size: 60)
  • When a user uses custom window_size/threshold settings, the warning should not be issued
  • Users should be able to opt in to use v6 defaults early and not see the warning.

We'd love your feedback on this decision!

  • Does the error rate approach work for your use cases?
  • Are the proposed defaults (window_size: 60, threshold: 0.5) reasonable for your applications?
  • Do you have concerns about the migration path or the opt-in mechanism?

Please share your thoughts and any edge cases we should consider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions