cocomon

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

PieceResponsibility
OtelGlobal gateway for initialization, access, flush, and shutdown
TracerProvider / TracerTrace creation and span lifecycle
MeterProvider / MeterMetric instrument creation and readers
LoggerProvider / OtelLoggerStructured logs and log processors
OtelContextZone-based active span and baggage propagation
TextMapPropagatorHeader or carrier injection and extraction
Exporters and processorsDelivery to console, OTLP, or in-memory sinks

Global model

After await Otel.init(...), the SDK exposes:

  • Otel.instance.tracer
  • Otel.instance.meter
  • Otel.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_*

On this page