How open-telemetry/opentelemetry-go works
OpenTelemetry-Go provides APIs and SDKs for capturing traces, metrics, and logs, then exporting that telemetry to observability backends. The main workflow is application instrumentation, SDK processing and resource association, followed by exporter delivery; propagation carries trace context between services. The graph also preserves semantic conventions and compatibility integrations. The README documents the broad workflow and exporter capabilities; source excerpts and the index support only selected internal connections, so other relationships are marked unverified or omitted.
Main entry points: pipeline.go Metric SDK · trace.go Trace API · trace Trace SDK · log Log SDK
Components 21
Telemetry APIs
- Trace API
trace.go - Metric API
metric.go - Log API
log.go
SDK Processing
- Trace SDK
sdk/trace - Metric SDK
sdk/metric/pipeline.go - Log SDK
sdk/log - Resource detection
sdk/resource
Context and Conventions
- Trace propagation
propagation/trace_context.go - Baggage context
baggage/context.go - Semantic conventions
semconv - Attribute types
attribute/value.go
Exporters
- OTLP trace exporters
exporters/otlp/otlptrace - OTLP metric exporters
exporters/otlp/otlpmetric - OTLP log exporters
exporters/otlp/otlplog - Prometheus exporter
exporters/prometheus - Stdout exporters
exporters/stdout - Zipkin exporter
exporters/zipkin
Compatibility Bridges
- OpenCensus bridge
bridge/opencensus - OpenTracing bridge
bridge/opentracing
Other components
- Instrumented application
- Observability platform
Connections 25
- Instrumented application → Trace API: instruments
- Instrumented application → Metric API: instruments
- Instrumented application → Log API: instruments
- Trace API → Trace SDK: configures provider
- Metric API → Metric SDK: configures provider
- Log API → Log SDK: configures provider
- Trace SDK → OTLP trace exporters: exports traces
- Trace SDK → Zipkin exporter: exports traces
- Trace SDK → Stdout exporters: exports traces
- Metric SDK → OTLP metric exporters: exports metrics
- Metric SDK → Prometheus exporter: exports metrics
- Metric SDK → Stdout exporters: exports metrics
- Log SDK → OTLP log exporters: exports logs
- Log SDK → Stdout exporters: exports logs
- OTLP trace exporters → Observability platform: sends traces
- OTLP metric exporters → Observability platform: sends metrics
- OTLP log exporters → Observability platform: sends logs
- Prometheus exporter → Observability platform: exposes metrics
- Zipkin exporter → Observability platform: sends traces
- Metric SDK → Resource detection: uses resource
sdk/metric/pipeline.go - Trace propagation → Trace API: reads context
propagation/trace_context.go - Semantic conventions → Attribute types: builds attributes
semconv/v1.24.0/attribute_group.go - OpenCensus bridge → Trace API: bridges API
- OpenCensus bridge → Metric API: bridges API
- OpenTracing bridge → Trace API: bridges API