fix(ddtrace/tracer): make OTLP metric attrs mode-independent - #5155
Conversation
Always emit available Datadog trace-metric attributes regardless of DD_TRACE_OTEL_SEMANTICS_ENABLED. Export a non-empty stats service source as the datadog.svc_src string attribute while retaining trace-export semantics handling.
Keep trace-metrics tests focused on unconditional attribute output and service-source typing without exercising DD_TRACE_OTEL_SEMANTICS_ENABLED.
BenchmarksBenchmark execution time: 2026-08-07 07:34:28 Comparing candidate commit ca1f834 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 326 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.
|
Emit datadog.is_trace_root only for explicit true and false trilean values. Omit unset and unrecognized enum values instead of treating them as false.
|
/merge |
|
View all feedbacks in Devflow UI.
It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.
The expected merge time in
|
|
/code blockers |
|
View all feedbacks in Devflow UI.
Checking merge blockers for #5155...
Detected 5 merge blocker(s) to address:
|
Config Audit |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: ca1f834 | Docs | Datadog PR Page | Give us feedback! |
|
/code blockers |
|
View all feedbacks in Devflow UI.
Checking merge blockers for #5155...
No merge blockers detected. |
|
/merge |
|
View all feedbacks in Devflow UI.
PR already in the queue with status in_progress |
0577c2e
into
main
What does this PR do?
DD_TRACE_OTEL_SEMANTICS_ENABLED; available OTel anddatadog.*resource/data-point attributes are always emitted together.ClientGroupedStats.ServiceSourceas the OTLP string attributedatadog.svc_srcand omits it when absent.Motivation
Follow-up to merged #5130 for the revised cross-SDK OTLP trace-metrics contract. Shared coverage is tracked in DataDog/system-tests#7466.
Validation
go test ./ddtrace/tracer -count=1go vet ./ddtrace/tracermake format/go./bin/golangci-lint run --new-from-rev=origin/main ./ddtrace/tracerReviewer's Checklist