feat(tracing): use OTel API backed by dd-trace-go transport#298
Open
feat(tracing): use OTel API backed by dd-trace-go transport#298
Conversation
Registers an OpenTelemetry TracerProvider implemented by ddotel, so spans created via otel.Tracer().Start(...) are serialized by dd-trace-go and shipped to the local Datadog Agent on port 8126. No infra changes required: the agent has accepted dd-trace traffic on that port since APM was first turned on. Instrumentation sites in the git strategy use the standard OTel API (otel.Tracer, attribute.String, span.RecordError, span.SetStatus). The internal/tracing package is now just the bridge wiring; per-package tracers live next to the code being instrumented. profiling.Start() no longer starts the dd-trace-go tracer — that has moved into tracing.New() so all tracer wiring is in one place. Runtime metrics remain on (via tracer.WithRuntimeMetrics). Amp-Thread-ID: https://ampcode.com/threads/T-019e0410-4b1d-77fc-a775-b6febdd0108d Co-authored-by: Amp <amp@ampcode.com>
fa507c0 to
45dcbf1
Compare
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.
Wires
internal/tracingto register an OpenTelemetry TracerProvider implemented byddotel. Spans created via the standardotel.Tracer().Start(...)API are serialized by dd-trace-go and shipped to the local Datadog Agent on port 8126 — no extra infra, no API key, no collector.Instrumentation in the git strategy uses stdlib OTel (
otel.Tracer,attribute.String,span.RecordError,span.SetStatus).startClone,tryRestoreSnapshot, anddoFetchproduce one span each, covering the full mirror lifecycle.profiling.Start()no longer starts the dd-trace-go tracer — that moved intotracing.New()so tracer wiring lives in one place. Runtime metrics remain on.Switching to a pure-OTel transport later (OTLP → collector → Tempo or DD) means swapping the TracerProvider in
tracing.New(); instrumentation sites are unchanged.