Skip to content

feat: process context publication#1585

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 23 commits intomainfrom
yannham/process-context-sharing
Mar 2, 2026
Merged

feat: process context publication#1585
gh-worker-dd-mergequeue-cf854d[bot] merged 23 commits intomainfrom
yannham/process-context-sharing

Conversation

@yannham
Copy link
Copy Markdown
Contributor

@yannham yannham commented Feb 17, 2026

What does this PR do?

This PR implements the publication protocol of the otel process context sharing proposal.

This is intended as a minimally viable starting point. Next steps are kept for follow-up PRs, which could include for example:

  • expose the additional functions in the FFI
  • add the missing update protocol
  • add a function taking a structured object and encode it, instead of assuming a raw, already encoded payload

Motivation

This feature allows a process to expose data to an external process, typically an eBPF profiler. Please refer to the OTEP linked above for a detailed motivation.

Additional Notes

Some notes on dependencies:

  • This PR needs a handful of linux syscalls. I used rustix for that since it's already pulled as a transitive dependency (with the same major version bucket), and is nicely higher-level than libc.
  • I see that there's already a small MemFd wrapper crate used (e.g here
    pub enum AnonymousFileHandle {
    ). Unfortunately, it doesn't handle some options like NOEXEC, and doesn't really bring much over the basic rustix wrappers, so I didn't use that (question: should we take the occasion to kill a dependency and use rustix everywhere?)

There are a number of design choices or assumptions that might be interesting to discuss further:

  • on paper, a reader might be concurrently reading what the process is currently publishing, which could lead to race conditions (even more since the reader is another, uncontrolled process). However, the reader doesn't access the memory directly, but use /proc/<pid>/maps and syscalls to do so, so the concurrency model is a bit unclear. We basically settled on the mental model being that we use atomics as if the reader was another thread of the same program, which sounds like the best we can do and should prevent re-ordering at least on the writer side (using OS-level sync is another solution, but was deemed too costly for the upcoming thread-level context).
  • we must manage the following resources: the mmaped region and the payload, avoiding either leaking them or releasing them too early (nullifying the capacity to read, or worse making it read garbage). We settled with @ivoanjo on hiding that from the API user, by using a static. We use a mutex here instead of smarter lock-free style because it's mostly to please the Rust typesystem; we don't expect publications to happen often, and it should most likely be done from the same thread. The memory is guaranteed to be preserved, but the user can still free it explicitly if needed.
  • Regarding the payload, there might be room to make the internal interface safer (e.g. using Pin<Box<[u8]>> ?), and maybe offer the option - or do it automatically, depending on the size - of moving the payload directly after the header, as allowed by the spec. This is left for future work.

How to test the change?

A test is included for both publish and update, with a subsequent read. Another way would be to use those functions and use any other reader implementation (e.g. in C) as a separate process.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 17, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/yannham/process-context-sharing

Summary by Rule

Rule Base Branch PR Branch Change

Annotation Counts by File

File Base Branch PR Branch Change

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 27 27 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 59 59 No change (0%)
libdd-common 10 10 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-crashtracker 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 19 19 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 9 9 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 219 219 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.

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 17, 2026

Benchmarks

Comparison

Benchmark execution time: 2026-03-02 13:15:17

Comparing candidate commit 0af80fa in PR branch yannham/process-context-sharing with baseline commit d4c7824 in branch main.

Found 1 performance improvements and 2 performance regressions! Performance is the same for 54 metrics, 2 unstable metrics.

scenario:benching serializing traces from their internal representation to msgpack

  • 🟩 execution_time [-812.374µs; -800.127µs] or [-5.471%; -5.389%]

scenario:credit_card/is_card_number/ 378282246310005

  • 🟥 execution_time [+10.317µs; +10.482µs] or [+14.136%; +14.363%]
  • 🟥 throughput [-1721734.741op/s; -1695934.786op/s] or [-12.565%; -12.377%]

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
two way interface execution_time 18.369µs 26.395µs ± 9.493µs 18.837µs ± 0.264µs 34.889µs 43.535µs 50.487µs 72.244µs 283.52% 1.022 1.306 35.87% 0.671µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [25.079µs; 27.711µs] or [-4.984%; +4.984%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
tags/replace_trace_tags execution_time 2.310µs 2.377µs ± 0.013µs 2.378µs ± 0.004µs 2.382µs 2.397µs 2.403µs 2.410µs 1.32% -1.521 5.173 0.55% 0.001µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
tags/replace_trace_tags execution_time [2.375µs; 2.379µs] or [-0.077%; +0.077%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample_frames_x1000 execution_time 4.151ms 4.156ms ± 0.006ms 4.156ms ± 0.001ms 4.157ms 4.160ms 4.163ms 4.240ms 2.01% 11.585 150.099 0.15% 0.000ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample_frames_x1000 execution_time [4.155ms; 4.157ms] or [-0.021%; +0.021%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
redis/obfuscate_redis_string execution_time 33.195µs 33.862µs ± 1.155µs 33.360µs ± 0.105µs 33.478µs 36.355µs 36.386µs 36.985µs 10.86% 1.689 0.916 3.40% 0.082µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
redis/obfuscate_redis_string execution_time [33.702µs; 34.022µs] or [-0.473%; +0.473%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching string interning on wordpress profile execution_time 162.610µs 163.077µs ± 0.345µs 162.990µs ± 0.116µs 163.147µs 163.737µs 164.591µs 164.990µs 1.23% 2.837 10.233 0.21% 0.024µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching string interning on wordpress profile execution_time [163.029µs; 163.125µs] or [-0.029%; +0.029%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching deserializing traces from msgpack to their internal representation execution_time 47.733ms 48.058ms ± 1.251ms 47.902ms ± 0.076ms 47.973ms 48.220ms 50.576ms 63.078ms 31.68% 10.215 111.582 2.60% 0.088ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching deserializing traces from msgpack to their internal representation execution_time [47.885ms; 48.231ms] or [-0.361%; +0.361%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_trace/test_trace execution_time 247.267ns 255.052ns ± 11.829ns 249.686ns ± 1.245ns 252.492ns 287.334ns 291.325ns 296.305ns 18.67% 2.092 3.057 4.63% 0.836ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_trace/test_trace execution_time [253.412ns; 256.691ns] or [-0.643%; +0.643%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 3.895µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.918µs 3.921µs 3.925µs 0.30% -0.397 6.677 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 254781971.524op/s 255531566.048op/s ± 194650.317op/s 255538223.635op/s ± 120143.170op/s 255666620.336op/s 255769968.096op/s 255853192.350op/s 256712360.329op/s 0.46% 0.416 6.768 0.08% 13763.856op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 79.004µs 79.702µs ± 0.380µs 79.669µs ± 0.256µs 79.932µs 80.423µs 80.547µs 80.925µs 1.58% 0.633 -0.192 0.48% 0.027µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12357163.207op/s 12546959.625op/s ± 59628.538op/s 12552011.778op/s ± 40242.806op/s 12590905.590op/s 12626739.268op/s 12646378.942op/s 12657651.807op/s 0.84% -0.613 -0.226 0.47% 4216.374op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 82.637µs 83.378µs ± 0.507µs 83.274µs ± 0.313µs 83.624µs 84.328µs 85.073µs 85.368µs 2.51% 1.145 1.801 0.61% 0.036µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 11713991.191op/s 11993972.916op/s ± 72425.439op/s 12008548.887op/s ± 45255.712op/s 12042944.881op/s 12085713.392op/s 12098081.375op/s 12101160.864op/s 0.77% -1.101 1.646 0.60% 5121.252op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.897µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.916µs 3.918µs 3.921µs 3.923µs 0.24% -0.623 3.279 0.08% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254917636.471op/s 255528223.351op/s ± 201128.510op/s 255526778.896op/s ± 131315.842op/s 255650030.718op/s 255835079.190op/s 255948437.454op/s 256607698.432op/s 0.42% 0.635 3.330 0.08% 14221.933op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 69.176µs 69.726µs ± 0.342µs 69.682µs ± 0.232µs 69.906µs 70.394µs 70.603µs 71.083µs 2.01% 0.920 0.710 0.49% 0.024µs 1 200
credit_card/is_card_number/378282246310005 throughput 14068003.557op/s 14342134.594op/s ± 70069.438op/s 14350949.187op/s ± 47970.896op/s 14399088.898op/s 14424781.631op/s 14440968.315op/s 14455864.689op/s 0.73% -0.893 0.622 0.49% 4954.657op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 52.154µs 52.228µs ± 0.035µs 52.224µs ± 0.020µs 52.246µs 52.285µs 52.332µs 52.380µs 0.30% 0.864 2.073 0.07% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19091201.154op/s 19147007.937op/s ± 12812.248op/s 19148152.548op/s ± 7210.011op/s 19155001.072op/s 19166254.742op/s 19170389.342op/s 19173883.254op/s 0.13% -0.857 2.051 0.07% 905.963op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.027µs 6.038µs ± 0.010µs 6.035µs ± 0.003µs 6.039µs 6.069µs 6.074µs 6.114µs 1.30% 3.829 18.411 0.17% 0.001µs 1 200
credit_card/is_card_number/x371413321323331 throughput 163563791.458op/s 165625521.439op/s ± 280348.397op/s 165695882.459op/s ± 70009.484op/s 165760270.435op/s 165825434.508op/s 165865495.953op/s 165931424.558op/s 0.14% -3.800 18.095 0.17% 19823.625op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.894µs 3.912µs ± 0.003µs 3.912µs ± 0.002µs 3.914µs 3.917µs 3.918µs 3.920µs 0.21% -1.104 8.786 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255079213.718op/s 255599892.545op/s ± 179609.840op/s 255619249.918op/s ± 123731.164op/s 255711717.992op/s 255819806.818op/s 255856373.802op/s 256806992.221op/s 0.46% 1.125 8.932 0.07% 12700.334op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 64.137µs 64.433µs ± 0.162µs 64.421µs ± 0.105µs 64.523µs 64.706µs 64.931µs 65.127µs 1.10% 0.828 1.423 0.25% 0.011µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15354584.603op/s 15520177.500op/s ± 38905.543op/s 15522844.481op/s ± 25386.908op/s 15549879.248op/s 15572341.189op/s 15590477.259op/s 15591739.496op/s 0.44% -0.808 1.354 0.25% 2751.037op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 58.140µs 58.422µs ± 0.147µs 58.394µs ± 0.088µs 58.495µs 58.694µs 58.840µs 58.949µs 0.95% 0.803 0.638 0.25% 0.010µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16963802.795op/s 17117073.108op/s ± 42967.890op/s 17125101.658op/s ± 25815.277op/s 17146462.743op/s 17175322.685op/s 17190106.717op/s 17199872.721op/s 0.44% -0.789 0.603 0.25% 3038.289op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.894µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.914µs 3.916µs 3.920µs 3.921µs 0.22% -1.274 9.375 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255004793.312op/s 255573781.256op/s ± 186910.062op/s 255556964.242op/s ± 107290.127op/s 255681504.876op/s 255833408.399op/s 255942169.342op/s 256831068.360op/s 0.50% 1.295 9.518 0.07% 13216.537op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 54.614µs 54.936µs ± 0.285µs 54.851µs ± 0.168µs 55.093µs 55.459µs 55.894µs 56.017µs 2.13% 1.321 1.697 0.52% 0.020µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17851646.540op/s 18203382.920op/s ± 93639.048op/s 18231361.589op/s ± 56078.898op/s 18278733.818op/s 18300782.133op/s 18308493.387op/s 18310408.099op/s 0.43% -1.292 1.577 0.51% 6621.281op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 52.153µs 52.223µs ± 0.035µs 52.221µs ± 0.022µs 52.241µs 52.277µs 52.311µs 52.409µs 0.36% 1.164 3.633 0.07% 0.002µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19080743.445op/s 19148527.777op/s ± 12679.730op/s 19149483.663op/s ± 7972.893op/s 19157814.015op/s 19165400.990op/s 19170595.509op/s 19174509.407op/s 0.13% -1.156 3.587 0.07% 896.592op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.028µs 6.040µs ± 0.012µs 6.038µs ± 0.003µs 6.041µs 6.061µs 6.107µs 6.115µs 1.28% 3.903 18.596 0.20% 0.001µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 163527520.537op/s 165564267.411op/s ± 326181.643op/s 165615776.167op/s ± 94808.214op/s 165729276.077op/s 165827946.228op/s 165860769.848op/s 165880760.264op/s 0.16% -3.871 18.324 0.20% 23064.525op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.913µs; 3.914µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [255504589.387op/s; 255558542.710op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [79.650µs; 79.755µs] or [-0.066%; +0.066%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12538695.683op/s; 12555223.567op/s] or [-0.066%; +0.066%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [83.308µs; 83.449µs] or [-0.084%; +0.084%] None None None
credit_card/is_card_number/ 378282246310005 throughput [11983935.447op/s; 12004010.386op/s] or [-0.084%; +0.084%] None None None
credit_card/is_card_number/37828224631 execution_time [3.913µs; 3.914µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/37828224631 throughput [255500348.874op/s; 255556097.828op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/378282246310005 execution_time [69.679µs; 69.774µs] or [-0.068%; +0.068%] None None None
credit_card/is_card_number/378282246310005 throughput [14332423.643op/s; 14351845.544op/s] or [-0.068%; +0.068%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.223µs; 52.232µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19145232.283op/s; 19148783.591op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.036µs; 6.039µs] or [-0.024%; +0.024%] None None None
credit_card/is_card_number/x371413321323331 throughput [165586667.848op/s; 165664375.031op/s] or [-0.023%; +0.023%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.912µs; 3.913µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ throughput [255575000.348op/s; 255624784.741op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [64.410µs; 64.455µs] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15514785.566op/s; 15525569.434op/s] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [58.401µs; 58.442µs] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17111118.172op/s; 17123028.045op/s] or [-0.035%; +0.035%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.912µs; 3.913µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255547877.319op/s; 255599685.193op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [54.897µs; 54.976µs] or [-0.072%; +0.072%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18190405.449op/s; 18216360.391op/s] or [-0.071%; +0.071%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.219µs; 52.228µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19146770.488op/s; 19150285.065op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.038µs; 6.042µs] or [-0.028%; +0.028%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165519061.772op/s; 165609473.049op/s] or [-0.027%; +0.027%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample2_frames_x1000 execution_time 727.578µs 728.915µs ± 0.578µs 728.821µs ± 0.361µs 729.251µs 729.993µs 730.351µs 730.900µs 0.29% 0.567 0.261 0.08% 0.041µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample2_frames_x1000 execution_time [728.835µs; 728.995µs] or [-0.011%; +0.011%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sdk_test_data/rules-based execution_time 144.953µs 147.037µs ± 1.965µs 146.668µs ± 0.566µs 147.248µs 149.425µs 155.647µs 161.234µs 9.93% 4.209 22.798 1.33% 0.139µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sdk_test_data/rules-based execution_time [146.765µs; 147.310µs] or [-0.185%; +0.185%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 533.880µs 534.791µs ± 0.810µs 534.733µs ± 0.228µs 534.943µs 535.491µs 536.223µs 544.605µs 1.85% 9.031 106.348 0.15% 0.057µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1836193.006op/s 1869894.710op/s ± 2793.113op/s 1870093.720op/s ± 797.096op/s 1870948.674op/s 1872164.737op/s 1872844.309op/s 1873080.918op/s 0.16% -8.910 104.372 0.15% 197.503op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 386.144µs 387.528µs ± 0.438µs 387.563µs ± 0.272µs 387.801µs 388.265µs 388.386µs 388.504µs 0.24% -0.479 0.613 0.11% 0.031µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2573975.470op/s 2580460.010op/s ± 2916.696op/s 2580222.943op/s ± 1809.247op/s 2582081.889op/s 2585871.139op/s 2588391.663op/s 2589705.028op/s 0.37% 0.487 0.626 0.11% 206.242op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 189.931µs 190.285µs ± 0.163µs 190.282µs ± 0.114µs 190.388µs 190.567µs 190.685µs 190.739µs 0.24% 0.373 -0.244 0.09% 0.011µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5242771.103op/s 5255271.328op/s ± 4486.962op/s 5255345.409op/s ± 3154.227op/s 5258666.578op/s 5262162.412op/s 5262944.477op/s 5265079.649op/s 0.19% -0.369 -0.249 0.09% 317.276op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.401µs 37.542µs ± 0.061µs 37.537µs ± 0.034µs 37.580µs 37.645µs 37.695µs 37.792µs 0.68% 0.479 1.084 0.16% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26460580.744op/s 26636895.564op/s ± 43359.305op/s 26640577.945op/s ± 24483.184op/s 26660617.254op/s 26709790.048op/s 26725375.409op/s 26737453.013op/s 0.36% -0.465 1.054 0.16% 3065.966op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.828µs 45.961µs ± 0.127µs 45.949µs ± 0.047µs 45.998µs 46.075µs 46.124µs 47.513µs 3.40% 9.109 108.333 0.28% 0.009µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21047058.416op/s 21757770.207op/s ± 58841.287op/s 21763359.257op/s ± 22301.535op/s 21784502.978op/s 21806507.011op/s 21816492.350op/s 21820768.571op/s 0.26% -8.883 104.670 0.27% 4160.707op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time [534.678µs; 534.903µs] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1869507.611op/s; 1870281.808op/s] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [387.468µs; 387.589µs] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2580055.784op/s; 2580864.236op/s] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [190.263µs; 190.308µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5254649.478op/s; 5255893.178op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.534µs; 37.550µs] or [-0.023%; +0.023%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26630886.381op/s; 26642904.747op/s] or [-0.023%; +0.023%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.943µs; 45.979µs] or [-0.038%; +0.038%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21749615.370op/s; 21765925.043op/s] or [-0.037%; +0.037%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
ip_address/quantize_peer_ip_address_benchmark execution_time 4.927µs 5.002µs ± 0.041µs 4.983µs ± 0.029µs 5.047µs 5.062µs 5.067µs 5.068µs 1.71% 0.274 -1.451 0.83% 0.003µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [4.996µs; 5.007µs] or [-0.115%; +0.115%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching serializing traces from their internal representation to msgpack execution_time 13.992ms 14.042ms ± 0.026ms 14.038ms ± 0.011ms 14.049ms 14.067ms 14.155ms 14.197ms 1.13% 3.147 13.408 0.18% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching serializing traces from their internal representation to msgpack execution_time [14.039ms; 14.046ms] or [-0.026%; +0.026%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
write only interface execution_time 1.174µs 3.199µs ± 1.437µs 2.974µs ± 0.030µs 3.004µs 3.648µs 13.818µs 15.192µs 410.83% 7.338 55.268 44.80% 0.102µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [3.000µs; 3.398µs] or [-6.224%; +6.224%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time 185.111µs 185.594µs ± 0.336µs 185.555µs ± 0.160µs 185.714µs 186.002µs 187.118µs 188.141µs 1.39% 3.757 22.957 0.18% 0.024µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 5315174.571op/s 5388134.189op/s ± 9676.772op/s 5389238.788op/s ± 4656.572op/s 5393734.351op/s 5397980.046op/s 5401223.202op/s 5402172.132op/s 0.24% -3.699 22.416 0.18% 684.251op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 17.865µs 17.960µs ± 0.048µs 17.953µs ± 0.033µs 17.993µs 18.045µs 18.066µs 18.077µs 0.69% 0.262 -0.512 0.26% 0.003µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 55317447.774op/s 55680044.573op/s ± 147248.432op/s 55700045.426op/s ± 101454.005op/s 55779382.698op/s 55916173.106op/s 55964634.570op/s 55974265.009op/s 0.49% -0.251 -0.518 0.26% 10412.036op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.317µs 10.374µs ± 0.034µs 10.364µs ± 0.017µs 10.386µs 10.447µs 10.492µs 10.515µs 1.46% 1.541 2.680 0.33% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 95103331.210op/s 96393766.100op/s ± 318282.485op/s 96488935.759op/s ± 156298.973op/s 96622989.904op/s 96713623.465op/s 96820102.250op/s 96925408.555op/s 0.45% -1.518 2.584 0.33% 22505.970op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time [185.547µs; 185.640µs] or [-0.025%; +0.025%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [5386793.081op/s; 5389475.296op/s] or [-0.025%; +0.025%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [17.953µs; 17.966µs] or [-0.037%; +0.037%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [55659637.357op/s; 55700451.790op/s] or [-0.037%; +0.037%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.369µs; 10.379µs] or [-0.046%; +0.046%] None None None
normalization/normalize_name/normalize_name/good throughput [96349655.209op/s; 96437876.991op/s] or [-0.046%; +0.046%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sql/obfuscate_sql_string execution_time 89.889µs 90.085µs ± 0.132µs 90.070µs ± 0.051µs 90.122µs 90.244µs 90.371µs 91.254µs 1.31% 5.104 38.714 0.15% 0.009µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [90.067µs; 90.103µs] or [-0.020%; +0.020%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
single_flag_killswitch/rules-based execution_time 188.416ns 190.667ns ± 1.688ns 190.543ns ± 1.204ns 191.593ns 193.952ns 196.504ns 197.543ns 3.67% 1.180 1.802 0.88% 0.119ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
single_flag_killswitch/rules-based execution_time [190.433ns; 190.901ns] or [-0.123%; +0.123%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
receiver_entry_point/report/2597 execution_time 3.317ms 3.344ms ± 0.013ms 3.342ms ± 0.008ms 3.351ms 3.368ms 3.381ms 3.415ms 2.18% 1.206 3.495 0.40% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
receiver_entry_point/report/2597 execution_time [3.342ms; 3.346ms] or [-0.055%; +0.055%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0af80fa 1772456387 yannham/process-context-sharing
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
concentrator/add_spans_to_concentrator execution_time 10.599ms 10.637ms ± 0.024ms 10.636ms ± 0.010ms 10.646ms 10.664ms 10.698ms 10.857ms 2.08% 4.549 36.003 0.23% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
concentrator/add_spans_to_concentrator execution_time [10.634ms; 10.641ms] or [-0.032%; +0.032%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 80.60606% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.18%. Comparing base (d4c7824) to head (0af80fa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1585      +/-   ##
==========================================
+ Coverage   71.08%   71.18%   +0.09%     
==========================================
  Files         424      425       +1     
  Lines       62493    62666     +173     
==========================================
+ Hits        44426    44609     +183     
+ Misses      18067    18057      -10     
Components Coverage Δ
libdd-crashtracker 63.02% <ø> (ø)
libdd-crashtracker-ffi 15.63% <ø> (-0.47%) ⬇️
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 87.38% <ø> (-0.45%) ⬇️
libdd-data-pipeline-ffi 72.83% <ø> (-1.81%) ⬇️
libdd-common 79.73% <ø> (ø)
libdd-common-ffi 73.40% <ø> (ø)
libdd-telemetry 62.48% <ø> (ø)
libdd-telemetry-ffi 16.75% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 80.74% <ø> (ø)
libdd-profiling 81.60% <ø> (ø)
libdd-profiling-ffi 63.65% <ø> (ø)
datadog-sidecar 33.45% <ø> (+1.19%) ⬆️
datdog-sidecar-ffi 12.41% <ø> (+5.21%) ⬆️
spawn-worker 54.69% <ø> (ø)
libdd-tinybytes 93.16% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 94.67% <ø> (ø)
libdd-trace-protobuf 68.00% <ø> (ø)
libdd-trace-utils 88.97% <ø> (-0.21%) ⬇️
datadog-tracer-flare 90.45% <ø> (+1.49%) ⬆️
libdd-log 74.69% <ø> (ø)
🚀 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.

@yannham yannham force-pushed the yannham/process-context-sharing branch from 6598cc3 to 43208fe Compare February 19, 2026 17:29
rand = "0.8.3"
rmp = "0.8.14"
rmp-serde = "1.3.0"
rustix = { version = "1.1.3", features = ["param", "mm", "process"] }
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.

why rustix rather than the libc crate?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

IMHO it's higher-level and a nicer to use than libc (for example memfd_create returns a Result and an RAII file descriptor that is automatically closed upon drop, while the one from libc returns a c_int, etc.). I saw a bunch of occurrences already in Cargo.lock and thought it was pulled already anyway. But upon scrutiny it seems that the 1.1.3 major version bucket is mostly used by tempfile, which is a dev dependency most of the time? So maybe this is actually pulling some additional stuff.

There are a bunch of other dependencies that use the 0.38 version of rustix, so I can also downgrade to this one. But it's just a slight QoL improvement; happy to switch to libc if you think it's better for whatever reason.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might be worth giving a quick check on the size of the resulting builds (I thought we had a github action that posted that but I'm not seeing it?).

In particular, we don't have a specific set target size that we need to stay under, but for many reasons we often have to ship variants so 1 MiB extra does add up if we need to ship e.g. N architectures and M versions.


Having said that, I feel like I'd seen rustix before but hadn't paid a lot of attention to it.

Looking at https://crates.io/crates/rustix it lists that it can work even without libc and that's amazing! If we could drop libc as a dependency from libdatadog would be super-unlock, since one situation where we end up needing to repeat builds is sometimes needing to have builds for both for glibc AND musl.

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.

If we could drop libc as a dependency from libdatadog would be super-unlock, since one situation where we end up needing to repeat builds is sometimes needing to have builds for both for glibc AND musl.

That's not really possible, because std uses libc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's not really possible, because std uses libc

Yeah, I know. Rust is very disapponting in this :P

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The CI comment on artifact size seems to point at it being the same ( #1585 (comment) ) so no strong feelings here -- any concerns with keeping as-is @paullegranddc ?

@yannham yannham force-pushed the yannham/process-context-sharing branch 2 times, most recently from fedbeb2 to 74d2641 Compare February 20, 2026 16:38
Copy link
Copy Markdown
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

Did a pass on it! Sorry from my part if there is a bit of a confusion with older versions of the spec being implemented, I'll make sure to keep a close eye on the libdatadog impl so it doesn't fall behind while things are still sometimes moving in the spec.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts bot commented Feb 23, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 97.30 MB 97.30 MB +0% (+1.03 KB) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.51 MB 8.51 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.12 MB 11.12 MB +0% (+304 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 112.92 MB 112.92 MB +0% (+7.26 KB) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 27.16 MB 27.16 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 76.26 KB 76.26 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 185.98 MB 185.98 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 916.65 MB 916.65 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.93 MB 9.93 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 76.26 KB 76.26 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 24.76 MB 24.76 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.43 MB 51.43 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 22.97 MB 22.97 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 77.44 KB 77.44 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 190.13 MB 190.16 MB +.01% (+24.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 900.31 MB 900.31 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 7.53 MB 7.53 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 77.44 KB 77.44 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 26.52 MB 26.52 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 47.06 MB 47.06 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 85.27 MB 85.27 MB +0% (+456 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 10.04 MB 10.04 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 105.89 MB 105.90 MB +0% (+2.97 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.79 MB 11.79 MB 0% (0 B) 👌

Copy link
Copy Markdown
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

Left a few more comments! I think this is pretty much good to go (once undrafted and CI is happy)

rand = "0.8.3"
rmp = "0.8.14"
rmp-serde = "1.3.0"
rustix = { version = "1.1.3", features = ["param", "mm", "process"] }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The CI comment on artifact size seems to point at it being the same ( #1585 (comment) ) so no strong feelings here -- any concerns with keeping as-is @paullegranddc ?

@yannham yannham requested a review from a team as a code owner March 2, 2026 13:14
@yannham yannham requested review from vpellan and removed request for a team March 2, 2026 13:14
Copy link
Copy Markdown
Member

@ivoanjo ivoanjo left a comment

Choose a reason for hiding this comment

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

👍 LGTM.

We discussed and are aware these will be needed as follow-ups:

  • Support for updates
  • Support for forks
  • Actually wiring it up

...but I think as-is this PR is good to go and we can build atop it

@yannham
Copy link
Copy Markdown
Contributor Author

yannham commented Mar 2, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 bot commented Mar 2, 2026

View all feedbacks in Devflow UI.

2026-03-02 15:08:47 UTC ℹ️ Start processing command /merge


2026-03-02 15:08:53 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 48m (p90).


2026-03-02 15:49:46 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot merged commit 8fb3175 into main Mar 2, 2026
84 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot deleted the yannham/process-context-sharing branch March 2, 2026 15:49
gh-worker-dd-mergequeue-cf854d bot pushed a commit that referenced this pull request Mar 4, 2026
# What does this PR do?

This PR implements the missing update sequence of the [OTel process context](open-telemetry/opentelemetry-specification#4719). This allows for modification of an already published OTel process context.

# Motivation

This PR is a planned follow-up of #1585, which was knowingly incomplete: it could publish a fresh context, but wouldn't be able to update the context. This PR implements the missing update functionality. See the OTEP spec mentioned above for more information about the general motivation.

# Additional Notes

This only part of #1585 follow-ups. In particular, it does not handle forks (where we should publish a new context instead of updating it if there's been a fork since last publication), which is left for a follow-up.

# How to test the change?

This PR includes a test for the update sequence. It could also be hooked up in workflow where any reader implementation of the OTEP spec could try to read a published/updated context.

Co-authored-by: yann.hamdaoui <[email protected]>
gh-worker-dd-mergequeue-cf854d bot pushed a commit that referenced this pull request Mar 5, 2026
Depends #1640

# What does this PR do?

This PR is a follow up of #1585 and #1640 which implement OTel process context publication. It adds a proper handling of the case of publishing a new context after a `fork`.

# Motivation

Some language runtimes (e.g. Python or Ruby) resorts to `fork`. In this case, the OTel process context of the child must be re-published (the process context of the parent is explicitly NOT inherited through `MADVISE_DONTFORK`). However, since they share the same copy of the static handler, prior to this PR, the publication would try to access the non-inherited mapping, potentially causing a crash.

This PR properly handles this case by storing the PID of the publisher, so that upon update, we can detect if there's been a fork since (and we are a child), in which case we can re-create a mapping from scratch.

# How to test the change?

There is currently no test, because having tests that `fork` is not trivial to set up in the current Rust test framework (it is admittedly possible, but is a larger question that should be treated separately IMHO). However, two follow-up PRs are coming with an FFI and libdatadog-side protobuf encoding of the payload, which will make it possible to test the fork behavior e.g. from Ruby, once they land.

Co-authored-by: yann.hamdaoui <[email protected]>
gh-worker-dd-mergequeue-cf854d bot pushed a commit that referenced this pull request Mar 5, 2026
Depends #1650

# What does this PR do?

Follow-up of #1585 #1640 #1650

Adds the protobuf definition for the OTel process context and associated messages, and make the interface of the publisher higher-level by taking the new structured `ProcessContext` value instead of a raw bytes payload.

# Motivation

Since libdatadog is already taking care of some protobuf encoding, and it's supposedly faster and simpler to do here rather than on the side of each language runtime, it makes sense to offer an interface with a struct that is encoded by libdatadog. The process context will be a `ProcessContext`-based opaque pointer on the FFI side, with proper setters/getters.

# Additional Notes

I was not sure where to put the protobuf definition, as there are a bunch of protobuf-dedicated crates in libdatadog. I feel like the OTel process context is about tracing metadata, but I'm happy to move it elsewhere if it makes more sense.

# How to test the change?

Once the FFI lands, we'll be able to publish the context from a language runtime and check the whole process end-to-end. For now, I feel like an additional test would mostly test `prost`, which isn't very valuable.

Co-authored-by: yann.hamdaoui <[email protected]>
gh-worker-dd-mergequeue-cf854d bot pushed a commit that referenced this pull request Mar 5, 2026
# What does this PR do?
[feat: process context publication](#1585)
[ci: pass macos label to downstream project](#1647)
[chore: implement otel process ctx update](#1640)
[chore(crashtracking): emit a best effort stacktrace for Mac](#1645)
[ci: remove depth so it can cause problems when getting the diffs](#1657)
[build(macOS): set the LC_ID_DYLIB for mac binaries to set correct name for linking](#1646)
[chore(ci): fix crashtracker receiver binary rpath setting](#1652)
[chore(deps): bump blazesym to 0.2.3 and blazesym-c to 0.1.7](#1654)
[feat: otel process ctxt protobuf encoding](#1651)
[chore(crashtracker): fix benchmark job](#1664)
# Motivation

What inspired you to submit this pull request?

# Additional Notes

Anything else we should know when reviewing?

# How to test the change?

Describe here in detail how the change can be validated.


Co-authored-by: gyuheon.oh <[email protected]>
gh-worker-dd-mergequeue-cf854d bot pushed a commit that referenced this pull request Mar 9, 2026
Depends #1653 

# What does this PR do?

This is the final follow-up of #1585 (and sequels) for OTel process context publication. This hooks the OTel process context sharing in the existing `store_tracer_metadata`, which now publishes using both "protocols".

# Motivation

This makes the OTel process context publication happen automatically for existing users of libdatadog that would publish tracer metadata already, in a transparent way.

# Additional Notes

N/A

# How to test the change?

Expected to be tested thereafter for Ruby.

Co-authored-by: yann.hamdaoui <[email protected]>
iunanua pushed a commit that referenced this pull request Mar 13, 2026
# Release proposal for libdd-library-config and its dependencies

This PR contains version bumps based on public API changes and commits
since last release.

## libdd-trace-protobuf
**Next version:** `2.0.0`

**Semver bump:** `major`
**Tag:** `libdd-trace-protobuf-v2.0.0`

### Commits

- feat(trace-protobuf)!: Add two fields to ClientGroupedStats
[SVLS-8627] (#1630)
- feat: otel process ctxt protobuf encoding (#1651)
## libdd-library-config
**Next version:** `1.1.0`

**Semver bump:** `minor`
**Tag:** `libdd-library-config-v1.1.0`

### Commits

- chore: update otel process ctx protocol (#1713)
- feat: publish tracer metadata as OTel process ctx (#1658)
- feat: otel process ctxt protobuf encoding (#1651)
- fix: handle fork in otel process ctx (#1650)
- chore: implement otel process ctx update (#1640)
- feat: process context publication (#1585)
- ci: update nightly in CI to 2026-02-08 (#1539)
- fix(stable_config): [APMAPI-1690] add >100mb check for stable config
files (#1432)
- chore: add changelog for every published crate (#1396)

[SVLS-8627]:
https://datadoghq.atlassian.net/browse/SVLS-8627?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[APMAPI-1690]:
https://datadoghq.atlassian.net/browse/APMAPI-1690?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: dd-octo-sts[bot] <200755185+dd-octo-sts[bot]@users.noreply.github.com>
hoolioh pushed a commit that referenced this pull request Mar 13, 2026
# Release proposal for libdd-library-config and its dependencies

This PR contains version bumps based on public API changes and commits
since last release.

## libdd-trace-protobuf
**Next version:** `2.0.0`

**Semver bump:** `major`
**Tag:** `libdd-trace-protobuf-v2.0.0`

### Commits

- feat(trace-protobuf)!: Add two fields to ClientGroupedStats
[SVLS-8627] (#1630)
- feat: otel process ctxt protobuf encoding (#1651)
## libdd-library-config
**Next version:** `1.1.0`

**Semver bump:** `minor`
**Tag:** `libdd-library-config-v1.1.0`

### Commits

- chore: update otel process ctx protocol (#1713)
- feat: publish tracer metadata as OTel process ctx (#1658)
- feat: otel process ctxt protobuf encoding (#1651)
- fix: handle fork in otel process ctx (#1650)
- chore: implement otel process ctx update (#1640)
- feat: process context publication (#1585)
- ci: update nightly in CI to 2026-02-08 (#1539)
- fix(stable_config): [APMAPI-1690] add >100mb check for stable config
files (#1432)
- chore: add changelog for every published crate (#1396)

[SVLS-8627]:
https://datadoghq.atlassian.net/browse/SVLS-8627?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[APMAPI-1690]:
https://datadoghq.atlassian.net/browse/APMAPI-1690?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: dd-octo-sts[bot] <200755185+dd-octo-sts[bot]@users.noreply.github.com>
hoolioh added a commit that referenced this pull request Mar 15, 2026
# Release proposal for libdd-library-config and its dependencies

This PR contains version bumps based on public API changes and commits
since last release.

## libdd-trace-protobuf
**Next version:** `2.0.0`

**Semver bump:** `major`
**Tag:** `libdd-trace-protobuf-v2.0.0`

### Commits

- feat(trace-protobuf)!: Add two fields to ClientGroupedStats
[SVLS-8627] (#1630)
- feat: otel process ctxt protobuf encoding (#1651) ##
libdd-library-config
**Next version:** `1.1.0`

**Semver bump:** `minor`
**Tag:** `libdd-library-config-v1.1.0`

### Commits

- chore: update otel process ctx protocol (#1713)
- feat: publish tracer metadata as OTel process ctx (#1658)
- feat: otel process ctxt protobuf encoding (#1651)
- fix: handle fork in otel process ctx (#1650)
- chore: implement otel process ctx update (#1640)
- feat: process context publication (#1585)
- ci: update nightly in CI to 2026-02-08 (#1539)
- fix(stable_config): [APMAPI-1690] add >100mb check for stable config
files (#1432)
- chore: add changelog for every published crate (#1396)

[SVLS-8627]:

https://datadoghq.atlassian.net/browse/SVLS-8627?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[APMAPI-1690]:

https://datadoghq.atlassian.net/browse/APMAPI-1690?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

# What does this PR do?

A brief description of the change being made with this pull request.

# Motivation

What inspired you to submit this pull request?

# Additional Notes

Anything else we should know when reviewing?

# How to test the change?

Describe here in detail how the change can be validated.


[SVLS-8627]:
https://datadoghq.atlassian.net/browse/SVLS-8627?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[APMAPI-1690]:
https://datadoghq.atlassian.net/browse/APMAPI-1690?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SVLS-8627]:
https://datadoghq.atlassian.net/browse/SVLS-8627?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: dd-octo-sts[bot] <200755185+dd-octo-sts[bot]@users.noreply.github.com>
hoolioh pushed a commit that referenced this pull request Mar 15, 2026
# Release proposal for libdd-library-config and its dependencies

This PR contains version bumps based on public API changes and commits
since last release.

## libdd-trace-protobuf
**Next version:** `2.0.0`

**Semver bump:** `major`
**Tag:** `libdd-trace-protobuf-v2.0.0`

### Commits

- feat(trace-protobuf)!: Add two fields to ClientGroupedStats
[SVLS-8627] (#1630)
- feat: otel process ctxt protobuf encoding (#1651)
## libdd-library-config
**Next version:** `1.1.0`

**Semver bump:** `minor`
**Tag:** `libdd-library-config-v1.1.0`

### Commits

- chore: update otel process ctx protocol (#1713)
- feat: publish tracer metadata as OTel process ctx (#1658)
- feat: otel process ctxt protobuf encoding (#1651)
- fix: handle fork in otel process ctx (#1650)
- chore: implement otel process ctx update (#1640)
- feat: process context publication (#1585)
- ci: update nightly in CI to 2026-02-08 (#1539)
- fix(stable_config): [APMAPI-1690] add >100mb check for stable config
files (#1432)
- chore: add changelog for every published crate (#1396)

[SVLS-8627]:
https://datadoghq.atlassian.net/browse/SVLS-8627?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[APMAPI-1690]:
https://datadoghq.atlassian.net/browse/APMAPI-1690?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: dd-octo-sts[bot] <200755185+dd-octo-sts[bot]@users.noreply.github.com>
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