Observability Lab
Every button runs an intent through a droppable dispatcher while several observers watch at the same time: JMetrics, a custom observer that fills the event log, and the debug overlay.
Loading the demo…
Try it
Section titled “Try it”- Press Succeed and watch the counters and the event log. The log shows the intent starting and finishing, and the state change attributed to that intent.
- Press Fail. The intent throws, and the failure is observed through
onIntentFailed. - Press Cancel. The intent cancels itself and is reported as cancelled instead of dispatched.
- Press Drop one. It fires two intents back to back; the droppable dispatcher discards the second and
onIntentDroppedfires. - Open the debug overlay (bottom-right button) to see the same events inside the app.
Registering an observer
Section titled “Registering an observer”class AnalyticsObserver extends JObserverDelegate { @override void onIntentFailed(JIntent intent, Object error, StackTrace stackTrace) { report(intent.runtimeType, error, stackTrace); }}
final remove = JObserver.addObserver(AnalyticsObserver());Observers compose, and one that throws never affects the code it observes. See the observability guide for metrics, correlation and extension points.