Skip to content

Comments

feat: add degradedType and retriedError to degraded events#7988

Merged
cryptodev-2s merged 9 commits intomainfrom
add-degraded-type-to-events
Feb 19, 2026
Merged

feat: add degradedType and retriedError to degraded events#7988
cryptodev-2s merged 9 commits intomainfrom
add-degraded-type-to-events

Conversation

@cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Feb 18, 2026

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 happened
  • retryReason ('connection_failed' | 'response_not_json' | 'non_successful_http_status' | 'timed_out' | 'connection_reset' | undefined) — when retries are exhausted, what kind of error was retried

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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:rpcEndpointDegraded and NetworkController:rpcEndpointChainDegraded) now include a type ('slow_success' vs 'retries_exhausted') and an optional retryReason that classifies the final retried error when retries are exhausted.

This introduces DegradedEventType/RetryReason plus a new classifyRetryReason helper, refactors retryable-error checks in rpc-service.ts into 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.

@cryptodev-2s cryptodev-2s requested review from a team as code owners February 18, 2026 22:17
@cryptodev-2s cryptodev-2s changed the title feat: add degradedType and retriedError to degraded events feat: add degradedType and retriedError to degraded events Feb 18, 2026
@cryptodev-2s cryptodev-2s self-assigned this Feb 18, 2026
@cryptodev-2s cryptodev-2s requested a review from mcmire February 18, 2026 22:17
@cryptodev-2s
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/account-tree-controller": "4.1.1-preview-9848b08",
  "@metamask-previews/accounts-controller": "36.0.0-preview-9848b08",
  "@metamask-previews/address-book-controller": "7.0.1-preview-9848b08",
  "@metamask-previews/ai-controllers": "0.1.0-preview-9848b08",
  "@metamask-previews/analytics-controller": "1.0.0-preview-9848b08",
  "@metamask-previews/analytics-data-regulation-controller": "0.0.0-preview-9848b08",
  "@metamask-previews/announcement-controller": "8.0.0-preview-9848b08",
  "@metamask-previews/app-metadata-controller": "2.0.0-preview-9848b08",
  "@metamask-previews/approval-controller": "8.0.0-preview-9848b08",
  "@metamask-previews/assets-controller": "2.0.0-preview-9848b08",
  "@metamask-previews/assets-controllers": "99.4.0-preview-9848b08",
  "@metamask-previews/base-controller": "9.0.0-preview-9848b08",
  "@metamask-previews/bridge-controller": "67.0.0-preview-9848b08",
  "@metamask-previews/bridge-status-controller": "67.0.0-preview-9848b08",
  "@metamask-previews/build-utils": "3.0.4-preview-9848b08",
  "@metamask-previews/chain-agnostic-permission": "1.4.0-preview-9848b08",
  "@metamask-previews/claims-controller": "0.4.2-preview-9848b08",
  "@metamask-previews/client-controller": "1.0.0-preview-9848b08",
  "@metamask-previews/compliance-controller": "0.0.0-preview-9848b08",
  "@metamask-previews/composable-controller": "12.0.0-preview-9848b08",
  "@metamask-previews/connectivity-controller": "0.1.0-preview-9848b08",
  "@metamask-previews/controller-utils": "11.18.0-preview-9848b08",
  "@metamask-previews/core-backend": "5.1.1-preview-9848b08",
  "@metamask-previews/delegation-controller": "2.0.1-preview-9848b08",
  "@metamask-previews/earn-controller": "11.1.0-preview-9848b08",
  "@metamask-previews/eip-5792-middleware": "2.1.0-preview-9848b08",
  "@metamask-previews/eip-7702-internal-rpc-middleware": "0.1.0-preview-9848b08",
  "@metamask-previews/eip1193-permission-middleware": "1.0.3-preview-9848b08",
  "@metamask-previews/ens-controller": "19.0.2-preview-9848b08",
  "@metamask-previews/error-reporting-service": "3.0.1-preview-9848b08",
  "@metamask-previews/eth-block-tracker": "15.0.1-preview-9848b08",
  "@metamask-previews/eth-json-rpc-middleware": "23.1.0-preview-9848b08",
  "@metamask-previews/eth-json-rpc-provider": "6.0.0-preview-9848b08",
  "@metamask-previews/foundryup": "1.0.1-preview-9848b08",
  "@metamask-previews/gas-fee-controller": "26.0.2-preview-9848b08",
  "@metamask-previews/gator-permissions-controller": "2.0.0-preview-9848b08",
  "@metamask-previews/json-rpc-engine": "10.2.2-preview-9848b08",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.8-preview-9848b08",
  "@metamask-previews/keyring-controller": "25.1.0-preview-9848b08",
  "@metamask-previews/logging-controller": "7.0.1-preview-9848b08",
  "@metamask-previews/message-manager": "14.1.0-preview-9848b08",
  "@metamask-previews/messenger": "0.3.0-preview-9848b08",
  "@metamask-previews/multichain-account-service": "7.0.0-preview-9848b08",
  "@metamask-previews/multichain-api-middleware": "1.2.6-preview-9848b08",
  "@metamask-previews/multichain-network-controller": "3.0.3-preview-9848b08",
  "@metamask-previews/multichain-transactions-controller": "7.0.1-preview-9848b08",
  "@metamask-previews/name-controller": "9.0.0-preview-9848b08",
  "@metamask-previews/network-controller": "29.0.0-preview-9848b08",
  "@metamask-previews/network-enablement-controller": "4.1.1-preview-9848b08",
  "@metamask-previews/notification-services-controller": "22.0.0-preview-9848b08",
  "@metamask-previews/permission-controller": "12.2.0-preview-9848b08",
  "@metamask-previews/permission-log-controller": "5.0.0-preview-9848b08",
  "@metamask-previews/perps-controller": "0.0.0-preview-9848b08",
  "@metamask-previews/phishing-controller": "16.3.0-preview-9848b08",
  "@metamask-previews/polling-controller": "16.0.2-preview-9848b08",
  "@metamask-previews/preferences-controller": "22.1.0-preview-9848b08",
  "@metamask-previews/profile-metrics-controller": "3.0.1-preview-9848b08",
  "@metamask-previews/profile-sync-controller": "27.1.0-preview-9848b08",
  "@metamask-previews/ramps-controller": "8.1.0-preview-9848b08",
  "@metamask-previews/rate-limit-controller": "7.0.0-preview-9848b08",
  "@metamask-previews/remote-feature-flag-controller": "4.0.0-preview-9848b08",
  "@metamask-previews/sample-controllers": "4.0.2-preview-9848b08",
  "@metamask-previews/seedless-onboarding-controller": "8.0.0-preview-9848b08",
  "@metamask-previews/selected-network-controller": "26.0.2-preview-9848b08",
  "@metamask-previews/shield-controller": "5.0.1-preview-9848b08",
  "@metamask-previews/signature-controller": "39.0.3-preview-9848b08",
  "@metamask-previews/storage-service": "1.0.0-preview-9848b08",
  "@metamask-previews/subscription-controller": "6.0.0-preview-9848b08",
  "@metamask-previews/transaction-controller": "62.17.0-preview-9848b08",
  "@metamask-previews/transaction-pay-controller": "15.1.0-preview-9848b08",
  "@metamask-previews/user-operation-controller": "41.0.2-preview-9848b08"
}

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had some suggestions below. I made some comments on lines that I also suggested be moved, so hopefully that isn't too confusing.

…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
@cryptodev-2s cryptodev-2s requested a review from mcmire February 18, 2026 23:34
@cryptodev-2s
Copy link
Contributor Author

@metamaskbot publish-preview

@cryptodev-2s cryptodev-2s force-pushed the add-degraded-type-to-events branch from e3ea422 to 8f4342f Compare February 18, 2026 23:37
@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/account-tree-controller": "4.1.1-preview-f29efd1",
  "@metamask-previews/accounts-controller": "36.0.0-preview-f29efd1",
  "@metamask-previews/address-book-controller": "7.0.1-preview-f29efd1",
  "@metamask-previews/ai-controllers": "0.1.0-preview-f29efd1",
  "@metamask-previews/analytics-controller": "1.0.0-preview-f29efd1",
  "@metamask-previews/analytics-data-regulation-controller": "0.0.0-preview-f29efd1",
  "@metamask-previews/announcement-controller": "8.0.0-preview-f29efd1",
  "@metamask-previews/app-metadata-controller": "2.0.0-preview-f29efd1",
  "@metamask-previews/approval-controller": "8.0.0-preview-f29efd1",
  "@metamask-previews/assets-controller": "2.0.0-preview-f29efd1",
  "@metamask-previews/assets-controllers": "99.4.0-preview-f29efd1",
  "@metamask-previews/base-controller": "9.0.0-preview-f29efd1",
  "@metamask-previews/bridge-controller": "67.0.0-preview-f29efd1",
  "@metamask-previews/bridge-status-controller": "67.0.0-preview-f29efd1",
  "@metamask-previews/build-utils": "3.0.4-preview-f29efd1",
  "@metamask-previews/chain-agnostic-permission": "1.4.0-preview-f29efd1",
  "@metamask-previews/claims-controller": "0.4.2-preview-f29efd1",
  "@metamask-previews/client-controller": "1.0.0-preview-f29efd1",
  "@metamask-previews/compliance-controller": "0.0.0-preview-f29efd1",
  "@metamask-previews/composable-controller": "12.0.0-preview-f29efd1",
  "@metamask-previews/connectivity-controller": "0.1.0-preview-f29efd1",
  "@metamask-previews/controller-utils": "11.18.0-preview-f29efd1",
  "@metamask-previews/core-backend": "5.1.1-preview-f29efd1",
  "@metamask-previews/delegation-controller": "2.0.1-preview-f29efd1",
  "@metamask-previews/earn-controller": "11.1.0-preview-f29efd1",
  "@metamask-previews/eip-5792-middleware": "2.1.0-preview-f29efd1",
  "@metamask-previews/eip-7702-internal-rpc-middleware": "0.1.0-preview-f29efd1",
  "@metamask-previews/eip1193-permission-middleware": "1.0.3-preview-f29efd1",
  "@metamask-previews/ens-controller": "19.0.2-preview-f29efd1",
  "@metamask-previews/error-reporting-service": "3.0.1-preview-f29efd1",
  "@metamask-previews/eth-block-tracker": "15.0.1-preview-f29efd1",
  "@metamask-previews/eth-json-rpc-middleware": "23.1.0-preview-f29efd1",
  "@metamask-previews/eth-json-rpc-provider": "6.0.0-preview-f29efd1",
  "@metamask-previews/foundryup": "1.0.1-preview-f29efd1",
  "@metamask-previews/gas-fee-controller": "26.0.2-preview-f29efd1",
  "@metamask-previews/gator-permissions-controller": "2.0.0-preview-f29efd1",
  "@metamask-previews/json-rpc-engine": "10.2.2-preview-f29efd1",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.8-preview-f29efd1",
  "@metamask-previews/keyring-controller": "25.1.0-preview-f29efd1",
  "@metamask-previews/logging-controller": "7.0.1-preview-f29efd1",
  "@metamask-previews/message-manager": "14.1.0-preview-f29efd1",
  "@metamask-previews/messenger": "0.3.0-preview-f29efd1",
  "@metamask-previews/multichain-account-service": "7.0.0-preview-f29efd1",
  "@metamask-previews/multichain-api-middleware": "1.2.6-preview-f29efd1",
  "@metamask-previews/multichain-network-controller": "3.0.3-preview-f29efd1",
  "@metamask-previews/multichain-transactions-controller": "7.0.1-preview-f29efd1",
  "@metamask-previews/name-controller": "9.0.0-preview-f29efd1",
  "@metamask-previews/network-controller": "29.0.0-preview-f29efd1",
  "@metamask-previews/network-enablement-controller": "4.1.1-preview-f29efd1",
  "@metamask-previews/notification-services-controller": "22.0.0-preview-f29efd1",
  "@metamask-previews/permission-controller": "12.2.0-preview-f29efd1",
  "@metamask-previews/permission-log-controller": "5.0.0-preview-f29efd1",
  "@metamask-previews/perps-controller": "0.0.0-preview-f29efd1",
  "@metamask-previews/phishing-controller": "16.3.0-preview-f29efd1",
  "@metamask-previews/polling-controller": "16.0.2-preview-f29efd1",
  "@metamask-previews/preferences-controller": "22.1.0-preview-f29efd1",
  "@metamask-previews/profile-metrics-controller": "3.0.1-preview-f29efd1",
  "@metamask-previews/profile-sync-controller": "27.1.0-preview-f29efd1",
  "@metamask-previews/ramps-controller": "8.1.0-preview-f29efd1",
  "@metamask-previews/rate-limit-controller": "7.0.0-preview-f29efd1",
  "@metamask-previews/remote-feature-flag-controller": "4.0.0-preview-f29efd1",
  "@metamask-previews/sample-controllers": "4.0.2-preview-f29efd1",
  "@metamask-previews/seedless-onboarding-controller": "8.0.0-preview-f29efd1",
  "@metamask-previews/selected-network-controller": "26.0.2-preview-f29efd1",
  "@metamask-previews/shield-controller": "5.0.1-preview-f29efd1",
  "@metamask-previews/signature-controller": "39.0.3-preview-f29efd1",
  "@metamask-previews/storage-service": "1.0.0-preview-f29efd1",
  "@metamask-previews/subscription-controller": "6.0.0-preview-f29efd1",
  "@metamask-previews/transaction-controller": "62.17.0-preview-f29efd1",
  "@metamask-previews/transaction-pay-controller": "15.1.0-preview-f29efd1",
  "@metamask-previews/user-operation-controller": "41.0.2-preview-f29efd1"
}

@cryptodev-2s
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/account-tree-controller": "4.1.1-preview-1821148",
  "@metamask-previews/accounts-controller": "36.0.0-preview-1821148",
  "@metamask-previews/address-book-controller": "7.0.1-preview-1821148",
  "@metamask-previews/ai-controllers": "0.1.0-preview-1821148",
  "@metamask-previews/analytics-controller": "1.0.0-preview-1821148",
  "@metamask-previews/analytics-data-regulation-controller": "0.0.0-preview-1821148",
  "@metamask-previews/announcement-controller": "8.0.0-preview-1821148",
  "@metamask-previews/app-metadata-controller": "2.0.0-preview-1821148",
  "@metamask-previews/approval-controller": "8.0.0-preview-1821148",
  "@metamask-previews/assets-controller": "2.0.0-preview-1821148",
  "@metamask-previews/assets-controllers": "99.4.0-preview-1821148",
  "@metamask-previews/base-controller": "9.0.0-preview-1821148",
  "@metamask-previews/bridge-controller": "67.0.0-preview-1821148",
  "@metamask-previews/bridge-status-controller": "67.0.0-preview-1821148",
  "@metamask-previews/build-utils": "3.0.4-preview-1821148",
  "@metamask-previews/chain-agnostic-permission": "1.4.0-preview-1821148",
  "@metamask-previews/claims-controller": "0.4.2-preview-1821148",
  "@metamask-previews/client-controller": "1.0.0-preview-1821148",
  "@metamask-previews/compliance-controller": "0.0.0-preview-1821148",
  "@metamask-previews/composable-controller": "12.0.0-preview-1821148",
  "@metamask-previews/connectivity-controller": "0.1.0-preview-1821148",
  "@metamask-previews/controller-utils": "11.18.0-preview-1821148",
  "@metamask-previews/core-backend": "5.1.1-preview-1821148",
  "@metamask-previews/delegation-controller": "2.0.1-preview-1821148",
  "@metamask-previews/earn-controller": "11.1.0-preview-1821148",
  "@metamask-previews/eip-5792-middleware": "2.1.0-preview-1821148",
  "@metamask-previews/eip-7702-internal-rpc-middleware": "0.1.0-preview-1821148",
  "@metamask-previews/eip1193-permission-middleware": "1.0.3-preview-1821148",
  "@metamask-previews/ens-controller": "19.0.2-preview-1821148",
  "@metamask-previews/error-reporting-service": "3.0.1-preview-1821148",
  "@metamask-previews/eth-block-tracker": "15.0.1-preview-1821148",
  "@metamask-previews/eth-json-rpc-middleware": "23.1.0-preview-1821148",
  "@metamask-previews/eth-json-rpc-provider": "6.0.0-preview-1821148",
  "@metamask-previews/foundryup": "1.0.1-preview-1821148",
  "@metamask-previews/gas-fee-controller": "26.0.2-preview-1821148",
  "@metamask-previews/gator-permissions-controller": "2.0.0-preview-1821148",
  "@metamask-previews/json-rpc-engine": "10.2.2-preview-1821148",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.8-preview-1821148",
  "@metamask-previews/keyring-controller": "25.1.0-preview-1821148",
  "@metamask-previews/logging-controller": "7.0.1-preview-1821148",
  "@metamask-previews/message-manager": "14.1.0-preview-1821148",
  "@metamask-previews/messenger": "0.3.0-preview-1821148",
  "@metamask-previews/multichain-account-service": "7.0.0-preview-1821148",
  "@metamask-previews/multichain-api-middleware": "1.2.6-preview-1821148",
  "@metamask-previews/multichain-network-controller": "3.0.3-preview-1821148",
  "@metamask-previews/multichain-transactions-controller": "7.0.1-preview-1821148",
  "@metamask-previews/name-controller": "9.0.0-preview-1821148",
  "@metamask-previews/network-controller": "29.0.0-preview-1821148",
  "@metamask-previews/network-enablement-controller": "4.1.1-preview-1821148",
  "@metamask-previews/notification-services-controller": "22.0.0-preview-1821148",
  "@metamask-previews/permission-controller": "12.2.0-preview-1821148",
  "@metamask-previews/permission-log-controller": "5.0.0-preview-1821148",
  "@metamask-previews/perps-controller": "0.0.0-preview-1821148",
  "@metamask-previews/phishing-controller": "16.3.0-preview-1821148",
  "@metamask-previews/polling-controller": "16.0.2-preview-1821148",
  "@metamask-previews/preferences-controller": "22.1.0-preview-1821148",
  "@metamask-previews/profile-metrics-controller": "3.0.1-preview-1821148",
  "@metamask-previews/profile-sync-controller": "27.1.0-preview-1821148",
  "@metamask-previews/ramps-controller": "8.1.0-preview-1821148",
  "@metamask-previews/rate-limit-controller": "7.0.0-preview-1821148",
  "@metamask-previews/remote-feature-flag-controller": "4.0.0-preview-1821148",
  "@metamask-previews/sample-controllers": "4.0.2-preview-1821148",
  "@metamask-previews/seedless-onboarding-controller": "8.0.0-preview-1821148",
  "@metamask-previews/selected-network-controller": "26.0.2-preview-1821148",
  "@metamask-previews/shield-controller": "5.0.1-preview-1821148",
  "@metamask-previews/signature-controller": "39.0.3-preview-1821148",
  "@metamask-previews/storage-service": "1.0.0-preview-1821148",
  "@metamask-previews/subscription-controller": "6.0.0-preview-1821148",
  "@metamask-previews/transaction-controller": "62.17.0-preview-1821148",
  "@metamask-previews/transaction-pay-controller": "15.1.0-preview-1821148",
  "@metamask-previews/user-operation-controller": "41.0.2-preview-1821148"
}

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better, just had some final suggestions.

@cryptodev-2s cryptodev-2s requested a review from mcmire February 19, 2026 17:11
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing and then we should be good to go!

@cryptodev-2s cryptodev-2s requested a review from mcmire February 19, 2026 17:29
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@cryptodev-2s cryptodev-2s added this pull request to the merge queue Feb 19, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 19, 2026
@cryptodev-2s cryptodev-2s added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit c1e5bf2 Feb 19, 2026
310 checks passed
@cryptodev-2s cryptodev-2s deleted the add-degraded-type-to-events branch February 19, 2026 18:00
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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants