levit_monitor is the diagnostics and event export layer for Levit runtimes.
This package is responsible for:
- Capturing structured runtime events from DI and reactive layers.
- Filtering and obfuscating payloads before export.
- Dispatching events through pluggable transports.
- Maintaining optional in-memory shadow state for debugging workflows.
This package does not include:
- Visualization UI or dashboards.
- Business logic instrumentation outside the Levit runtime event model.
Monitoring is opt-in.
Calling LevitMonitor.attach() installs middleware into the runtime.
Event flow:
- Runtime emits DI/reactive events.
- Filter decides whether to forward the event.
- Obfuscator redacts sensitive values.
- Transport(s) deliver encoded events.
dependencies:
levit_monitor: ^latestimport 'package:levit_monitor/levit_monitor.dart';
void main() {
LevitMonitor.attach(
transport: ConsoleTransport(),
filter: (event) => true,
);
}- Opt-in instrumentation with explicit attach/detach lifecycle.
- Transport-agnostic event delivery.
- Privacy-aware output through obfuscation hooks.
- Low-friction integration with existing Levit middleware semantics.