bloc_signals_otel 0.9.0
bloc_signals_otel: ^0.9.0 copied to clipboard
OpenTelemetry tracing instrumentation for BlocSignal.
|
⚡ bloc_signals_otel"With the rigor of BLoC and the flex and speed of Signals"
OpenTelemetry tracing instrumentation for |
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:
⚡ Key Features #
- 📊 Span Correlation: Maps incoming BLoC events directly to active OpenTelemetry trace spans.
- 🚨 Error Tracing: Captures exceptions in
onErrorand 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.