feat(data-pipeline): emit native trace export telemetry - #2338
Conversation
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
BenchmarksComparisonBenchmark execution time: 2026-08-25 15:57:44 Comparing candidate commit 8c9d3fc in PR branch Found 7 performance improvements and 1 performance regressions! Performance is the same for 131 metrics, 0 unstable metrics.
|
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 8c9d3fc | Docs | View more details | Give us feedback! |
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: a07af01a22
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b827abc to
3b00525
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45359c6565
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Follow-up to DataDog/dd-trace-py#18967. When dd-trace-py uses
NativeWriter, libdatadog owns trace serialization and export, so it must emit the same writer telemetry.This covers every native trace export path:
Metrics
spans_enqueued_for_serializationwhen spans enter the native export pipelinespans_droppedwithreason:serialization_errorwhen serialization definitively failsspans_droppedwithreason:api_errorwhen transport definitively failstrace_api.*and trace-chunk telemetry extended to agentless and OTLP exportPre-send serialization failures count both affected trace chunks and spans. Transport failures retain the existing chunk-drop reason while recording the corresponding span drop as
api_error.Retry and byte accounting
Transport helpers invoke a crate-internal observer once after the retry loop with the final
SendWithRetryResult:trace_api.requestsreflects the total number of HTTP attempts.Existing
send_agentless_traces_http,send_otlp_traces_http, andsend_with_retrysignatures and error behavior remain unchanged. The additivesend_with_retry_and_sizehelper also returns the final post-compression payload size for agentless byte telemetry, matching the bytes placed on the wire without recompressing the payload.Test plan
cargo check -p libdd-data-pipelinecargo check -p libdd-data-pipeline --no-default-featurescargo +stable clippy -p libdd-data-pipeline --all-targets -- -D warningscargo +stable clippy -p libdd-data-pipeline --all-targets --features compression -- -D warningscargo +stable clippy -p libdd-trace-utils --all-targets --features compression -- -D warningscargo nextest run -p libdd-data-pipeline(169 passed)cargo nextest run -p libdd-data-pipeline --features compression(169 passed)cargo nextest run -p libdd-trace-utils --features compression(336 passed)cargo test -p libdd-data-pipeline --doc(2 passed)cargo test -p libdd-trace-utils --features compression --doc(30 passed, 1 ignored)cargo +nightly-2026-07-26 fmt --all -- --checkgit diff --check