Upgrade to Sentry 9.22, add Web View + OTLP journeys, enable Web & macOS#23
Merged
Merged
Conversation
Brings the Empower Plant Flutter demo to the latest Sentry SDK and broadens platform and feature coverage. Sentry SDK - Bump sentry_flutter/sentry_dio/sentry_file/sentry_logging 9.14.0 -> 9.22.0 - Bump sentry_dart_plugin 3.1.0 -> 3.4.0; app version -> 9.22.0+1 - Set options.tracePropagationTargets (empower-plant.com, flask.empower-plant.com, flask-otlp.empower-plant.com, localhost) Web View journey (Flutter -> web distributed tracing) - New lib/webview/: cross-platform Web View (in-app webview on Android/iOS, dart:ui_web iframe on Flutter web, system browser on desktop) - Opens empower-plant.com/products on its own trace and hands sentry-trace/ baggage to the page via URL query params so the loaded React app's browser SDK continues the same trace (Flutter -> React -> backend = one trace) - WebViewScreen owns + binds its transaction (bindToScope) and finishes it on page load, so the Flutter span reliably joins the trace OTLP backend journey - New "OTLP" drawer item runs the home experience but routes all backend calls (/products, /checkout) to the OpenTelemetry backend flask-otlp.empower-plant.com - Backend selection centralized in lib/backend_config.dart (standard vs OTLP) Web & macOS support - Make the code web-safe: remove dart:io from the shared/web path via conditional-import modules in lib/platform/; use kIsWeb/defaultTargetPlatform instead of Platform.* in shared code - macOS: add com.apple.security.network.client entitlement (sandbox network) Build / tooling - Android Gradle Plugin 8.7.3 -> 8.9.1 (required by androidx libs pulled in by webview_flutter/url_launcher) - demo.sh: add `distribute <android|aab|ios>` (Sentry Build Distribution), source .env robustly (handles inline comments), and omit --base-sha when it equals head-sha - sentry: web_build_path -> web (correct web source map upload path) - Flutter 3.44 migrations (iOS UIScene, builtInKotlin/newDsl, plugin registrants) UX - Cart shows real prices; financial values are masked only in Session Replay - Fix product grid layout on wide web/desktop windows (stable aspect ratio + max-width cap) so products are not pushed far down the page - Custom keyed drawer button so the interaction span reads "ui.action.click - open_navigation_menu" Docs: update README, CLAUDE, BUILD_GUIDE, SENTRY_FEATURES, SIZE_ANALYSIS. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… own name) Clarify in se_config.dart that 'tda' is the committed default and engineers should not push their own identifier. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Brings the Empower Plant Flutter demo up to the latest Sentry SDK (9.22.0) and meaningfully broadens its platform and feature coverage:
distributecommand for Sentry Build Distribution, source-map path fix).All docs (
README,CLAUDE,BUILD_GUIDE,SENTRY_FEATURES,SIZE_ANALYSIS_GUIDE) are updated to match.Sentry SDK upgrade
sentry_flutter/sentry_dio/sentry_file/sentry_logging: 9.14.0 → 9.22.0sentry_dart_plugin: 3.1.0 → 3.4.0version:→ 9.22.0+1 (still matches the SDK version),options.dist = '1'Sentry.metrics/enableMetricsstill compile on 9.22 — no migration needed.options.tracePropagationTargets = ['empower-plant.com', 'flask.empower-plant.com', 'flask-otlp.empower-plant.com', 'localhost'].Web View journey — Flutter → web distributed tracing
New drawer item "Web View" opens the React app (
https://empower-plant.com/products) cross-platform:webview_flutterdart:ui_webiframeurl_launcherIt starts its own transaction (
webview/empower-plant, opnavigation) on a fresh trace, and attaches the activesentry-trace/baggageto the loaded URL as query params so the page's browser SDK can continue the same trace. The screen owns and binds its transaction (bindToScope: true) and finishes it on page load, so the Flutter span reliably lands in the trace.New code:
lib/webview/(web_view_screen.dart,web_view_io.dart,web_view_web.dart,trace_headers.dart). The target URL iskWebViewUrlinweb_view_screen.dart.OTLP backend journey
New drawer item "OTLP" runs the home/shopping experience but routes all backend calls (
/products,/checkout) to the OpenTelemetry backendhttps://flask-otlp.empower-plant.comas its own new trace, so the trace continues into the OTLP-instrumented backend. Backend selection is centralized inlib/backend_config.dart(BackendConfig.base/.products/.checkout).Web & macOS support
dart:iofrom the shared/web path via conditional-import modules inlib/platform/(platform_info.dart,native_info_{io,web}.dart,file_io_demo{,_io,_web}.dart). Shared code now useskIsWeb/defaultTargetPlatforminstead ofPlatform.*.flutter build web/flutter run -d chromework.com.apple.security.network.clienttoDebugProfile.entitlementsandRelease.entitlements(sandboxed apps need it to reach the backend + Sentry).flutter run -d macosworks.Build / tooling
android/settings.gradle.kts(required by the androidx libs thatwebview_flutter/url_launcherpull in; Gradle wrapper 8.12).demo.sh:./demo.sh distribute <android|aab|ios> [file]→ uploads a build to Sentry Build Distribution (sentry-cli build upload).load_envnow sources.env(handles inline comments / special chars) instead of the fragileexport $(grep …).upload_size_analysisomits--base-shawhen it equals head-sha (Sentry rejects equal SHAs).sentry:web_build_path→web(the plugin prepends the build dir, sobuild/webresolved wrongly tobuild/build/web; web source maps now upload).builtInKotlin/newDslgradle flags, plugin registrants for the new plugins).UX fixes
$155.00) — removed the UI_maskPricehelper. Financial values are still masked only in Session Replay via the existingmaskCallback, so real users see real prices while replays stay private.childAspectRatiofrom the window size, which produced enormous tiles on wide web/desktop windows (products pushed far down). Now uses a stable aspect ratio + max-width cap.ui.action.click - open_navigation_menuinstead of the cryptic built-inStandardComponentType.drawerButton.New dependencies
webview_flutter ^4.13.0,url_launcher ^6.3.1,web ^1.1.1.Testing / verification
flutter analyzeclean (only the SDK's intended experimental-API warnings).empower_flutter@9.22.0+1with Dart symbol maps, native debug symbols, and ProGuard mapping uploaded.webview/empower-planttransaction → React/productspageload → flask backend spans.Notes for reviewers
lib/se_config.dartsets the SE tag to the repo defaulttda(SEs should not commit their own name; change locally only if needed).sentry-demos/empower).flask-otlp.empower-plant.combeing available; when it's down you'll see expectedSentryHttpClientError503s (captured bycaptureFailedRequests).🤖 Generated with Claude Code