otel_provider 0.2.0
otel_provider: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:provider`. A `ChangeNotifier` mixin emitting short spans on every notifyListeners and dispose - works with any ChangeNotifier.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0 - 2026-08-10 #
Changed #
- Example app initializes via
OTel.initializeand exports plain OTLP to any OpenTelemetry-compatible backend. - Added
example/example.mdso a usage example ships with the published package.
0.1.0-beta.1 - 2026-05-16 #
Added #
OTelChangeNotifierMixin—mixin on ChangeNotifierthat emits one short span on everynotifyListeners()(gated byhasListeners) and ondispose(). Each span carriesnotifier.name(the runtime type) andnotifier.event.ValueNotifier<T>integration: classes that mix the OTel mixin in AND overrideotelRecordValues => truealso getnotifier.value(clipped viaotelValueMaxLength) andnotifier.value.typeon eachnotifyspan. Off by default because notifier values often carry user data.ProviderSemantics— typed attribute-key enum implementingOTelSemantic, package-local because OTel has no upstream convention for ChangeNotifier yet.- Tracer is resolved lazily on first emit and cached, so the
mixin can be applied to a class regardless of when
OTel.initialize()runs. - Works with both
package:providerconsumers and any other ChangeNotifier-using code (Flutter foundation provides the notifier mechanism;provideris just the most common consumer). - 5 widget tests cover:
notifyListenerswith a listener emits notify span,notifyListenerswith no listeners short-circuits,disposeemits disposed span,ValueNotifierwithrecordValues: truecaptures clipped value + type,ValueNotifierwithoutrecordValuesrecords neither. - Flutter example app with
ChangeNotifierProvider+ValueNotifier-based message model;flutter run -d chromeand click around to see the notification timeline in any OTLP-compatible trace viewer.