Conversation
📚 Documentation Check Results📦
|
🔒 Cargo Deny Results📦
|
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 2 Pipeline jobs failed
ℹ️ InfoNo other issues found (see more)🧪 All tests passed 🎯 Code Coverage (details) Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 89d5b1f | 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-10-01 17:26:09 Comparing candidate commit 89d5b1f in PR branch Found 2 performance improvements and 2 performance regressions! Performance is the same for 125 metrics, 0 unstable metrics.
|
19675f4 to
d81d005
Compare
d81d005 to
e12dbe1
Compare
e12dbe1 to
c5dc301
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5dc30175f
ℹ️ 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".
| .into_owned(), | ||
| git_commit_sha: self.git_commit_sha.to_utf8_lossy().into_owned(), | ||
| process_tags: self.process_tags.to_utf8_lossy().into_owned(), | ||
| ..Default::default() |
There was a problem hiding this comment.
Preserve the container ID in V1 metadata
When a tracer supplies parameters.tracer_headers_tags.container_id, this conversion leaves TracerMetadata::container_id at its empty default. The V1 encoder consequently omits the container-ID payload key (msgpack_encoder/v1/mod.rs:338,372-374), and the sidecar reconstructs the outgoing Datadog-Container-Id header exclusively from that decoded field (sidecar_server.rs:317-325), so all traces sent through this new high-level API lose their container attribution. Populate this field from the existing header tags or expose it in TracerMetadataV1.
Useful? React with 👍 / 👎.
53437b3 to
6e09e18
Compare
3582ada to
382b667
Compare
d87243e to
5f966b2
Compare
| /// dropped (the tracer never emits them for links). | ||
| /// * `dropped_attributes_count` / `flags` — not part of the legacy shape (master leaves the count | ||
| /// property unset; flags is a native-only concept). | ||
| fn span_links_to_legacy_json<T: TraceData>(span_links: &[SpanLink<T>]) -> String { |
There was a problem hiding this comment.
msgpack span_links v04 is old enough to just support, we don't need json here.
| })?; | ||
| // V1 attributes are flat triplets that may repeat keys, so the decoder leaves the maps | ||
| // un-deduped; dedup once here so re-encoding doesn't take the warning fallback. | ||
| data.dedup(); |
There was a problem hiding this comment.
We should audit the amount of dedups again across everything, because they're expensive to do repeatedly.
| if supports_v1 { | ||
| if let TraceChunks::V1(p) = &mut payload { | ||
| if !generic.client_computed_top_level { | ||
| for chunk in &mut p.chunks { | ||
| trace_utils_v1::compute_tracer_top_level_span(&mut chunk.spans); | ||
| } | ||
| } | ||
| } | ||
| generic.client_computed_top_level = true; | ||
| } |
There was a problem hiding this comment.
This should be handled in the tracer. (which just knows what the top level span is and doesn't have to compute it)
There was a problem hiding this comment.
Maybe add a warn!() or something if it's not set.
There was a problem hiding this comment.
You added... actual v1 functions into the test code to test them, without ... exposing it?!
| builder: &TracerPayloadV1Builder, | ||
| chunk: usize, | ||
| span: usize, |
There was a problem hiding this comment.
Like in dd-trace-php, avoid the index-indirection, it's slow.
| /// insertion order, and [Self::dedup] preserves it: a duplicate key's surviving (last-written) | ||
| /// entry keeps the position of that last write, earlier duplicates are simply dropped. |
There was a problem hiding this comment.
Why this change? Is the insertion order actually important?
Extend the native v1 span model with payload-level attributes, unspecified span kind and tracer-marked top-level spans. Make the v1 to v0.4 downgrade self-contained: legacy _dd.span_links/_dd.span_events meta for old agents, PHP-compatible JSON float formatting, chunk-root rules shared with v1, and process tags on each trace's first span. Dedup V1 payloads after decoding and keep insertion order in VecMap.
Send traces to the agent as v1 when /info advertises /v1.0/traces and downgrade to v0.4 otherwise, using the session's /info for the first send. Tracer-marked top-level spans are honoured in the sidecar.
Add the V1 trace builder FFI (Box-per-node pointer handles for chunks, spans, links, events and attribute maps), ddog_send_traces_to_sidecar_v1, and the v04-to-v1 transcode used by the in-process sender. Shrink ddog_TracerMetadataV1.
3093805 to
89d5b1f
Compare
V1 Efficient Trace Payload support for SDKs (dd-trace-php first), on top of the merged v1 encoder (#2145), decoder (#2174) and sidecar transport (#2156). Exercised by DataDog/dd-trace-php#4046, which pins this branch.
SpanKind::Unspecified(0) becomes the default and is left off the V1 wire.TracerPayload::dedupdedups every attribute map, nested ones included (last write wins).msgpack_encoder::v04::span_v1), used for agents without/v1.0/tracesand for the in-process sender:span_linksfield (attributes stringified, nested values as theirjson_encodestring). Span events go to the legacyeventsmeta JSON, since nativespan_eventsneeds agent 7.63+. Floats in these JSON strings are formatted like PHP'sjson_encode._dd.p.tid,_dd.origin,_dd.p.dm,_sampling_priority_v1) go on the chunk's local root only._dd.tags.process/_dd.sdk.otlp_export(first span of each chunk) and_dd.git.*(local root), as pre-V1 tracers wrote them.dropped_tracechunk keeps its own priority and only defaults to-1when it has none.send_trace_v1_*sends V1 when the session's/infoadvertises/v1.0/traces(or in agentless mode), otherwise it downgrades to v0.4 and re-decodes. It fails closed to v0.4 until/infois known, and theforce_v04_tracessession option skips V1 entirely. The sidecar does not compute top-level spans: the tracer marks_dd.top_leveland setsclient_computed_top_level, and the sidecar warns when a V1 chunk has no top-level span.&mutborrow crosses the FFI and no index is re-fetched. It comes with read-back getters,ddog_send_traces_to_sidecar_v1,ddog_sidecar_send_trace_v1_{shm,bytes}andddog_downgrade_v1_builder_to_v04_traces(for the in-process sender). The v0.4 span builder FFI is removed; only theTracesBytescollection used as the downgrade target remains (span_v04.rs).The
!:ddog_sidecar_session_set_configtakes a newforce_v04_tracesargument, the v0.4 span builder FFI is replaced by the V1 one (ddog_set_span_*now take V1 span handles), and theSpanKinddefault changes fromInternaltoUnspecified.