[READY] Improve Sentry Tags#1228
Conversation
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
⚠️ Not ready to approve
There’s a confirmed PII/grouping leak in normalizePath for URLs with query strings and likely type/signature issues in helpers/sentry.ts that can break compilation or event processing.
Pull request overview
This PR improves frontend Sentry signal quality and privacy by adding business-domain tagging, better endpoint grouping for API errors, and centralized filtering/scrubbing via a beforeSend hook. It also adds targeted capture points and a widget-level error boundary to surface and report real failures more consistently.
Changes:
- Add
domaintagging support across API and signing errors (DomainError,SentryDomain), and normalize API paths for better Sentry grouping. - Centralize Sentry filtering/scrubbing in
helpers/sentry.tsand wire it intoSentry.init(ignore/deny lists, query redaction, expected-4xx dropping). - Add Sentry capture at the ramp machine terminal error state and wrap the widget subtree in
Sentry.ErrorBoundary.
File summaries
| File | Description |
|---|---|
| apps/frontend/src/services/api/api-client.ts | Adds domain tagging + path normalization to improve Sentry grouping/privacy for API errors. |
| apps/frontend/src/pages/widget/index.tsx | Wraps widget content in a Sentry error boundary with a translated retry fallback UI. |
| apps/frontend/src/main.tsx | Configures Sentry using shared helpers (beforeSend, ignore/deny lists) and tightens trace propagation targets. |
| apps/frontend/src/machines/ramp.machine.ts | Captures non-user-rejection ramp failures to Sentry at the machine Error state. |
| apps/frontend/src/machines/actors/sign.actor.ts | Makes signing errors domain-tagged as wallet for Sentry. |
| apps/frontend/src/helpers/sentry.ts | New centralized Sentry config: noise filtering, expected-4xx dropping, and URL/query redaction. |
| .agents/skills/sentry-vortex/SKILL.md | Adds a repo skill doc describing Sentry conventions and auditing rules. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 3
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function normalizePath(path: string): string { | ||
| return path | ||
| .replace(/\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(?=\/|$)/g, "/:id") | ||
| .replace(/\/\d+(?=\/|$)/g, "/:id") | ||
| .replace(/\/[A-Za-z0-9]{20,}(?=\/|$)/g, "/:id"); | ||
| } |
| import type { ErrorEvent, EventHint } from "@sentry/react"; | ||
| import { type DomainError, isApiError } from "../services/api/api-client"; |
| export function sentryBeforeSend(event: ErrorEvent, hint: EventHint): ErrorEvent | null { | ||
| const original = hint.originalException; | ||
|
|
…domain tag
- Drop 409 from EXPECTED_CLIENT_STATUSES so genuine ramp money-flow conflicts ("Quote already consumed", "Ramp is not in a state that allows updates") reach Sentry; keep 429 as expected rate-limit noise.
- Strip any query string in getApiDomain before deriving the segment so inlined params can't leak into the domain tag.
No description provided.