ENG-1670 - improve proxyd metrics, support local rate limiter#1782
Merged
mslipper merged 1 commit intoethereum-optimism:developfrom Nov 24, 2021
Merged
ENG-1670 - improve proxyd metrics, support local rate limiter#1782mslipper merged 1 commit intoethereum-optimism:developfrom
mslipper merged 1 commit intoethereum-optimism:developfrom
Conversation
🦋 Changeset detectedLatest commit: da6138f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Can you add a changeset? |
tynes
reviewed
Nov 19, 2021
tynes
reviewed
Nov 19, 2021
go/proxyd/rate_limiter.go
Outdated
Contributor
There was a problem hiding this comment.
Spacing is off here, mixed tabs + spaces
2e00f18 to
ea6db40
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1782 +/- ##
========================================
Coverage 71.81% 71.81%
========================================
Files 69 69
Lines 2303 2303
Branches 344 344
========================================
Hits 1654 1654
Misses 649 649
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
ea6db40 to
da6138f
Compare
tynes
approved these changes
Nov 24, 2021
theochap
pushed a commit
that referenced
this pull request
Dec 10, 2025
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.
This PR improves
proxydmetrics, and removes the requirement to use Redis with the rate limiter.New metrics
rpc_backend_http_response_codes_total{"auth", "backend_name", "method_name", "status_code"}- This counter tracks HTTP error codes returned from each proxy backend. It's maintained as a separate metric fromrpc_errors_totalsincerpc_errors_totalkeeps track of errors found in the JSON-RPC response body.http_response_codes_total- This counter tracks HTTP response codes returned to the client. Usually, this will be 200 except in a couple of exceptional cases:Other errors will return either a 500, or a 200 with a JSON-RPC response code. HTTP error codes other than 400s are not proxied from the upstream because they are inconsistent among different infrastructure providers.
Rate limiting
Redis is no longer required to apply rate limiting. If the
[redis]stanza is not provided in the config, thenproxydwill use an in-memory rate limiter instead. To remove rate limiting from an endpoint altogether, remove Redis from the config and set the RPS and concurrency limits to zero.User agent logging
The user agent is now logged. It looks like this:
You can use the
req_idto correlate subsequent log lines with the user agent.