Add hostname to OTLP trace metrics resources - #9016
Conversation
- status.code: fix protobuf path to emit the OTel string literal (STATUS_CODE_OK/STATUS_CODE_ERROR) instead of an int enum, and make it unconditional in both JSON and protobuf paths (was previously omitted on non-error data points). - is_trace_root: emit datadog.is_trace_root next to datadog.span.top_level, gated behind OTel-semantics suppression like other datadog.-prefixed attributes. - additional_metric_tags: emit each configured key as its own unprefixed data-point attribute, never gated by OTel-semantics. - span.kind: canonicalize to the uppercase OTel Span Metrics Connector convention (SPAN_KIND_SERVER, etc.) via a lookup table. - process_tags/peer_tags: leave a TODO comment; not wired into OTLP output this round. Companion system-tests PR: DataDog/system-tests#7363
Previously omitted when it matched the resource-level default, inconsistent with status.code and other data-point attributes which are always present.
This reverts commit ba86285.
Co-authored-by: Munir Abdinur <munir.abdinur@datadoghq.com>
…into codex/otlp-trace-metrics-hostname
…into codex/otlp-trace-metrics-hostname
BenchmarksBenchmark execution time: 2026-08-07 18:39:04 Comparing candidate commit a37e943 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 66 known flaky benchmarks, 60 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9016) and master.
|
|||||||||||||||||||||||||||||||||||
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 191.45 ± (191.32 - 192.11) ms | 211.72 ± (211.69 - 212.67) ms | +10.6% | ❌⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 195.20 ± (195.00 - 195.38) ms | 215.40 ± (215.52 - 216.40) ms | +10.4% | ❌⬆️ |
| .NET Framework 4.8 - CallTarget+Inlining+NGEN | ||||
| duration | 1171.75 ± (1171.16 - 1176.75) ms | 1276.81 ± (1275.67 - 1284.23) ms | +9.0% | ❌⬆️ |
Summary
Adds consistent hostname reporting across spans, OTLP trace resources, and OTLP trace-metrics resources.
DD_HOSTNAMEas a core configuration key. A nonempty value overrides the system hostname._dd.hostname, OTLP trace resourcehost.name, and OTLP trace-metrics resourcehost.name.DD_TRACE_REPORT_HOSTNAME; child spans do not receive_dd.hostname.This draft is stacked on #8992 and must merge after it.
Validation
git diff --check: passedtest_fr06_10_hostname: XPASStest_fr06_11_hostname_omitted: passed