feat(otelc): add support for otelc compile-time instrumentation - #5117
feat(otelc): add support for otelc compile-time instrumentation#5117rarguelloF wants to merge 19 commits into
Conversation
Config Audit |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: d3e72eb | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-08-04 14:46:13 Comparing candidate commit d3e72eb in PR branch Found 4 performance improvements and 1 performance regressions! Performance is the same for 321 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.
|
…t binary on Windows
What does this PR do?
Makes it possible to build an application with otelc and get Datadog tracing, the way orchestrion does today. No integration is migrated yet, this is only the groundwork.
In an otelc build the tracer now starts and stops on its own, and the goroutine-local storage bridge is woven in so a span still finds its parent when no
context.Contextwas passed down. The same applies to AppSec operations.Applications turn it on by blank-importing
github.com/DataDog/dd-trace-go/otelc/all/v2from anotel.instrumentation.go, the same shape asorchestrion/all. Integrations get added to that package as they are migrated.The GLS test suites under
internal/orchestrion/_integration/glsandgls-leaknow run under either tool and pass identically, with nothing skipped and no assertion relaxed.Two known gaps, both written down in the rule files:
func init(), before any other package init runs. Here it starts at the top ofmain, so a span emitted from a package init is lost. Doing it the same way needs otelc'sadd_file, which currently also applies to test binaries and emits an invalid package clause there. Two upstream issues to file.net/httpis migrated.Motivation
Support otelc.
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.otelc/allmodule.