Feature/comprehensive sentry integration#19
Merged
Prithvirajkumar merged 25 commits intomainfrom Feb 24, 2026
Merged
Conversation
This update transforms the Flutter demo into a complete Sentry showcase with automatic error and performance monitoring demonstrations. Key Features: - Upgraded to Sentry SDK 9.10.0 with latest features - 18+ automatic demo triggers on app startup (10 errors, 8 performance issues) - Session Replay, TTID/TTFD tracking, and User Feedback - Size Analysis integration with automated upload scripts - Multi-platform support (Android, iOS, macOS, Web, Linux, Windows) Documentation: - Added 6 comprehensive guides (BUILD_GUIDE, SENTRY_FEATURES, etc.) - Enhanced .env.example with detailed configuration sections - Created verification and upload scripts for CI/CD integration Technical Improvements: - Automatic performance issue detection (DB queries, File I/O, JSON decoding, etc.) - Native crash demonstrations (C++ segfault, Kotlin exceptions) - Platform-specific features (ANR for Android, App Hang for iOS/macOS) - Debug symbol and source map upload automation - Build size monitoring and regression detection Configuration: - Updated pubspec.yaml with sentry_dart_plugin configuration - Enhanced platform-specific build files for symbol upload - Added sentry.properties.example template Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Upgraded sentry_flutter from 9.5.0 to 9.13.0 - Upgraded sentry_dio from 9.5.0 to 9.13.0 - Upgraded sentry_file from 9.5.0 to 9.13.0 - Upgraded sentry_logging from 9.5.0 to 9.13.0 - Updated documentation to reflect SDK version 9.13.0 - Updated ffi dependency from 2.1.5 to 2.2.0 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…dd Spotlight debugging support Simplified TTFD (Time To Full Display) tracking by removing manual transaction management and using SentryDisplayWidget only on the home screen. TTFD is now reported when data fetching completes rather than managing multiple manual spans. Also added Spotlight integration for improved debugging in development mode and network security config for Android. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated upload_size_analysis.sh to align with Sentry's Size Analysis best practices: - Add SENTRY_AUTH_TOKEN validation with helpful error messages - Auto-detect VCS provider and repository name from git remote - Include all recommended metadata fields (base-ref, vcs-provider, head-repo-name, pr-number) - Add build format detection (AAB/APK/XCArchive/IPA) with preference indicators - Display comprehensive metadata summary before upload - Add support for GitHub Actions PR number detection Tested successfully with both AAB and APK uploads to Sentry. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added ~90MB of intentional bloat to demonstrate Sentry's Size Analysis capabilities: **Large Images (45MB):** - 4 oversized PNG/JPEG files (8-15MB each) to trigger Large Images and WebP Optimization insights **Duplicate Files (89MB):** - Identical files copied to multiple locations to trigger Duplicate Files insight **Large Videos (27MB):** - 2 video files (12-15MB) to trigger Large Videos insight **Large Audio (14MB):** - 2 audio files (6-8MB) to trigger Large Audio insight **Unnecessary Files:** - Documentation, scripts, and configs that shouldn't be bundled - Triggers Unnecessary Files insight (iOS) **Small Files:** - 65 tiny files (< 1KB) that waste space due to 4KB filesystem blocks - Triggers Small Files insight (iOS) Build size increased from 45.8MB to 136MB. See SIZE_ANALYSIS_DEMO.md for details. This bloat is intentional for demonstration purposes and should trigger multiple Size Analysis insights in Sentry, showing potential savings of ~170MB. View results: https://sentry.io/organizations/prithvi-0c/projects/flutter/size-analysis/ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implemented automatic customer type tagging with the following distribution: - 40% enterprise - 20% small-plan - 20% medium-plan - 20% large-plan This enables filtering and analysis of events by customer tier in Sentry, demonstrating how tags can be used to segment error data by business dimensions. The customerType tag is automatically applied to all captured events and messages via Sentry.configureScope() after initialization. Includes test script (test_customer_type_distribution.dart) that verifies the distribution across 10,000 iterations. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implemented a promo code input on the checkout page that always fails with an error, demonstrating Sentry's logging capabilities for queryable application logs.
**Features:**
- Promo code input field with Apply button
- Logs info message when user attempts to apply code: "applying promo code 'CODE'..."
- Simulates failed HTTP 410 response (expired coupon)
- Logs error with full details: "failed to apply promo code: HTTP 410 | body: {...}"
- Displays "Unknown error applying promo code" in red text to user
**Logging Integration:**
- Uses Sentry logging integration (already configured via LoggingIntegration)
- Info and error logs are captured and queryable in Sentry
- Includes context like severity, trace, replay_id, user email, etc.
- Follows same pattern as React demo version
**Query in Sentry:**
Logs can be filtered by:
- severity:error or severity:info
- Message contains "promo code"
- Associated with current user session and replay
This demonstrates how application logs (not exceptions) can be captured and analyzed in Sentry for debugging user flows and business logic issues.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Configured Session Replay to mask sensitive financial data on checkout and cart pages: **Masked fields:** - Items count and price - Shipping & handling - Total before tax - Estimated tax to be collected - Order Total - Subtotal (cart page) - All dollar amounts (strings starting with $) **Implementation:** - Uses `maskCallback<Text>()` to selectively mask Text widgets - Checks text content for financial keywords - Returns `SentryMaskingDecision.mask` for matching content - Returns `SentryMaskingDecision.continueProcessing` for other text This ensures customer financial information is not captured in Session Replays while still allowing visibility into user interactions and navigation flows. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Consolidates run.sh, upload_size_analysis.sh, and verify_setup.sh into a single demo.sh script with automatic Sentry release lifecycle management. Features: - Subcommand pattern (build, run, upload-size, verify, help) - Automatic release creation from pubspec.yaml version - Git commit association with releases - Release finalization after successful builds - Deploy tracking when app runs - Integrated size analysis uploads - Comprehensive help and verification Release workflow: 1. Extract version from pubspec.yaml (e.g., 1.0.0+2) 2. Create release: com.example.empower_flutter@1.0.0+2 3. Associate commits using --auto flag 4. Build application with obfuscation 5. Upload debug symbols and source maps 6. Finalize release 7. Create deploy record on app launch Commands: - ./demo.sh build [platform] [build-type] - Build with release - ./demo.sh run [platform] - Run and create deploy - ./demo.sh upload-size [file] [platform] - Size analysis - ./demo.sh verify - Validate setup - ./demo.sh help - Show documentation Platforms: android, aab, ios, web, macos, linux, windows Build types: debug, profile, release (default) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Removes: - run.sh (replaced by demo.sh build/run) - upload_size_analysis.sh (replaced by demo.sh upload-size) - verify_setup.sh (replaced by demo.sh verify) These scripts have been consolidated into the unified demo.sh with automatic release management and improved command structure. Documentation updates: - README.md: Updated build and run instructions - BUILD_GUIDE.md: Replaced all run.sh references with demo.sh - SIZE_ANALYSIS_GUIDE.md: Updated upload commands - SENTRY_FEATURES.md: Updated script references and file links Migration guide available in MIGRATION_TO_UNIFIED_SCRIPT.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updates version from 1.0.0+2 to 9.13.0+1 to align numerically with the sentry-dart SDK version (9.13.0) being used in this project. Version format follows Sentry convention: package@version+build - Version 9.13.0 matches sentry-dart SDK release - Build number +1 starts fresh with new versioning scheme Updated files: - pubspec.yaml: version field - .env: SENTRY_RELEASE - .env.example: SENTRY_RELEASE example - lib/sentry_setup.dart: dist and comments - assets/docs/build_config.json: version and build_number - UNIFIED_SCRIPT.md: all example release names - MIGRATION_TO_UNIFIED_SCRIPT.md: all example release names - BUILD_GUIDE.md: SENTRY_RELEASE example Release name: com.example.empower_flutter@9.13.0+1 Sentry docs: https://docs.sentry.io/platforms/product/releases/ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Maximizes telemetry sent to Sentry by enabling all logging and metrics features. Changes to sentry_setup.dart: - Explicitly enable metrics: options.enableMetrics = true - Enable sendDefaultPii for user attributes in logs/metrics - Added detailed comments for metrics configuration Changes to checkout.dart: - Added Sentry.metrics tracking: * promo_code_attempts (count) - tracks promo code usage * promo_code_failures (count) - tracks promo failures * checkout_attempts (count) - tracks checkout starts * checkout_failures (count) - tracks failed checkouts * checkout_success (count) - tracks successful checkouts * checkout_exceptions (count) - tracks caught exceptions * checkout_api_latency (distribution) - tracks API response time * order_value (gauge) - tracks order amounts - Enhanced logging with Sentry.logger APIs: * Used Sentry.logger.fmt for formatted logs with placeholders * Added structured attributes to all log entries for searchability * Logs include: promo_code, http_status, error_code, num_items, subtotal, latency_ms * Kept legacy Logger() calls for backwards compatibility Benefits: - All logs are now searchable by custom attributes in Sentry - Metrics provide real-time visibility into app behavior - User attributes automatically added to logs/metrics (user.id, user.email) - API latency tracking for performance monitoring - Business metrics (order value, success rates) visible in Sentry Sentry Features Used: - Structured Logs (SDK 9.0.0+) - Metrics (SDK 9.11.0+) - Log Attributes for filtering/grouping - Metric Attributes for segmentation - Distribution metrics for latency tracking - Count metrics for event tracking - Gauge metrics for current values Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Integrates ProGuard mapping upload into the build process to enable detailed DEX file breakdown in Sentry Size Analysis. Changes: - Added ProGuard mapping upload after debug symbols upload - Uses sentry-cli upload-proguard command - Automatically detects mapping.txt in build/app/outputs/mapping/release/ - Displays mapping file size in output - Only uploads if mapping file exists (Android builds) Fixes the "Missing proguard mapping. Dex will not have a detailed breakdown" warning in Sentry Size Analysis dashboard. Benefits: - Enables class-level size breakdown in Sentry - Shows which classes/methods contribute to APK/AAB size - Helps identify optimization opportunities - Automatic with every release build File uploaded: build/app/outputs/mapping/release/mapping.txt (8.0M) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Makes size analysis opt-in by default in the example configuration. Added clear documentation explaining: - What it does (automatic size analysis uploads) - When it runs (release builds only) - Requirements (sentry-cli) - How to disable (set to false or comment out) This helps new users understand they need to enable this feature and install sentry-cli for size analysis to work. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit streamlines the demo repository for solution engineers: Documentation improvements: - Rewrite README.md focused on Android (tested platform only) - Add comprehensive CLAUDE.md with full project context - Remove redundant documentation files (6 files) - Clear "iOS/other platforms untested" warnings Configuration simplification: - Remove hardcoded org/project from pubspec.yaml - Now reads from environment variables (SENTRY_ORG, SENTRY_PROJECT) - Single source of truth: .env file only - Delete sentry.properties (redundant, outdated) Session replay privacy fix: - Fix overly broad masking (was masking ALL dollar amounts) - Now only masks financial labels with dollar values - Labels without values remain visible - Better user experience in session replays Other cleanups: - Remove test_customer_type_distribution.dart (dev utility) - Remove sentry.properties.example (no longer needed) - Update se_config.dart to placeholder value for new users Result: Solution engineers only need to configure .env file once. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Session Replay: - Remove all privacy masking - everything now visible in replays - Add commented example for future masking if needed Size Analysis: - Upload ProGuard mapping BEFORE size analysis upload - Ensures detailed DEX breakdown in Sentry UI - Create reusable upload_proguard_mapping() function - Call before uploading APK/AAB for size analysis This fixes "Missing proguard mapping. Dex will not have a detailed breakdown" warning. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The SDK has built-in masking enabled by default: - maskAllText = true (default) - maskAllImages = true (default) This change explicitly disables them: - maskAllText = false - maskAllImages = false This ensures everything is visible in session replays for demo purposes. Previously removed maskCallback but forgot to disable default masking. WARNING: Only for demo environments without sensitive data. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Changed se_config.dart default to 'tda' instead of 'your-name' - Modified demo.sh to only upload AAB (not APK) for size analysis - Changed promo code validation logging from error to info level to prevent Sentry error events for expected behavior Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SDK changes in 9.14.0: - enableTombstone option for Android 12+ native crash reporting - Fix: User attributes no longer guarded behind sendDefaultPii for logs/metrics - Android SDK upgraded from 8.32.0 to 8.33.0 - Native SDK upgraded from 0.12.6 to 0.12.8 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When se is anything other than the default ('tda'), getRandomEmail()
returns se@example.com so events are easily attributable in Sentry.
Falls back to timestamped address for the default 'tda' identifier.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Divides the day into 10 equal 144-minute windows. Within each window a deterministic seed (day + window index) decides whether to return the recurring email or a unique timestamped one, giving ~10 appearances of john.logs@example.com per day without any persisted state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t.dart SentryLogAttribute was deprecated in sentry-dart 9.14.0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.