Source:
ocean/docs/sentry-v9-features.md| ✏️ Edit on GitHub
Sentry v9 Features Implementation
Overview
We've successfully implemented advanced Sentry monitoring features compatible with v9 SDK, maximizing the free tier capabilities.
Implemented Features
1. Core Error Tracking
- Location:
/src/lib/sentry.tsx - Features:
- Automatic error capture with source maps
- Smart error filtering (browser extensions, network errors, etc.)
- Cost-optimized sampling rates for free tier
- Privacy-focused configuration (no PII)
2. User Flow Performance Monitoring
- Location:
/src/lib/sentry-performance.ts - Implementation:
- UserFlowTracker class using v9's
startInactiveSpanAPI - Pre-configured flows: authentication, billing, onboarding, data export
- React hook
useUserFlowfor easy integration - Currently tracking authentication flow in
/src/routes/login.tsx
- UserFlowTracker class using v9's
3. Cron Monitoring Simulation
- Location:
/src/lib/sentry-crons.ts - Implementation:
- Browser-compatible cron monitoring using performance spans
- Designed for GitHub Actions scheduled workflows
- Includes health check monitoring configuration
4. GraphQL Performance Tracking
- Locations:
/src/hooks/use-graphql-query.ts/src/services/graphql-client.ts
- Features:
- Automatic span creation for all GraphQL operations
- Error tracking with operation context
- Performance monitoring with operation names
5. Stripe Webhook Monitoring
- Location:
/supabase/functions/handle-stripe-webhook/index.ts - Features:
- Performance tracking for each webhook type
- Error capture with Stripe event context
- Customer and subscription tracking
Sampling Configuration (Free Tier Optimized)
// Production sampling rates
tracesSampleRate: 0.1 // 10% - stays under 100K transactions/month
replaysSessionSampleRate: 0.01 // 1% - minimal replay storage
replaysOnErrorSampleRate: 1.0 // 100% - always capture on error
profilesSampleRate: 0.01 // 1% - profiling for critical operations
How to Verify Features
-
Visit Production: https://ocean.goldfish.io
-
Open Browser Console and run:
// Check Sentry is loaded
window.Sentry
// Check version (should be 9.43.0)
window.Sentry.SDK_VERSION -
Test Authentication Flow:
- Go to login page
- Enter email and submit
- Check Sentry Performance tab for
user-flow.authenticationtransaction - Should see steps: enter-email, email-sent, verify-otp, login-success
-
Test Error Tracking:
// Create test error
window.Sentry.captureException(new Error('Test error')) -
Check Sentry Dashboard:
- Errors should appear in Issues tab
- Performance data in Performance tab
- User flows under Transactions
- GraphQL operations tracked separately
Dashboard Configuration
See /docs/sentry-alerts-setup.md for:
- Alert rules configuration
- Issue ownership setup
- Slack integration
- Dashboard customization
Key Benefits
- Cost Efficiency: Optimized sampling keeps within free tier limits
- User Journey Insights: Track complete flows, not just individual actions
- Performance Monitoring: Identify slow operations and bottlenecks
- Smart Error Filtering: Reduce noise from non-actionable errors
- v9 Compatibility: Using latest Sentry APIs for future-proofing
Next Steps
- Monitor actual usage in production to fine-tune sampling rates
- Set up alerts based on the guide in
/docs/sentry-alerts-setup.md - Configure issue ownership for your team
- Add more user flows as features are developed
- Review performance data weekly to identify optimization opportunities
Troubleshooting
If Sentry data isn't appearing:
- Check browser console for errors
- Verify
window.Sentryexists - Check Network tab for Sentry API calls
- Ensure DSN is correctly configured in environment
- Verify custom domains are allowed in Sentry project settings