Stage 3 · Build
Observability & Networking
OpenTelemetry Go
Tracing, metrics, logs — the OTel SDK and auto-instrumentation for Go services.
OpenTelemetry Overview
OpenTelemetry is the standard for observability instrumentation. It provides unified APIs for traces, metrics, and logs. The Go SDK lets you instrument your service once and export to any backend — Jaeger, Prometheus, Datadog, or Grafana.
Distributed Tracing
Traces follow requests across service boundaries. A trace consists of spans, each representing a unit of work. Spans capture timing, status, and context.
OTel Metrics
OTel metrics provide a unified API for counters, gauges, and histograms. The API is similar to Prometheus but with the OTel SDK's resource and instrumentation scope management.
Context Propagation
Context propagation passes trace context across service boundaries via HTTP headers. This connects spans into a distributed trace. OTel handles this automatically for HTTP clients and servers.
Auto-Instrumentation
The OTel Go contrib packages auto-instrument common libraries: net/http, gRPC, database/sql, and more. Wrap your clients and handlers to get instrumentation without changing code.
OTel Exporters
Exporters send telemetry data to backends. OTel supports multiple backends through the exporter interface. Choose based on your observability stack.
The OTel Collector receives telemetry via OTLP and routes it to multiple backends. It handles batching, retrying, and sampling. Deploy it as a sidecar or DaemonSet for efficient telemetry routing.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.