otel_provider 0.2.0 copy "otel_provider: ^0.2.0" to clipboard
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.initialize and exports plain OTLP to any OpenTelemetry-compatible backend.
  • Added example/example.md so a usage example ships with the published package.

0.1.0-beta.1 - 2026-05-16 #

Added #

  • OTelChangeNotifierMixinmixin on ChangeNotifier that emits one short span on every notifyListeners() (gated by hasListeners) and on dispose(). Each span carries notifier.name (the runtime type) and notifier.event.
  • ValueNotifier<T> integration: classes that mix the OTel mixin in AND override otelRecordValues => true also get notifier.value (clipped via otelValueMaxLength) and notifier.value.type on each notify span. Off by default because notifier values often carry user data.
  • ProviderSemantics — typed attribute-key enum implementing OTelSemantic, 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:provider consumers and any other ChangeNotifier-using code (Flutter foundation provides the notifier mechanism; provider is just the most common consumer).
  • 5 widget tests cover: notifyListeners with a listener emits notify span, notifyListeners with no listeners short-circuits, dispose emits disposed span, ValueNotifier with recordValues: true captures clipped value + type, ValueNotifier without recordValues records neither.
  • Flutter example app with ChangeNotifierProvider + ValueNotifier-based message model; flutter run -d chrome and click around to see the notification timeline in any OTLP-compatible trace viewer.
0
likes
160
points
67
downloads

Documentation

API reference

Publisher

verified publisherdartastic.io

Weekly Downloads

OpenTelemetry instrumentation for `package:provider`. A `ChangeNotifier` mixin emitting short spans on every notifyListeners and dispose - works with any ChangeNotifier.

Homepage
Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

dartastic_opentelemetry, dartastic_opentelemetry_api, flutter

More

Packages that depend on otel_provider