comon_opentelemetry
OpenTelemetry docs for Dart and Flutter with core SDK, Flutter instrumentation, and Dio client spans.
comon_opentelemetry docs
comon_opentelemetry is a Dart workspace built around three packages:
comon_otelfor the core SDKcomon_otel_flutterfor Flutter instrumentationcomon_otel_diofor HTTP client spans with Dio
Package matrix
| Package | Use it for | Typical environment |
|---|---|---|
comon_otel | Traces, metrics, logs, propagation, exporters, testing helpers | Dart backend, CLI, shared libraries |
comon_otel_flutter | Navigation, lifecycle, startup, performance, interactions, error capture | Flutter mobile, desktop, and test apps |
comon_otel_dio | Client spans, trace-context propagation, HTTP attribute capture | Any Dart or Flutter app using Dio |
Architecture
comon_otel
├─ comon_otel_flutter
└─ comon_otel_diocomon_otel is the shared foundation. The Flutter and Dio packages add instrumentation on top of the same tracer, meter, logger, context, and propagator model.
The wider comon ecosystem also exposes companion bridge packages in neighboring workspaces:
- Logger OpenTelemetry for exporting
comon_loggerrecords into the same OTel pipeline - ORM OpenTelemetry for database spans and metrics on top of
comon_orm
What this workspace gives you
- one async bootstrap path through
Otel.init() - traces, metrics, and logs behind one global SDK entrypoint
- W3C trace-context, W3C baggage, B3, and composite propagators
- OTLP exporters over HTTP JSON, HTTP protobuf, and gRPC
- in-memory exporters and helpers for tests
- focused Flutter and Dio integrations instead of one oversized package
Recommended path
- Start with Getting started.
- Read Core to understand traces, metrics, logs, and exporters.
- Add Flutter or Dio depending on your runtime shape.
- Add Logger OpenTelemetry or ORM OpenTelemetry when adjacent
comonpackages should emit into the same backend.
Getting started
Initialize the SDK, emit the first span and metric, and shut down cleanly.
Core
Understand the SDK architecture, propagation, metrics, logs, and exporters.
Flutter
Instrument navigation, lifecycle, startup, performance, interactions, and errors.
Dio
Create HTTP client spans and propagate context into outbound requests.