Skip to content

refactor/tracing: use native OpenTelemetry spans - #1160

Draft
keegancsmith wants to merge 1 commit into
mainfrom
k/native-otel-tracing
Draft

refactor/tracing: use native OpenTelemetry spans#1160
keegancsmith wants to merge 1 commit into
mainfrom
k/native-otel-tracing

Conversation

@keegancsmith

Copy link
Copy Markdown
Member

PR #761 made Sourcegraph and Zoekt rely on the OpenTelemetry gRPC handlers for trace propagation. This follow-up removes the compatibility layer that is no longer needed: internal search traces now create native OpenTelemetry spans, the SDK provider is installed directly, and log events and errors use native span APIs.

The provider keeps the existing parent-based sampling policy and now propagates only the W3C trace context and baggage used by Sourcegraph. A gRPC integration test exercises the same client-handler → Zoekt-server-handler boundary with both sampled and unsampled parents, while focused tests cover internal span parenting, events, error status, and provider sampling. This is also the remaining tracing cleanup discussed in #761; sourcegraph/sourcegraph#15341 handles the Go API update against the merged Zoekt commit.

The obsolete OpenTracing bridge, standalone Jaeger backend, legacy propagators, and their dependencies are removed. Native OTLP export remains controlled by OPENTELEMETRY_DISABLED=false; legacy JAEGER_* configuration is no longer supported.

Validated with go test ./... -short, go build ./cmd/..., and git diff --check.

Zoekt now receives native OpenTelemetry context over gRPC, so retaining a second tracing API and a standalone Jaeger backend only adds compatibility paths that Sourcegraph no longer needs. Use native spans end to end while preserving parent-controlled sampling and W3C propagation.

Amp-Thread-ID: https://ampcode.com/threads/T-01a06b7a-23ba-723a-a62f-a10f4727a8bb
Co-authored-by: Amp <amp@ampcode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant