feat(trace-utils): add v1-native JSON log encoder brick - #2371
feat(trace-utils): add v1-native JSON log encoder brick#2371anais-raison wants to merge 4 commits into
Conversation
Isolated brick for APMSP-2812: adds a v1::Span-native JSON log encoder (span_v1.rs) alongside the existing v0.4 one, plus write_log_traces_v1 in log_writer.rs. Not wired into any live send path yet.
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
|
BenchmarksComparisonBenchmark execution time: 2026-08-20 12:47:04 Comparing candidate commit 058ae9c in PR branch Found 4 performance improvements and 0 performance regressions! Performance is the same for 148 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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 058ae9c80b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| pub fn encode_traces_v1<T: TraceData>( | ||
| chunks: &[TraceChunk<T>], | ||
| out: &mut impl Write, |
There was a problem hiding this comment.
Preserve payload-level attributes in V1 log output
When this API is called with chunks from the canonical V1 TracerPayload, it has no access to payload.env, payload.app_version, or payload.attributes, so values hoisted to the payload level are silently omitted from every emitted span. The existing V1-to-v0.4 downgrade explicitly propagates those fields into each span, and TraceChunks::V1 stores the complete payload; accept the payload or equivalent payload context here before this path is wired into the exporter.
Useful? React with 👍 / 👎.
What does this PR do?
Adds a v1-native equivalent of the existing v0.4 JSON log encoder, as groundwork for making
v1::Span/v1::TraceChunkthe exporter's canonical internal type:json_log_encoder::span_v1+encode_traces_v1(libdd-trace-utils)write_log_traces_v1(libdd-data-pipeline)Nothing 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 — these functions aren't called anywhere yet, so there's no regression risk.