feat: add degradedType and retriedError to degraded events#7988
Merged
cryptodev-2s merged 9 commits intomainfrom Feb 19, 2026
Merged
feat: add degradedType and retriedError to degraded events#7988cryptodev-2s merged 9 commits intomainfrom
degradedType and retriedError to degraded events#7988cryptodev-2s merged 9 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. |
mcmire
reviewed
Feb 19, 2026
Contributor
mcmire
left a comment
There was a problem hiding this comment.
Looks better, just had some final suggestions.
…t and test classifyRetryReason
mcmire
reviewed
Feb 19, 2026
Contributor
mcmire
left a comment
There was a problem hiding this comment.
One more thing and then we should be good to go!
packages/network-controller/src/create-network-client-tests/classify-retry-reason.test.ts
Outdated
Show resolved
Hide resolved
github-merge-queue bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Feb 19, 2026
…RPC endpoint Segment events (#40176) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Add `rpc_method_name`, `type` and `retry_reason` to the `RPC Service Degraded` Segment events. This lets us identify which JSON-RPC methods produce the most slow requests or retry exhaustions, enabling better debugging of RPC endpoint health issues. Consumes the new `rpcMethodName`, `type` and `retryReason` field added to `NetworkController:rpcEndpointDegraded` events in `@metamask/network-controller` (core PR [#7954](MetaMask/core#7954), [#7988](MetaMask/core#7988)). <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [](https://codespaces.new/MetaMask/metamask-extension/pull/40176?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/WPC-441 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Primarily telemetry/schema changes, but the `@metamask/network-controller` major-version bump plus LavaMoat policy updates could affect runtime behavior or bundling if any dependency allowances are incorrect. > > **Overview** > `NetworkController:rpcEndpointDegraded` handling is updated to consume new event fields and emit richer `RPC Service Degraded` Segment properties: `rpc_method_name`, degradation `type` (e.g. slow success vs retries exhausted), and optional `retry_reason`. > > This bumps `@metamask/network-controller` to `^30.0.0` (with related lockfile updates) and updates LavaMoat policies to reflect the new dependency graph/package nesting; tests are adjusted to assert the new telemetry properties. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1861770. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
github-merge-queue bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Feb 19, 2026
…RPC endpoint Segment events (#40176) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Add `rpc_method_name`, `type` and `retry_reason` to the `RPC Service Degraded` Segment events. This lets us identify which JSON-RPC methods produce the most slow requests or retry exhaustions, enabling better debugging of RPC endpoint health issues. Consumes the new `rpcMethodName`, `type` and `retryReason` field added to `NetworkController:rpcEndpointDegraded` events in `@metamask/network-controller` (core PR [#7954](MetaMask/core#7954), [#7988](MetaMask/core#7988)). <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [](https://codespaces.new/MetaMask/metamask-extension/pull/40176?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/WPC-441 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Primarily telemetry/schema changes, but the `@metamask/network-controller` major-version bump plus LavaMoat policy updates could affect runtime behavior or bundling if any dependency allowances are incorrect. > > **Overview** > `NetworkController:rpcEndpointDegraded` handling is updated to consume new event fields and emit richer `RPC Service Degraded` Segment properties: `rpc_method_name`, degradation `type` (e.g. slow success vs retries exhausted), and optional `retry_reason`. > > This bumps `@metamask/network-controller` to `^30.0.0` (with related lockfile updates) and updates LavaMoat policies to reflect the new dependency graph/package nesting; tests are adjusted to assert the new telemetry properties. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1861770. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
github-merge-queue bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Feb 19, 2026
…RPC endpoint Segment events (#26187) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Add `rpc_method_name`, `type` and `retry_reason` to the `RPC Service Degraded` Segment events. This lets us identify which JSON-RPC methods produce the most slow requests or retry exhaustions, enabling better debugging of RPC endpoint health issues. Consumes the new `rpcMethodName`, `type` and `retryReason` field added to `NetworkController:rpcEndpointDegraded` events in `@metamask/network-controller` (core PR [#7954](MetaMask/core#7954), [#7988](MetaMask/core#7988)). <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/WPC-441 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: changes are limited to analytics payload enrichment and dependency upgrades, with updated unit tests to validate new properties. > > **Overview** > **Enhances `RPC Service Degraded` Segment telemetry** by propagating new fields from `NetworkController:rpcEndpointDegraded` into analytics events: `rpc_method_name`, degraded `type`, and (when applicable) `retry_reason`. > > Updates `onRpcEndpointDegraded`/`trackRpcEndpointEvent` to accept these typed inputs (from `@metamask/network-controller`) and conditionally include them in tracked properties, with corresponding unit test updates. Also bumps `@metamask/network-controller` to `^30.0.0` (and lockfile deps) to consume the new event payload. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a7aacf1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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:
type('slow_success' | 'retries_exhausted') — why degradation happenedretryReason('connection_failed' | 'response_not_json' | 'non_successful_http_status' | 'timed_out' | 'connection_reset' | undefined) — when retries are exhausted, what kind of error was retriedReferences
rpcMethodNametodegradedevents #7954 (rpcMethodNameon degraded events)Checklist
Note
Medium Risk
Changes expand event payload contracts and error classification used in network reliability telemetry; risk is mainly to downstream consumers expecting the old event shape and to misclassification affecting analytics, not core request behavior.
Overview
Degraded RPC events (
NetworkController:rpcEndpointDegradedandNetworkController:rpcEndpointChainDegraded) now include atype('slow_success'vs'retries_exhausted') and an optionalretryReasonthat classifies the final retried error when retries are exhausted.This introduces
DegradedEventType/RetryReasonplus a newclassifyRetryReasonhelper, refactors retryable-error checks inrpc-service.tsinto exported predicates, updates event publishing to populate the new fields, and expands the test suite to validate the new payloads and classification logic (with changelog updates).Written by Cursor Bugbot for commit f75d349. This will update automatically on new commits. Configure here.