otel_flutter_command 0.1.0-beta.1
otel_flutter_command: ^0.1.0-beta.1 copied to clipboard
OpenTelemetry instrumentation for package:flutter_command. Wraps every Command execution in a CLIENT-kind span so you can see how long each UI-triggered action takes and which ones fail.
Changelog #
0.1.0-beta.1 - 2026-05-14 #
Added #
Command.executeTraced(param, spanName)— sync executor wrapped in a CLIENT-kind span.Command.executeTracedWithFuture(param, spanName)— async executor wrapped in a span; awaits the future before closing.- Span shape:
flutter_command <name>withcommand.name,command.system=flutter_command,command.result=success/error. Errors geterror.type+recordException+Errorstatus, then rethrow. - Local
FlutterCommandSemanticsenum (implementsOTelSemantic). - Zone-scoped suppression via
runWithoutFlutterCommandInstrumentation()/Async(). - Six
flutter_testtests using the canonical_helpers/otel_test_harness.dart.
Design notes #
- We instrument at the call site (extension methods on
Command) rather than via the package's globalloggingHandler/globalExceptionHandlerhooks. The global hooks fire only at the end of execution, so they can't measure duration; and the per-commandresultsValueListenablefilters no-op updates by==, which means a sync command whose result equals its initial value emits no event at all. Per-call instrumentation sidesteps both issues.