OpenTelemetry Go (often searched as OpenTelemetry Golang) is the official Go implementation, developed in the open-telemetry/opentelemetry-go repository on GitHub. The download button on this site fetches that repository's source as a .zip. Per the official status table, Go traces and metrics are Stable and logs are at Release candidate.
Key takeaways
- Install with go get go.opentelemetry.io/otel and the SDK/exporter modules.
- The GitHub .zip is a main-branch source snapshot — use tagged versions in production.
- Supported Go versions follow Go's two-release support policy.
- Use opentelemetry-go-contrib for net/http, gRPC and other libraries.
Get the Go SDK
For applications, use Go modules:
go get go.opentelemetry.io/otel \
go.opentelemetry.io/otel/sdk \
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpcThe source .zip is useful for reading code, running examples offline or reviewing changes. It is a snapshot of the main branch; for production, depend on tagged module versions.
Supported Go versions
The project follows Go's own support policy: each major Go release is supported until two newer major releases exist. When a new Go version comes out, a release adds support for it, and a later release drops testing for the oldest version. Keep your toolchain current to use the latest SDK.
Setting up a tracer provider
exp, err := otlptracegrpc.New(ctx)
if err != nil { log.Fatal(err) }
tp := sdktrace.NewTracerProvider(
sdktrace.WithBatcher(exp),
sdktrace.WithResource(resource.NewWithAttributes(
semconv.SchemaURL,
semconv.ServiceName("checkout"),
)),
)
defer tp.Shutdown(ctx)
otel.SetTracerProvider(tp)The exporter reads OTEL_EXPORTER_OTLP_ENDPOINT, so the same binary can point at different Collectors per environment.
Creating spans
tracer := otel.Tracer("checkout")
func reserve(ctx context.Context) error {
ctx, span := tracer.Start(ctx, "reserve-stock")
defer span.End()
span.SetAttributes(attribute.Int("items", 3))
return db.Reserve(ctx)
}Always pass ctx down the call chain — that is how child spans find their parent in Go.
Instrumentation libraries
Library instrumentation lives in the opentelemetry-go-contrib repository — for example otelhttp for net/http and otelgrpc for gRPC:
handler := otelhttp.NewHandler(mux, "server")
http.ListenAndServe(":8080", handler)Go is compiled, so there is no classic runtime agent. Zero-code options include an eBPF-based auto-instrumentation project and a compile-time instrumentation effort; check their current maturity before production use.
Using the GitHub source download
The .zip from this site contains the full repository at the moment you download it, including the API, SDK, exporters and an example folder. After extracting:
cd opentelemetry-go-main
go test ./... # run the test suite (needs a supported Go)
cd example/dice && go run .Folder names may change over time; check the README in the archive. Because it tracks the main branch, the code may include unreleased changes — ideal for learning and contributing, less ideal as a production dependency.
Do not forget shutdown
The batch span processor exports in the background. Always call Shutdown on the tracer and meter providers when your program exits, or the last batch of telemetry may be lost — a common cause of "my short-lived CLI produces no traces".
Go signal status
| Signal | Go status |
|---|---|
| Traces | Stable |
| Metrics | Stable |
| Logs | Release candidate |
Frequently asked questions
Where is the OpenTelemetry Go source on GitHub?
At github.com/open-telemetry/opentelemetry-go. Instrumentation libraries are in opentelemetry-go-contrib.
Is the OpenTelemetry Go SDK stable?
Traces and metrics are Stable; logs are at Release candidate per the official status table.
Does OpenTelemetry Go have an agent?
Not a classic runtime agent. There are eBPF-based and compile-time instrumentation projects; check their maturity first.
Get OpenTelemetry from the official source
Free and open source (Apache 2.0) — the Go source .zip downloads straight from GitHub.
Downloads the OpenTelemetry Go source code (.zip, main branch) from the official GitHub repository — you stay on this page.