Skip to content

feat: replace v04 usage by v1 in sidecar - #2156

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 13 commits into
mainfrom
anais/sidecar-from-v04-to-v1-span
Aug 25, 2026
Merged

feat: replace v04 usage by v1 in sidecar#2156
gh-worker-dd-mergequeue-cf854d[bot] merged 13 commits into
mainfrom
anais/sidecar-from-v04-to-v1-span

Conversation

@anais-raison

@anais-raison anais-raison commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Wires the sidecar so SDKs (PHP first) can send V1 msgpack payloads. Adds the FFI entry points, tarpc methods, blocking/sender wrappers, and server handlers — symmetric to the existing send_trace_v04_* chain.

When the sidecar receives V1 bytes, it decodes them through msgpack_decoder::v1 (added in #2174), can inspect the payload, and re-encodes as V1 on the way to the agent's /v1.0/traces endpoint.

Motivation

APMSP-2813 : enable the sidecar V1-native path. PHP keeps computing its stats SDK-side via the SHM concentrator, so this PR only touches the trace transport pipeline.

@datadog-prod-us1-4

datadog-prod-us1-4 Bot commented Jun 24, 2026

Copy link
Copy Markdown

Tests

All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 46.27%
Overall Coverage: 76.68% (+0.07%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4dca4dc | Docs | View more details | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 89.19 MB 89.19 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.20 MB 8.20 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 100.37 MB 100.37 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.06 MB 11.06 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 26.63 MB 26.59 MB --.15% (-41.50 KB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 94.56 KB 94.56 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 191.42 MB 180.44 MB --5.73% (-10.97 MB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 1001.70 MB 770.23 MB --23.10% (-231.46 MB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.71 MB 8.71 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 94.56 KB 94.56 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 25.62 MB 25.62 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.01 MB 51.01 MB +0% (+4 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 23.22 MB 23.19 MB --.13% (-31.00 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 96.04 KB 96.04 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 196.34 MB 185.36 MB --5.59% (-10.98 MB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 990.83 MB 756.38 MB --23.66% (-234.45 MB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.73 MB 6.73 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 96.04 KB 96.04 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 27.55 MB 27.55 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 48.56 MB 48.56 MB +0% (+8 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 79.47 MB 79.47 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.13 MB 9.13 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 95.12 MB 95.12 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.14 MB 11.14 MB 0% (0 B) 👌

@anais-raison
anais-raison changed the base branch from main to anais/add-v1-decoder July 13, 2026 09:25
Comment thread datadog-sidecar/src/service/sidecar_server.rs Outdated
Base automatically changed from anais/add-v1-decoder to main July 17, 2026 17:57
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Jul 28, 2026
# What does this PR do?

Splits `TracerHeaderTags` into two parts: the tracer-identity strings (`lang`, `lang_version`, `tracer_version`, etc.) stay as-is, and the generic bool/int flags (`client_computed_stats`, `client_computed_top_level`, `dropped_p0_traces`, `dropped_p0_spans`) are pulled into a new standalone `TracerGenericTags` struct, embedded as `TracerHeaderTags::generic`.

# Motivation

`TracerHeaderTags` mixed tracer-identity strings with generic bool/int flags. The latter are meaningful independently of the string metadata, so pulling them into their own struct lets them be carried on their own in contexts where the string fields would be redundant (e.g. payload formats that already embed the tracer identity), without forcing a full split of the type.

# Additional Notes

Raised during review of #2156. Prepared as a separate PR to keep #2156 scoped to the sidecar-specific V04→V1 changes.

This PR alone is a no-op refactor — `TracerGenericTags` is still only used embedded in `TracerHeaderTags`. The actual payoff comes in #2156: the V1 trace-sending path already carries the tracer identity in the V1 payload itself, so `send_trace_v1` will be able to pass just `TracerGenericTags` (a small `Copy` struct, no serialization needed) across the sidecar's IPC boundary instead of the full `TracerHeaderTags`/`SerializedTracerHeaderTags`, which currently re-transmits redundant string data.

Co-authored-by: anais.raison <anais.raison@datadoghq.com>
anais-raison and others added 2 commits July 29, 2026 16:12
…4-to-v1-span

# Conflicts:
#	libdd-data-pipeline/src/trace_exporter/trace_serializer.rs
#	libdd-trace-utils/src/msgpack_decoder/v1/mod.rs
#	libdd-trace-utils/src/msgpack_decoder/v1/span.rs
#	libdd-trace-utils/src/send_data/mod.rs
#	libdd-trace-utils/src/tracer_payload.rs
#	libdd-trace-utils/tests/test_send_data.rs
…andlers

Merging main's SidecarInterface trait update (which dropped the peer-credentials
parameter from send_trace handlers) into this branch left the v1 trace handlers
with a param the trait no longer declares, breaking the build after the merge.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pr-commenter

pr-commenter Bot commented Jul 29, 2026

Copy link
Copy Markdown

Benchmarks

Comparison

Candidate

Candidate benchmark details

Baseline

Baseline benchmark details

@anais-raison
anais-raison marked this pull request as ready for review July 31, 2026 12:26
@anais-raison
anais-raison requested review from a team as code owners July 31, 2026 12:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 938c110d26

ℹ️ 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".

Comment thread datadog-sidecar/src/service/sidecar_server.rs Outdated
Comment thread datadog-sidecar-ffi/src/lib.rs
Comment thread libdd-trace-utils/src/tracer_payload.rs Outdated
Comment thread datadog-sidecar/src/service/sidecar_server.rs Outdated

@Leiyks Leiyks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except the V1 payloads being posted on the V04 endpoint and few nits, the rest looks good 👌

Comment thread datadog-sidecar/src/service/sidecar_server.rs Outdated
Comment thread libdd-trace-utils/src/tracer_payload.rs Outdated
Comment thread datadog-sidecar/src/service/sidecar_server.rs Outdated
@gh-worker-ownership-write-b05516
gh-worker-ownership-write-b05516 Bot removed the request for review from a team August 10, 2026 09:35
Comment thread datadog-sidecar-ffi/src/lib.rs Outdated
Comment thread datadog-sidecar/src/service/sidecar_server.rs Outdated
Comment thread datadog-sidecar/src/service/sidecar_server.rs
Comment thread datadog-sidecar-ffi/src/lib.rs Outdated

@bwoebi bwoebi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, thanks!

Comment thread datadog-sidecar/src/service/sidecar_server.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants