otel_mobx 0.2.0
otel_mobx: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:mobx`. Wraps `runInAction` in state-management spans so MobX actions show up in your traces.
otel_mobx #
OpenTelemetry instrumentation for
package:mobx.
import 'package:otel_mobx/otel_mobx.dart';
tracedRunInAction('add_to_cart', () {
cart.add(item);
total.value += item.price;
});
await tracedRunInActionAsync('checkout', () async {
cart.clear();
user.lastPurchase = DateTime.now();
});
Each call opens an INTERNAL span named mobx action <name> with
state.system=mobx, state.operation=action,
state.action.name=<name>. The span captures wall time for the
action body — including any synchronous reactions it triggered.
Suppression: runWithoutMobxInstrumentation and its async
variant.
License #
Apache 2.0