Repository navigation
Description
Overview: Today's Go Fan review covers go.opentelemetry.io/otel (pinned at v1.47.0, the latest stable release). The pin is current, so no upgrade is needed. The main finding is a sampler design question: InitProvider installs AlwaysSample/TraceIDRatioBased directly, not wrapped in ParentBased, so an incoming traceparent sampling decision is ignored. Also, the semconv pairing comment in semconv.go should be re-checked against v1.47.0. Note: the sandbox denied go commands and the upstream source/changelog fetch was blocked, so the canary tests were not run and upstream v1.44 to v1.47 release notes were not verified.
Full Report
🐹 Go Fan Report: go.opentelemetry.io/otel
Module Overview
go.opentelemetry.io/otel is the OpenTelemetry Go API. The project uses it for distributed tracing: the gateway builds an OTLP/HTTP trace pipeline (internal/tracing/provider.go), wraps HTTP handlers with server spans, and instruments tool calls and proxy forwards with client/internal spans. Related modules pinned in the same release train are otel/sdk, otel/trace, and otel/exporters/otlp/otlptrace/otlptracehttp.
Current Usage in gh-aw
-
Files: 24 Go files import
go.opentelemetry.io/otel*(9 production, 15 test) -
Import Count: 60 import lines
-
Key APIs Used:
- Exporter:
otlptracehttp.NewwithWithEndpointURL,WithTimeout,WithMaxResponseSize,WithRetry,WithHeaders - SDK:
sdktrace.NewTracerProvider,WithBatcher,WithMaxExportBatchSize(256),WithBatchTimeout(2s),WithResource,WithSampler(AlwaysSample,NeverSample,TraceIDRatioBased) - Resource:
resource.NewwithWithTelemetrySDK,WithContainer,WithHost,WithProcessPID; fallback viaNewWithAttributesandMerge - Propagation:
propagation.TraceContext,propagation.Baggage, globalotel.SetTextMapPropagator - Spans:
trace.Span.RecordError(..., WithStackTrace(true)),SetStatus(codes.Error, ...),SpanKindServer/Client/Internal - Noop:
trace/noopfor disabled tracing
- Exporter:
-
Custom code:
internal/tracing/fanout.gohand-implementssdktrace.SpanExporterfor multi-endpoint fan-out. Canary tests guard it.
Research Findings
Recent Updates
- Latest stable: v1.47.0 (published 2026-10-02, per GitHub releases).
v1.47.0-rc.1was a prerelease (2026-08-28). - Recent stable releases: v1.46.0 (2026-08-25), v1.45.0 (2026-08-03), v1.44.0 (2026-05-27).
- Not verified in this run: release-note contents for v1.44 to v1.47 (changelog fetch blocked), deprecations, and breaking changes. The repo's own comments mention panic recording added in v1.44.0 and a semconv v1.43.0 pairing with v1.46.0.
Best Practices
Per the OpenTelemetry Go SDK defaults, NewTracerProvider uses ParentBased(AlwaysSample()) unless a sampler is set. Wrapping the root sampler in ParentBased lets a remote parent's sampled flag decide whether to record a child span.
Improvement Opportunities
🏃 Quick Wins
- Confirm sampler intent (
internal/tracing/provider.go, sampler switch): the gateway setssdktrace.AlwaysSample(),NeverSample(), orTraceIDRatioBased(rate)as the root sampler, not wrapped inParentBased. An incomingtraceparentwithflags=00is still recorded and exported whenrate >= 1.0. This may be intentional, since the gateway is explicitly configured with an OTLP endpoint andParentContextmarks its synthetic parent as sampled. If honoring upstream decisions is desired, wrap each case withsdktrace.ParentBased(...)and add a test with an unsampled remote parent. Otherwise, document the choice. - Re-check the semconv pairing (
internal/tracing/semconv.go): the header sayssemconv/v1.43.0"ships with otel v1.46.0" as an example, whilego.modpins v1.47.0. Confirm which semconv package v1.47.0 ships and whetherexpectedSchemaURLinsemconv_test.goneeds to move. This is the "conflicting Schema URL" risk the file warns about.
✨ Feature Opportunities
- Panic recording is left enabled (per the comment in
provider.go). Verify this still matches the v1.47.0 default. The code comment is the only evidence available here.
📐 Best Practice Alignment
WithRetryuses a 1-minuteMaxElapsedTimewith 5s to 30s intervals. Check that this matches the flush behavior expected at shutdown, sinceProvider.Shutdownrelies onsdk.Shutdownto flush.
🔧 General Improvements
fanout.gohand-implementsSpanExporter. VerifyTestSpanExporterInterfaceCanarystill matches the v1.47.0 interface.
Module Summary
| Field | Value |
|---|---|
| Module | go.opentelemetry.io/otel |
| Version | v1.47.0 (with otel/sdk, otel/trace, otlptracehttp at v1.47.0) |
| Repository | https://github.com/open-telemetry/opentelemetry-go |
| Latest Release | v1.47.0 (2026-10-02) |
| Last Reviewed | 2026-11-24 |
Key Features
- Stable traces API and SDK (
otel/trace,otel/sdk/trace) - OTLP/HTTP exporter with configurable retry, timeout, and headers
- W3C TraceContext and Baggage propagators
- Semantic conventions via
otel/semconv/vX.Y.Z(pinned to v1.43.0 here) - Noop tracer provider for zero-overhead disabled mode
References
- Documentation: (opentelemetry.io/redacted)
- Changelog: https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md
Recommendations
- Run the OTel canary and semconv tests after confirming the pin:
go test ./internal/tracing/ -run 'Canary|TestSchemaURL' -v. These were not run in this review. - Decide on
ParentBasedsampling (Quick Win 1) and either change the code with a test or document the current behavior. - Re-check the semconv pairing against v1.47.0 (Quick Win 2).
- Read the v1.44 to v1.47 changelog entries for deprecations before the next bump.
Next Steps
- Schedule a follow-up review that includes the upstream changelog once the source fetch is available.
- Pick up the sampler and semconv items as separate issues if the team agrees they are wanted.
Generated by Go Fan
References:
Generated by Go Fan · copilot · routed: haiku55 xhigh · ~14 AIC · ⊞ 5.8K · ◷
- expires on Dec 1, 2026, 7:16 AM UTC
Activity