bloc_signals_otel 0.9.0 copy "bloc_signals_otel: ^0.9.0" to clipboard
bloc_signals_otel: ^0.9.0 copied to clipboard

OpenTelemetry tracing instrumentation for BlocSignal.

bloc_signals_otel

⚡ bloc_signals_otel

"With the rigor of BLoC and the flex and speed of Signals"

OpenTelemetry tracing instrumentation for BlocSignal state containers.

This package provides OtelBlocSignalObserver, a custom BlocSignalObserver that maps BLoC events, state transitions, and exception tracebacks into OpenTelemetry spans for end-to-end distributed tracing.


🌐 Ecosystem Packages #

The BlocSignal monorepo consists of 10 modular packages:

Package Version Description
bloc_signals pub Core pure Dart reactive state primitives bridging BLoC & Signals
bloc_signals_flutter pub Flutter UI bindings, providers, builders, listeners & selectors
bloc_signals_jaspr pub Jaspr web component integration and state binding for BlocSignal
bloc_signals_riverpod pub Bidirectional Riverpod 2/3 interop adapters & provider extensions
bloc_signals_hydrate pub Automated synchronous local state persistence & hydration
bloc_signals_replay pub Undo & redo state history tracking for CubitSignal and BlocSignal
bloc_signals_otel pub OpenTelemetry tracing and span generation for state transitions
bloc_signals_devtools pub Universal DevTools telemetry observer using dart:developer
bloc_signals_test pub Declarative unit testing utilities (blocSignalTest)
bloc_signals_lint pub Custom analyzer lint rules & automated IDE quick-fixes

⚡ Key Features #

  • 📊 Span Correlation: Maps incoming BLoC events directly to active OpenTelemetry trace spans.
  • 🚨 Error Tracing: Captures exceptions in onError and attaches identity hash-matched stack traces to the active span.
  • 🛡️ Memory-Leak Protection: Internal active span map capped at 1,000 items with LRU eviction to prevent heap leaks.

🚀 Getting Started #

Add bloc_signals_otel to your pubspec.yaml:

dependencies:
  bloc_signals: ^0.2.6
  bloc_signals_otel: ^0.2.3
  opentelemetry: ^0.1.0

💡 Quick Example #

import 'package:bloc_signals/bloc_signals.dart';
import 'package:bloc_signals_otel/bloc_signals_otel.dart';
import 'package:opentelemetry/api.dart' as otel;

void main() {
  final tracer = otel.globalTracerProvider.getTracer('my_app');

  // Register OpenTelemetry observer globally
  BlocSignalObserver.observer = OtelBlocSignalObserver(tracer: tracer);

  final bloc = CounterBloc();
  bloc.add(Increment()); // Automatically generates OpenTelemetry spans!
}

🤖 AI Coding Assistant Skill #

This package is supported by an official pre-packaged AI Coding Skill representing OpenTelemetry span correlation, error traceback matching, and tracing observer guidelines for BlocSignal.

If you develop with AI coding assistants (such as Claude Code, Antigravity, Gemini, Cursor, or Codex), you can load the bloc-signals skill bundle to guide your assistant's code generation and analysis.


📜 License #

MIT License. See LICENSE for details.

0
likes
160
points
209
downloads

Documentation

API reference

Publisher

verified publisherstonehenge.com

Weekly Downloads

OpenTelemetry tracing instrumentation for BlocSignal.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

bloc_signals, meta, opentelemetry

More

Packages that depend on bloc_signals_otel