monoscope_flutter 0.3.1
monoscope_flutter: ^0.3.1 copied to clipboard
Monoscope SDK for Flutter: OpenTelemetry tracing, error and crash reporting, and session replay.
0.3.1 #
- Default endpoint is now
https://otel.monoscopehq.com, a Cloudflare-fronted ingest host: TLS terminates near the device, then traffic rides warm connections to the collector. SetexporterEndpointto keep the old host.
0.3.0 #
Traces are trees now, instead of a pile of single-span roots.
screenspans. A long-lived root span per screen adopts every otherwise parentless span, so one trace covers everything that happened on a screen — the startup, the requests, your own spans, the errors, the navigation away. Previously each of those began its own trace, and the trace list showed a page of one-span traces. This is the counterpart to the browser SDK'spageviewspan. Navigation rolls the trace; so does backgrounding the app, and a 30 minute cap, since a span only exports once it ends.app.startspan covering SDK init to the first rendered frame — the mobile counterpart to the browser SDK's document-load span.frozen_frameandslow_framespans, the counterpart to long-task spans. Frozen frames (>700 ms) are reported by default; slow frames (>16.7 ms) are opt-in viacaptureSlowFrames, because a janky scroll produces hundreds.- A request is no longer traced twice.
MonoscopeClientwrapsIOClient, which builds itsHttpClientthrough the global override, so both layers saw every request and each span'd it — two nested spans per call, doubling every latency figure. The client now claims the request and the override stands down. - Spans carry
screen.idandscreen.route. emitTimedSpanrecords work that is only observable after it finished.
0.2.1 #
Fixes that only showed up when watching a recording of a real app rather than checking event shapes.
- Navigation no longer freezes playback. A route change emitted a bare rrweb
Metaevent to place a timeline marker, but in rrweb a meta event announces a new page: the player resets its node mirror and waits for a full snapshot. Every navigation therefore orphaned the image node, and all later frames were dropped with "node not found" — the replay froze on the last screen before the first navigation. A navigation now forces a paired meta + snapshot, which keeps the marker and re-establishes the document. Tested by an invariant over the event stream: every meta is immediately followed by a full snapshot. - Covered screens are no longer redacted. Flutter keeps routes below the top of the navigator stack mounted, and a page transition leaves them at opacity 0 rather than marking them offstage. Text fields on those screens were still found and painted as black bars over whatever screen the user was actually looking at. Hidden subtrees are now skipped.
- Redaction keeps up with scrolling. Rasterizing is asynchronous, so a fling could advance the layout between locating a text field and the pixels being produced, leaving the bar behind the field. Masks are now the union of the positions before and after the capture, so the field is covered wherever it ended up.
- Redaction rectangles are clipped to the captured area, instead of being clamped during encoding and smeared along the nearest edge.
captureFrameNow()returns the in-flight capture instead of returning early when one is already running, so awaiting it means a capture actually finished.tool/extract_frames.pydecodes a stored session into image files. Event counts cannot tell you whether a replay shows the app; looking at the frames can.
0.2.0 #
Closes the gaps left by the first release.
- Native crash capture. Crashes that kill the process before Dart can react
are recorded by native handlers and reported on the next launch. Android
captures uncaught JVM/Kotlin exceptions; iOS and macOS capture fatal POSIX
signals and uncaught
NSExceptions. Every handler chains to whatever was installed before it, so the OS still writes its own report and the process still dies.crashNativelyForTesting()verifies the path end to end. - Performance metrics. Frame build and raster timings, slow and frozen frame counts, and time to first frame, exported as OTLP/HTTP metrics. This is the mobile counterpart to the browser SDK's Core Web Vitals. Custom histograms and counters can be recorded alongside them.
- App-wide HTTP tracing. Overriding the
dart:ioHttpClientfactory tracespackage:http, Dio and rawdart:iowith no call-site changes, and chains to any override the app already installed.MonoscopeClientremains for Flutter Web and for tracing a single client. Monoscope's own ingest endpoints are excluded, so an upload cannot trigger the export that uploads it. - Exporter diagnostics are surfaced under
debug: true. The OpenTelemetry SDK reports failed exports throughpackage:logging, which prints nothing unless something listens — a rejected batch used to be completely silent. MonoscopeReplaycounts accepted uploads (uploadedBatches,uploadedEvents), so a working pipeline is distinguishable from one quietly re-queueing every batch.- Replay uploads no longer retry across a session rotation, which would have spliced frames from an ended session into a new recording.
0.1.0 #
Initial release.
- OpenTelemetry tracing over OTLP/HTTP, with head-based ratio sampling and
session.id,tab.id,user.*andtenant.*on every span. - Error and crash reporting from
FlutterError.onErrorandPlatformDispatcher.onError, with breadcrumbs, pluscaptureExceptionfor errors the app handles itself. - Session replay: screenshot frames encoded as rrweb events, so recordings play back in Monoscope's existing player. Text fields are redacted by default.
- Session identity with 30-minute inactivity rotation, persisted across restarts.
MonoscopeNavigatorObserverfor route tracking, contributing navigation spans, breadcrumbs and replay timeline markers.MonoscopeClient, anhttp.Clientwrapper that traces requests and propagates W3C trace context to instrumented backends.