refactor/tracing: use native OpenTelemetry spans - #1160
Draft
keegancsmith wants to merge 1 commit into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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; legacyJAEGER_*configuration is no longer supported.Validated with
go test ./... -short,go build ./cmd/..., andgit diff --check.