feat(trace-utils): add v1-native OTLP encoder brick - #2369
Conversation
Isolated brick for APMSP-2812: adds map_traces_to_otlp_v1, mapping v1::TraceChunk/v1::Span directly to the prost OTLP IR with no hex/decimal round trip and no meta/metrics flatten. Bumps build_resource and proto_kv to pub(super) so mapper_v1 can reuse them. Not wired into any live send path yet.
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
|
BenchmarksComparisonBenchmark execution time: 2026-08-26 12:14:18 Comparing candidate commit 7f2d1f2 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 138 metrics, 0 unstable metrics.
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
What does this PR do?
Adds a v1-native equivalent of the existing v0.4 OTLP mapper, as groundwork for making
v1::Span/v1::TraceChunkthe exporter's canonical internal type:otlp_encoder::map_traces_to_otlp_v1(libdd-trace-utils), mappingv1::TraceChunk/v1::Spandirectly to the prost OTLP IRNothing is wired into the live pipeline yet.
Motivation
Part of APMSP-2812: migration of the exporter from v0.4 to v1 with isolated bricks first before one final breaking PR that will handle the actual swap.
Additional Notes
Pure addition, no behavior change — this function isn't called anywhere yet, so there's no regression risk. Also bumps
build_resource/proto_kvin the existing v0.4 mapper to pub(super) so the v1 mapper can reuse them without duplicating that logic.