Skip to content

feat(tracing): use OTel API backed by dd-trace-go transport#298

Open
worstell wants to merge 1 commit intomainfrom
feat/tracing-git-mirror
Open

feat(tracing): use OTel API backed by dd-trace-go transport#298
worstell wants to merge 1 commit intomainfrom
feat/tracing-git-mirror

Conversation

@worstell
Copy link
Copy Markdown
Contributor

@worstell worstell commented May 7, 2026

Wires internal/tracing to register an OpenTelemetry TracerProvider implemented by ddotel. Spans created via the standard otel.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, and doFetch produce one span each, covering the full mirror lifecycle.

profiling.Start() no longer starts the dd-trace-go tracer — that moved into tracing.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.

@worstell worstell marked this pull request as ready for review May 7, 2026 20:37
@worstell worstell requested a review from a team as a code owner May 7, 2026 20:37
@worstell worstell requested review from jrobotham-square and removed request for a team May 7, 2026 20:37
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>
@worstell worstell force-pushed the feat/tracing-git-mirror branch from fa507c0 to 45dcbf1 Compare May 7, 2026 22:01
@worstell worstell changed the title feat(tracing): add tracing helper and instrument git mirror lifecycle feat(tracing): use OTel API backed by dd-trace-go transport May 7, 2026
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