Core
Understand the OpenTelemetry SDK architecture in comon_otel and how the main signal pipelines fit together.
Core
comon_otel exposes one public SDK entrypoint:
import 'package:comon_otel/comon_otel.dart';Main building blocks
| Piece | Responsibility |
|---|---|
Otel | Global gateway for initialization, access, flush, and shutdown |
TracerProvider / Tracer | Trace creation and span lifecycle |
MeterProvider / Meter | Metric instrument creation and readers |
LoggerProvider / OtelLogger | Structured logs and log processors |
OtelContext | Zone-based active span and baggage propagation |
TextMapPropagator | Header or carrier injection and extraction |
| Exporters and processors | Delivery to console, OTLP, or in-memory sinks |
Global model
After await Otel.init(...), the SDK exposes:
Otel.instance.tracerOtel.instance.meterOtel.instance.logger
Use these convenience getters when one app-wide SDK instance is enough.
What the core package covers already
- traces
- metrics
- logs
- W3C and B3 propagation
- OTLP export
- in-memory testing helpers
- some environment-driven bootstrap via
OTEL_*