Skip to content

feat(trace-exporter): add fail-closed fallback to v04#2037

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 17 commits into
mainfrom
anais/add-v1-to-v04-fallback
Jun 1, 2026
Merged

feat(trace-exporter): add fail-closed fallback to v04#2037
gh-worker-dd-mergequeue-cf854d[bot] merged 17 commits into
mainfrom
anais/add-v1-to-v04-fallback

Conversation

@anais-raison
Copy link
Copy Markdown
Contributor

@anais-raison anais-raison commented May 26, 2026

What does this PR do?

Adds runtime V1 trace protocol negotiation with fail-closed fallback to V0.4. Opt in via enable_v1_protocol() or DD_TRACE_AGENT_PROTOCOL_VERSION=1. V1 is only used after the agent advertises /v1.0/traces in /info.

Motivation

APMSP-2809
Makes V1 safe to enable: falls back to V0.4 against agents that don't support it.

Additional Notes

Dynamic rollback supported (if the agent stops advertising V1, the exporter switches back to V0.4).

How to test the change?

All test are working.
End to end tests against a real agent were done and successful as well.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/anais/add-v1-to-v04-fallback

Summary by Rule

Rule Base Branch PR Branch Change
unwrap_used 2 2 No change (0%)
Total 2 2 No change (0%)

Annotation Counts by File

File Base Branch PR Branch Change
libdd-data-pipeline/src/trace_exporter/mod.rs 2 2 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 21 21 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 57 57 No change (0%)
libdd-common 13 13 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 20 20 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 3 3 No change (0%)
libdd-trace-stats 1 1 No change (0%)
libdd-trace-utils 13 13 No change (0%)
Total 196 196 No change (0%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@datadog-prod-us1-4
Copy link
Copy Markdown

datadog-prod-us1-4 Bot commented May 26, 2026

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 97.98%
Overall Coverage: 73.40% (+0.06%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 09176f7 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 26, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 82.95 MB 82.98 MB +.03% (+28.63 KB) 🔍
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.63 MB 7.63 MB +0% (+96 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 94.02 MB 94.05 MB +.03% (+29.32 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.25 MB 10.26 MB +.01% (+2.01 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 24.56 MB 24.57 MB +.03% (+8.50 KB) 🔍
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 83.96 KB 83.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 178.31 MB 178.37 MB +.03% (+56.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 915.60 MB 915.73 MB +.01% (+123.54 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 8.03 MB 8.03 MB +.03% (+3.00 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 83.96 KB 83.96 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.77 MB 23.78 MB +.03% (+8.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 47.42 MB 47.44 MB +.03% (+17.92 KB) 🔍
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.28 MB 21.28 MB +.03% (+8.00 KB) 🔍
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 85.29 KB 85.29 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 182.26 MB 182.30 MB +.02% (+40.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 908.24 MB 908.33 MB +0% (+91.63 KB) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 6.20 MB 6.20 MB +.06% (+4.00 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 85.29 KB 85.29 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 25.48 MB 25.49 MB +.03% (+8.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 45.07 MB 45.09 MB +.03% (+16.19 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 73.96 MB 73.98 MB +.03% (+28.97 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.52 MB 8.53 MB +.09% (+8.09 KB) 🔍
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 89.36 MB 89.38 MB +.03% (+29.00 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.36 MB 10.37 MB +.05% (+5.40 KB) 🔍

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 26, 2026

Codecov Report

❌ Patch coverage is 97.97980% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.39%. Comparing base (33a94ca) to head (09176f7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2037      +/-   ##
==========================================
+ Coverage   73.33%   73.39%   +0.05%     
==========================================
  Files         464      464              
  Lines       77748    77970     +222     
==========================================
+ Hits        57020    57227     +207     
- Misses      20728    20743      +15     
Components Coverage Δ
libdd-crashtracker 65.44% <ø> (-0.03%) ⬇️
libdd-crashtracker-ffi 37.68% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 86.47% <97.97%> (+0.63%) ⬆️
libdd-data-pipeline-ffi 77.03% <ø> (ø)
libdd-common 79.89% <ø> (ø)
libdd-common-ffi 74.41% <ø> (ø)
libdd-telemetry 73.34% <ø> (ø)
libdd-telemetry-ffi 31.36% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 76.22% <ø> (+0.14%) ⬆️
libdd-profiling 81.66% <ø> (-0.05%) ⬇️
libdd-profiling-ffi 64.79% <ø> (ø)
libdd-sampling 97.41% <ø> (ø)
datadog-sidecar 34.60% <ø> (ø)
datdog-sidecar-ffi 8.61% <ø> (ø)
spawn-worker 48.86% <ø> (ø)
libdd-tinybytes 93.80% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.30% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 89.21% <ø> (-0.06%) ⬇️
libdd-tracer-flare 86.88% <ø> (ø)
libdd-log 74.83% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…allback

# Conflicts:
#	libdd-data-pipeline/src/trace_exporter/trace_serializer.rs
#	libdd-trace-utils/src/msgpack_encoder/v04/mod.rs
#	libdd-trace-utils/src/msgpack_encoder/v1/mod.rs
@anais-raison anais-raison marked this pull request as ready for review May 26, 2026 16:28
@anais-raison anais-raison requested review from a team as code owners May 26, 2026 16:28
Copy link
Copy Markdown

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

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: 73cbd6de94

ℹ️ 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 libdd-data-pipeline/src/trace_exporter/mod.rs Outdated
Comment thread libdd-data-pipeline/src/trace_exporter/builder.rs Outdated
Comment thread libdd-data-pipeline/src/trace_exporter/mod.rs Outdated
Comment thread libdd-data-pipeline/tests/test_trace_exporter.rs
Comment thread libdd-data-pipeline/src/trace_exporter/mod.rs
Comment thread libdd-data-pipeline/src/trace_exporter/mod.rs
Comment thread libdd-data-pipeline/src/trace_exporter/mod.rs
@anais-raison anais-raison requested a review from a team as a code owner May 29, 2026 14:21
Copy link
Copy Markdown
Collaborator

@ekump ekump left a comment

Choose a reason for hiding this comment

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

LGTM, just don't forget to remove the temporary code in the GH workflow

Comment thread .github/workflows/test.yml Outdated
Comment thread libdd-data-pipeline/src/trace_exporter/mod.rs
Comment thread libdd-data-pipeline/src/trace_exporter/mod.rs Outdated
@github-actions github-actions Bot removed the ci-build label Jun 1, 2026
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.

5 participants