feat: sentry error monitoring for quick buy and top traders#30409
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|



Description
Adds
feature:socialSentry error instrumentation for Top Traders and Quick Buy, following existing Logger.error` + tags pattern.socialServiceTelemetry.ts:buildSocialLoggerErrorOptions,formatSocialExtraMessage,SOCIAL_SENTRY_FEATUREuseTopTraders,TopTradersView)useQuickBuyQuotes,useQuickBuyBottomSheet)Events are sent via existing
Logger.error> Sentry on release builds (metrics opt-in, DSN). Search in Sentry:feature:social,surface:top_traders,surface:quick_buy.Sentry alert rules (Slack/email on
feature:social) are out of scope for this PR and will be configured separately.Out of scope (follow-up)
feature:aifor digests / market insightsChangelog
CHANGELOG entry: null
Related issues
Resolves: TSA-150
Manual testing steps
yarn jest app/util/social/socialServiceTelemetry.test.tsyarn jestonuseTopTraders.test.ts,TopTradersView.test.tsxLogger.errorno-ops in__DEV__)Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Changes are limited to error logging and test expectations; user flows and API behavior are unchanged aside from Quick Buy failures now going through Logger/Sentry instead of console.
Overview
Standardizes Social failures for Sentry with a shared
feature:socialtagging model insocialServiceTelemetry.ts, aligned with existing Perps-styleLogger.erroroptions.Telemetry helpers: Adds
buildSocialLoggerErrorOptions,reportSocialServiceFailure,useLogSocialQueryError, andformatSocialQueryErrorMessage; renameslegacyMessage→extraMessageinbuildSocialErrorExtras; extends surfaces/endpoints (e.g.trader_profile,follow/unfollow, Quick Buy without a SocialService endpoint).Call-site migration: Social react-query hooks (
useTopTraders,useFollowedTraders,useTraderProfile,useTraderPositions,useTraderPosition) drop per-hookuseEffectlogging in favor ofuseLogSocialQueryError+ structured refresh failures. Quick Buy replacesconsole.errorwithLogger.erroron quote fetch and tx submit (chain tags). Top Traders pull-to-refresh and follow/unfollow use the same structured payload. Tests asserttags/extrasinstead of plain string second arguments.Reviewed by Cursor Bugbot for commit d1fa812. Bugbot is set up for automated code reviews on this repo. Configure here.