feat(data-pipeline)!: generate agentless trace stats - #2488
Conversation
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results✅ No issues found! 📦
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 0f77aad | 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
|
BenchmarksComparisonBenchmark execution time: 2026-09-11 14:47:58 Comparing candidate commit 0f77aad in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 176 metrics, 0 unstable metrics.
|
bengl
left a comment
There was a problem hiding this comment.
Overall looks fine, but I'd prefer if someone from @DataDog/apm-common-components-core approved.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63e7f235b3
ℹ️ 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".
63e7f23 to
7691ae8
Compare
Stats aggregation runs before priority-zero chunks are removed, so a payload can produce stats without a trace request.
Using a compile-time destination strategy keeps the agent branch out of agentless WASM builds while both exporters share sequencing and bucket splitting.
1. Preserve the existing Agent destination shape to avoid breaking callers. 2. Honor precomputed-stats metadata so agentless traces do not request duplicate stats. 3. Reject zero bucket sizes before timestamp alignment can divide by zero.
7691ae8 to
0f77aad
Compare
paullegranddc
left a comment
There was a problem hiding this comment.
Approved with some nits. Overall I have a gut feeling that it shouldn't be this hard to do what you are doing.
Also, you're basically rebuilding a small TracerExporter which target just agentless. Instead of maintaining the same pipeline twice we should see if we can refactor the TraceExporter even if we have to feature gate some code for package size
| @@ -674,7 +674,8 @@ impl StatsBucket { | |||
| return; | |||
| } | |||
| // Within the max entry limit, admit key as a new distinct entry. | |||
| e.insert_with_key(OwnedAggregationKey::from(&key), GroupedStats::default()) | |||
| e.insert(OwnedAggregationKey::from(&key), GroupedStats::default()) | |||
| .1 | |||
There was a problem hiding this comment.
I don't think this is necessary
| trait StatsPayloadDestination<Cap: HttpClientCapability + SleepCapability> { | ||
| async fn send_payload( | ||
| &self, | ||
| capabilities: &Cap, | ||
| meta: &StatsMetadata, | ||
| sequence_id: &AtomicU64, | ||
| buckets: Vec<pb::ClientStatsBucket>, | ||
| obfuscated: bool, | ||
| #[cfg(feature = "stats-obfuscation")] supported_obfuscation_version: &'static str, | ||
| ) -> anyhow::Result<()>; | ||
| } |
There was a problem hiding this comment.
I don't really get why we need to separate just agentless vs agent/agentless with a trait. Does it allow reducing package size?
Agentless v0.4 export now generates trace stats from the decoded trace payload. Traces and stats share one exporter and one WASM artifact.