-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: latency checker #131
Merged
polsar88
merged 19 commits into
polsar/config-parsing-enhancements
from
polsar/latency-checker
Sep 25, 2024
Merged
feat: latency checker #131
polsar88
merged 19 commits into
polsar/config-parsing-enhancements
from
polsar/latency-checker
Sep 25, 2024
Conversation
This file contains 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
brianluong
reviewed
Sep 3, 2024
pavelm
approved these changes
Sep 18, 2024
* feat: latency checker wiring * fix: remove ShouldRun check in IsLatencyAcceptable.Apply method * feat: support `alwaysRoute` option (#133) * feat: support `alwaysRoute` option * feat: add logging * fix: add TODOs * fix: updated comments * fix: remove confusing "TODOs" * fix: better phrasing * fix: lint * fix: add panics * fix: receiver cannot be nil * feat: check if error/latency routing control is enabled * fix: improve readability * fix: improve readability * fix: remove a TODO * fix: improve code readability * fix: improve code readability * fix: add a comment for `GlobalConfig::setDefaults` method * fix: rename IsEnhancedRoutingControlEnabled method * fix: rename HasEnhancedRoutingControlDefined method
polsar88
added a commit
that referenced
this pull request
Sep 25, 2024
* feat: config parsing enhancements * fix: the default threshold is now set in LatencyConfig if not specified * fix: getLatencyThresholdForMethod * fix: rename constant * fix: add TODOs * feat: expand a test * fix: chain routing config is no longer initialized if global routing config is not specified * feat: latency checker (#131) * feat: latency checker * fix: rename struct field * fix: ShouldRunPassiveHealthChecks field is now set correctly * feat: add method as a Prometheus label * fix: remove extra RecordRequest call * fix: rename method * fix: check if we should run passive check before initializing the client * fix: rename LatencyCheck to ErrorLatencyCheck * fix: rename `latency` module to `errorlatency` * fix: passive health check is no longer initialized if it is disabled * fix: improve a metric's help text * fix: rename metric variable names * fix: typo * feat: add tests * feat: latency checker wiring (#132) * feat: latency checker wiring * fix: remove ShouldRun check in IsLatencyAcceptable.Apply method * feat: support `alwaysRoute` option (#133) * feat: support `alwaysRoute` option * feat: add logging * fix: add TODOs * fix: updated comments * fix: remove confusing "TODOs" * fix: better phrasing * fix: lint * fix: add panics * fix: receiver cannot be nil * feat: check if error/latency routing control is enabled * fix: improve readability * fix: improve readability * fix: remove a TODO * fix: improve code readability * fix: improve code readability * fix: add a comment for `GlobalConfig::setDefaults` method * fix: rename IsEnhancedRoutingControlEnabled method * fix: rename HasEnhancedRoutingControlDefined method
polsar88
added a commit
that referenced
this pull request
Sep 25, 2024
* feat: add config parameters for fine-grained routing control (#126) * Added instructions to `README.md` * feat: update dependencies * feat: updated dependencies * feat: new mockery version * feat: add routing config params * feat: upgrade Go version * fix: suppress legacy linter errors * fix: field alignments in structs * fix: field linter errors * fix: linter errors * feat: add routing config params * feat: validate routing error rate * feat: refactoring * feat: add a TODO * feat: `ErrorsConfig` and `LatencyConfig` are now pointers * feat: add a field to routing config test * feat: set defaults for `DetectionWindow` and `BanWindow` * feat: move RoutingConfig functions closer to the struct * feat: changed `or` to `and` * feat: split function into validation and setting defaults components * feat: settings the config defaults now mirrors the validation workflow * feat: remove redundant call * feat: upgrade Go version to 1.22 * feat: config parsing enhancements (#130) * feat: config parsing enhancements * fix: the default threshold is now set in LatencyConfig if not specified * fix: getLatencyThresholdForMethod * fix: rename constant * fix: add TODOs * feat: expand a test * fix: chain routing config is no longer initialized if global routing config is not specified * feat: latency checker (#131) * feat: latency checker * fix: rename struct field * fix: ShouldRunPassiveHealthChecks field is now set correctly * feat: add method as a Prometheus label * fix: remove extra RecordRequest call * fix: rename method * fix: check if we should run passive check before initializing the client * fix: rename LatencyCheck to ErrorLatencyCheck * fix: rename `latency` module to `errorlatency` * fix: passive health check is no longer initialized if it is disabled * fix: improve a metric's help text * fix: rename metric variable names * fix: typo * feat: add tests * feat: latency checker wiring (#132) * feat: latency checker wiring * fix: remove ShouldRun check in IsLatencyAcceptable.Apply method * feat: support `alwaysRoute` option (#133) * feat: support `alwaysRoute` option * feat: add logging * fix: add TODOs * fix: updated comments * fix: remove confusing "TODOs" * fix: better phrasing * fix: lint * fix: add panics * fix: receiver cannot be nil * feat: check if error/latency routing control is enabled * fix: improve readability * fix: improve readability * fix: remove a TODO * fix: improve code readability * fix: improve code readability * fix: add a comment for `GlobalConfig::setDefaults` method * fix: rename IsEnhancedRoutingControlEnabled method * fix: rename HasEnhancedRoutingControlDefined method
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.
Design document: https://www.notion.so/alchemotion/Error-and-latency-based-routing-in-the-Satsuma-node-gateway-3a60d896c5844f82bf90f68570b00608
This PR adds a new module containing the new
ErrorLatencyCheck
struct. It contains the core functionality to keep error and latency state for each upstream, and to decide whether an upstream is healthy based on the request history for each RPC method.Type of change