go-sdk
OpenTelemetry Go
Mechanics reference for the OpenTelemetry Go API, SDK, and instrumentation libraries.
Current Versions
| Component | Version | Notes |
|---|---|---|
SDK (go.opentelemetry.io/otel) |
v1.42.0 | Requires Go 1.25+ |
Contrib (go.opentelemetry.io/contrib) |
v1.42.0 | Matches SDK version |
| Semconv package | go.opentelemetry.io/otel/semconv/v1.40.0 |
Latest available |
Gotchas and Breaking Changes
span.RecordError()andspan.AddEvent()are deprecated. Use the Logs API to emit events and record exceptions within the context of the active span.go.opentelemetry.io/contrib/configis deprecated (contrib v1.35.0). Usego.opentelemetry.io/contrib/otelconf/v0.3.0instead. The API is identical.- Current SDK version: v1.42.0 (requires Go 1.25+). Current semconv package:
go.opentelemetry.io/otel/semconv/v1.40.0. - otelhttp removed
DefaultClient,Get,Head,Post,PostForm,WithPublicEndpoint,WithRouteTagin contrib v1.40.0. Always create a custom client withotelhttp.NewTransport. - RPC semantic convention renames in contrib v1.40.0+:
rpc.system->rpc.system.name;rpc.method+rpc.servicemerged intorpc.method;rpc.client.duration/rpc.server.duration->rpc.client.call.duration/rpc.server.call.duration(unit changed to seconds);rpc.grpc.status_code->rpc.response.status_code.
More from ollygarden/opentelemetry-agent-skills
sdk-setup
OpenTelemetry SDK initialization and configuration. Use when setting up or reviewing TracerProvider, MeterProvider, or LoggerProvider; choosing exporters, processors, or propagators; configuring OTLP transport; or extending an existing SDK setup for new signals. Use this skill whenever the task involves wiring up the OpenTelemetry SDK, even if the user only mentions "add tracing" or "set up metrics" without saying "SDK.
8telemetrygen
Construct telemetrygen commands for generating synthetic OpenTelemetry traces, metrics, and logs via OTLP. Use this skill whenever the user wants to generate test telemetry, load test a collector or backend, create synthetic OTLP data, send sample traces/metrics/logs to an endpoint, test collector pipelines or processors, validate OTTL transforms, test tail sampling, or mentions telemetrygen in any context. Also trigger when the user asks how to simulate telemetry traffic, stress test an observability stack, or produce sample data for dashboards.
8sdk-versions
OpenTelemetry SDK and package version lookup across languages. Use when choosing the latest compatible released OpenTelemetry SDK or package version and locating setup docs or examples.
8semantic-conventions
OpenTelemetry semantic convention lookup and naming guidance. Use when selecting released semantic convention groups, attributes, or span naming rules, or when checking semantic convention compliance.
8manual-instrumentation
OpenTelemetry best practices for manual instrumentation. Use when adding, changing, or reviewing OpenTelemetry instrumentation in code. Guidance to choose runtime boundaries, choose signals, apply semantic conventions, handle propagation, control cardinality, and verify the result.
8span-events-to-logs-migration
Migrate OpenTelemetry Span Events (AddEvent, RecordException) to the Logs API following the OTEP 4430 deprecation plan. Use when migrating instrumentation from span events to log-based events, reviewing code that still uses AddEvent or RecordException, or planning a migration across a codebase.
8