feat: add degradedType and retriedError to degraded events#7988
Open
cryptodev-2s wants to merge 7 commits intomainfrom
Open
feat: add degradedType and retriedError to degraded events#7988cryptodev-2s wants to merge 7 commits intomainfrom
degradedType and retriedError to degraded events#7988cryptodev-2s wants to merge 7 commits intomainfrom
Conversation
degradedType and retriedError to degraded events
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
mcmire
reviewed
Feb 18, 2026
Contributor
mcmire
left a comment
There was a problem hiding this comment.
I had some suggestions below. I made some comments on lines that I also suggested be moved, so hopefully that isn't too confusing.
packages/network-controller/src/create-network-client-tests/rpc-endpoint-events.test.ts
Outdated
Show resolved
Hide resolved
packages/network-controller/src/create-network-client-tests/rpc-endpoint-events.test.ts
Outdated
Show resolved
Hide resolved
…and fields - Move DegradedType/RetriedError out of RpcService into create-network-client as DegradedEventType/RetryReason (keeps RpcService simple) - Rename degradedType -> type, retriedError -> retryReason - Rename values: request_not_initiated -> connection_failed, non_success_http_status -> non_successful_response - Split isTimeoutOrResetError into isTimeoutError + isConnectionResetError - Export isJsonParseError, isServerHttpError, isTimeoutError, isConnectionResetError
Contributor
Author
|
@metamaskbot publish-preview |
e3ea422 to
8f4342f
Compare
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
This was referenced Feb 18, 2026
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.
Explanation
Degraded events fire when an RPC endpoint is slow or its retries are exhausted, but we can't distinguish between these two cases in Segment analytics.
This adds two new fields to degraded events:
degradedType('slow_success' | 'retries_exhausted') — why degradation happenedretriedError('request_not_initiated' | 'response_not_json' | 'non_success_http_status' | 'timed_out' | 'connection_reset' | undefined) — when retries are exhausted, what kind of error was retriedThese fields flow through
RpcService→RpcServiceChain→create-network-client→NetworkControllerevent payloads (rpcEndpointChainDegradedandrpcEndpointDegraded).References
rpcMethodNametodegradedevents #7954 (rpcMethodNameon degraded events)Checklist
Note
Medium Risk
Changes and extends degraded-event payload contracts and adds new error-classification logic; main risk is downstream consumers depending on event shapes or relying on prior retry error heuristics.
Overview
Enriches
NetworkController:rpcEndpointDegradedandNetworkController:rpcEndpointChainDegradedevent payloads with a newtype(slow success vs retries exhausted) plus an optionalretryReasonclassification when retries are exhausted, and exports these new types (DegradedEventType,RetryReason).Refactors
RpcServiceretry error detection into exported helpers (isJsonParseError, plus newisHttpServerError/isTimeoutError/isConnectionResetError) and uses them to classify the final error when emitting degraded events; updates the degraded event test suite and changelog accordingly.Written by Cursor Bugbot for commit 1821148. This will update automatically on new commits. Configure here.