{"slug":"otel-go","title":"otel-go","summary":"OpenTelemetry in Go — SDK setup, API surface, breaking changes, contrib instrumentation libraries (otelhttp, otelgrpc, otelmongo), compile-time zero-code instrumentation (otelc), and performance tuning. Use when adding, reviewing, or configuring OpenTelemetry in a Go service. Tri","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-16T16:29:05.77277Z","repo":{"url":"https://github.com/ollygarden/opentelemetry-agent-skills","stars":111,"forks":13,"license":"Apache-2.0","updatedAt":"2026-10-16T08:07:28Z"},"bodyHtml":"<hr>\n<h2>name: otel-go\ndescription: OpenTelemetry in Go — SDK setup, API surface, breaking changes, contrib instrumentation libraries (otelhttp, otelgrpc, otelmongo), compile-time zero-code instrumentation (otelc), and performance tuning. Use when adding, reviewing, or configuring OpenTelemetry in a Go service. Triggers on \"setup otel in go\", \"go telemetry\", \"go tracing\", \"otelconf go\", \"otelhttp\", \"otelgrpc\", \"TracerProvider go\", \"MeterProvider go\", \"otelc\", \"compile-time instrumentation go\", \"zero-code go instrumentation\", \"go build instrumentation\", or any Go-related OTel question.</h2>\n<h1>OpenTelemetry in Go</h1>\n<p>Entry point for OpenTelemetry mechanics in Go services. Load a reference below based on the\ntask; each reference is self-contained.</p>\n<h2>References</h2>\n<table>\n<thead>\n<tr>\n<th>File</th>\n<th>Use when</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href=\"references/declarative-setup.md\"><code>references/declarative-setup.md</code></a></td>\n<td>Configuring the SDK via <code>otelconf</code> and YAML: providers, propagators, shutdown, env-var substitution.</td>\n</tr>\n<tr>\n<td><a href=\"references/api.md\"><code>references/api.md</code></a></td>\n<td>Looking up import paths, global API access, tracer/meter/logger usage, attributes, propagation, log bridges (zap, slog).</td>\n</tr>\n<tr>\n<td><a href=\"references/instrumentation-libraries.md\"><code>references/instrumentation-libraries.md</code></a></td>\n<td>Picking or wiring contrib libraries (otelhttp, otelgrpc, database, AWS, message queues, propagators, resource detectors), and writing manual instrumentation that follows semconv.</td>\n</tr>\n<tr>\n<td><a href=\"references/performance.md\"><code>references/performance.md</code></a></td>\n<td>Tuning sampling, batch processor, metric reader, exporter compression/retry, attribute allocation, log <code>Enabled()</code> short-circuiting, graceful shutdown.</td>\n</tr>\n<tr>\n<td><a href=\"references/breaking-changes.md\"><code>references/breaking-changes.md</code></a></td>\n<td>Auditing existing code for deprecated calls, renamed semantic conventions, and removed APIs across recent SDK / contrib releases.</td>\n</tr>\n<tr>\n<td><a href=\"references/compile-time-instrumentation.md\"><code>references/compile-time-instrumentation.md</code></a></td>\n<td>Zero-code, compile-time instrumentation with <code>otelc</code>: usage modes (<code>otelc go build</code>, tool dependency, toolexec drop-in), subcommands, supported libraries, rule sources/precedence, and pinning via <code>otel.instrumentation.go</code>.</td>\n</tr>\n</tbody>\n</table>\n<p>For upgrade reviews, always finish with a safe local verification path (<code>go mod tidy -diff</code>,\n<code>go build ./...</code>, and <code>go test ./...</code>). Test exporter URL or retry changes against a disposable\nlocal receiver, never a deployment endpoint.</p>\n<h2>Module versioning — read before adding dependencies</h2>\n<p>opentelemetry-go is split into <strong>independently versioned module groups</strong>. They do NOT\nshare one version number. Assuming they do is the most common cause of broken builds\nand version churn:</p>\n<table>\n<thead>\n<tr>\n<th>Module group</th>\n<th>Example modules</th>\n<th>Version line</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Stable (traces, metrics, logs API/SDK)</td>\n<td><code>go.opentelemetry.io/otel</code>, <code>otel/sdk</code>, <code>otel/trace</code>, <code>otel/metric</code>, <code>otel/log</code>, <code>otel/sdk/log</code>, OTLP trace/metric exporters</td>\n<td><strong>v1.x</strong> (e.g. v1.47.0; logs API/SDK joined at v1.47.0)</td>\n</tr>\n<tr>\n<td>Log exporters and test helpers</td>\n<td><code>otel/exporters/otlp/otlplog/otlploghttp</code>, <code>.../otlploggrpc</code>, <code>otel/exporters/stdout/stdoutlog</code>, <code>otel/log/logtest</code>, <code>otel/sdk/log/logtest</code></td>\n<td><strong>v0.x</strong> (separate, lower line, e.g. v0.23.0)</td>\n</tr>\n<tr>\n<td>Contrib instrumentation</td>\n<td><code>contrib/instrumentation/net/http/otelhttp</code>, <code>.../otelgrpc</code></td>\n<td><strong>v0.x</strong> (separate line, e.g. v0.72.0)</td>\n</tr>\n<tr>\n<td>Contrib log bridges</td>\n<td><code>contrib/bridges/otelslog</code>, <code>otelzap</code>, <code>otellogrus</code>, <code>otellogr</code></td>\n<td><strong>v0.x</strong></td>\n</tr>\n</tbody>\n</table>\n<p><strong>The trap:</strong> pinning every module to the core version (e.g. <code>go get go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp@v1.47.0</code>)\nfails — log exporter, log test-helper, and bridge modules have no v1.x tag. Hand-picking and re-guessing each <code>@vX</code>\nis the churn to avoid.</p>\n<p><strong>Do this instead</strong> — add each module with <code>@latest</code> and let Go resolve a compatible set:</p>\n<pre><code>go get go.opentelemetry.io/otel@latest go.opentelemetry.io/otel/sdk@latest\n# logs (API/SDK are v1.x; log exporters stay on a v0.x line — do NOT force the core version):\ngo get go.opentelemetry.io/otel/log@latest go.opentelemetry.io/otel/sdk/log@latest \\\n       go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp@latest\n# contrib (instrumentation and bridges each resolve to their own v0.x line):\ngo get go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@latest \\\n       go.opentelemetry.io/contrib/bridges/otelslog@latest\ngo mod tidy &amp;&amp; go build ./...\n</code></pre>\n<p>If exact versions are required, fetch each module group's tag from its own source\n(see below) — never infer one group's version from another's.</p>\n<h2>Sources of Truth</h2>\n<p>For YAML schema details, fetch the upstream sources listed in the <code>otel-declarative-config</code> skill.\nFor Go-specific facts:</p>\n<table>\n<thead>\n<tr>\n<th>Fact</th>\n<th>Fetch</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Latest <code>go.opentelemetry.io/otel</code> core release</td>\n<td><code>gh api repos/open-telemetry/opentelemetry-go/releases/latest -q '.tag_name'</code></td>\n</tr>\n<tr>\n<td>Latest <code>go.opentelemetry.io/contrib</code> release</td>\n<td><code>gh api repos/open-telemetry/opentelemetry-go-contrib/releases/latest -q '.tag_name'</code></td>\n</tr>\n<tr>\n<td>Latest <code>otelconf</code> module tag</td>\n<td>the version-sorted tag command below the table</td>\n</tr>\n<tr>\n<td>Latest Go semconv package</td>\n<td>Search the selected core release's CHANGELOG for <code>Add the go.opentelemetry.io/otel/semconv/</code>; do not infer package availability from the upstream semantic-conventions release. Offline: <code>semconv/v1.43.0</code> in otel v1.47.0, verified 2026-10-15 (record: the <code>otel-semantic-conventions</code> skill's <code>references/sdk-semconv-packages.md</code>).</td>\n</tr>\n<tr>\n<td><code>otel-go</code> CHANGELOG</td>\n<td><code>WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-go/main/CHANGELOG.md</code></td>\n</tr>\n<tr>\n<td><code>otel-go-contrib</code> CHANGELOG</td>\n<td><code>WebFetch https://raw.githubusercontent.com/open-telemetry/opentelemetry-go-contrib/main/CHANGELOG.md</code></td>\n</tr>\n</tbody>\n</table>\n<pre><code>gh api repos/open-telemetry/opentelemetry-go-contrib/git/matching-refs/tags/otelconf -q '.[].ref' | sort -V | tail -1\n</code></pre>\n<h2>Cross-References</h2>\n<ul>\n<li>Schema-level facts: <code>otel-declarative-config</code> skill (language-agnostic YAML schema sources).</li>\n<li>SDK version selection across languages: <code>otel-sdk-versions</code> skill.</li>\n<li>Semantic conventions lookup: <code>otel-semantic-conventions</code> skill.</li>\n</ul>\n","files":[{"path":"evals/evals.json","sizeBytes":1333,"isText":true},{"path":"evals/files/go-v145-upgrade.md","sizeBytes":856,"isText":true},{"path":"evals/results.md","sizeBytes":2991,"isText":true},{"path":"references/api.md","sizeBytes":10471,"isText":true},{"path":"references/breaking-changes.md","sizeBytes":9406,"isText":true},{"path":"references/compile-time-instrumentation.md","sizeBytes":10449,"isText":true},{"path":"references/declarative-setup.md","sizeBytes":4584,"isText":true},{"path":"references/instrumentation-libraries.md","sizeBytes":15540,"isText":true},{"path":"references/performance.md","sizeBytes":18672,"isText":true},{"path":"SKILL.md","sizeBytes":6012,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-16T16:32:57.389288Z","sha256":"D1F643D879F69F9CC66CC6233F7F05D38EBECAD2D9C82382AB4DE763525BD797","sizeBytes":31530},"review":null,"source":{"repositoryUrl":"https://github.com/ollygarden/opentelemetry-agent-skills","path":"skills/otel-go","license":"Apache-2.0","commit":"967179521de5e8dac365ae6fbc4fc64f427259f5","subtreeSha":"BF2337A3C5AB03945E2FEE4DF6A098193E1EBE78FB4100617AE5A567E6486133","lastSyncedAt":"2026-10-16T16:29:03.891055Z"},"reviewedAt":"2026-10-16T16:40:43.357404Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/ollygarden/opentelemetry-agent-skills/tree/main/skills/otel-go"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install ollygarden-opentelemetry-agent-skills@llmmart"},{"target":"git","command":"git clone https://github.com/ollygarden/opentelemetry-agent-skills.git"}]}