Skip to content

feat: otel process ctxt FFI#1653

Closed
yannham wants to merge 4 commits intoyannham/process-context-protobuffrom
yannham/process-context-ffi
Closed

feat: otel process ctxt FFI#1653
yannham wants to merge 4 commits intoyannham/process-context-protobuffrom
yannham/process-context-ffi

Conversation

@yannham
Copy link
Copy Markdown
Contributor

@yannham yannham commented Mar 4, 2026

Depends #1651

What does this PR do?

This adds an FFI for the creating, populating, publishing, unpublishing and freeing the OTel process context.

Motivation

The OTel process context publication facilities are supposed to be used from language runtimes, so a FFI is needed for it to be used at all.

Additional Notes

N/A

How to test the change?

Bind to libdd and use the newly added FFI functions.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

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.

@yannham yannham force-pushed the yannham/process-context-protobuf branch from a843b3c to bd4ba00 Compare March 4, 2026 16:24
@yannham yannham force-pushed the yannham/process-context-ffi branch from 4a2da93 to 4da1360 Compare March 4, 2026 16:25
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 0% with 166 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.00%. Comparing base (b696b76) to head (fd75898).

Additional details and impacted files
@@                         Coverage Diff                          @@
##           yannham/process-context-protobuf    #1653      +/-   ##
====================================================================
- Coverage                             71.19%   71.00%   -0.19%     
====================================================================
  Files                                   425      426       +1     
  Lines                                 62727    62893     +166     
====================================================================
- Hits                                  44661    44660       -1     
- Misses                                18066    18233     +167     
Components Coverage Δ
libdd-crashtracker 62.90% <ø> (ø)
libdd-crashtracker-ffi 15.63% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 87.38% <ø> (ø)
libdd-data-pipeline-ffi 72.83% <ø> (ø)
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% <ø> (+0.01%) ⬆️
libdd-profiling-ffi 63.65% <ø> (ø)
datadog-sidecar 33.45% <ø> (ø)
datdog-sidecar-ffi 12.41% <ø> (ø)
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% <ø> (ø)
datadog-tracer-flare 90.45% <ø> (ø)
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.

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 4, 2026

Benchmarks

Comparison

Benchmark execution time: 2026-03-05 11:05:37

Comparing candidate commit fd75898 in PR branch yannham/process-context-ffi with baseline commit b696b76 in branch yannham/process-context-protobuf.

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

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 fd75898 1772707587 yannham/process-context-ffi
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.921µs 5.013µs ± 0.058µs 5.003µs ± 0.045µs 5.050µs 5.111µs 5.113µs 5.116µs 2.25% 0.417 -1.174 1.16% 0.004µ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 [5.005µs; 5.021µs] or [-0.161%; +0.161%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.981ms 14.035ms ± 0.034ms 14.027ms ± 0.013ms 14.044ms 14.082ms 14.130ms 14.287ms 1.85% 3.553 20.663 0.24% 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.030ms; 14.040ms] or [-0.034%; +0.034%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.332µs 146.417µs ± 1.652µs 146.190µs ± 0.567µs 146.742µs 148.286µs 152.514µs 162.190µs 10.94% 5.411 43.355 1.13% 0.117µ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.188µs; 146.646µs] or [-0.156%; +0.156%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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 17.963µs 25.896µs ± 9.900µs 18.295µs ± 0.247µs 34.603µs 43.784µs 51.044µs 61.029µs 233.59% 0.900 -0.247 38.14% 0.700µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [24.524µs; 27.268µs] or [-5.299%; +5.299%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.109µs 185.679µs ± 0.284µs 185.670µs ± 0.228µs 185.900µs 186.157µs 186.263µs 186.642µs 0.52% 0.254 -0.439 0.15% 0.020µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 5357864.495op/s 5385639.716op/s ± 8222.437op/s 5385894.276op/s ± 6625.343op/s 5392493.481op/s 5398105.307op/s 5399952.796op/s 5402208.612op/s 0.30% -0.247 -0.451 0.15% 581.414op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 17.918µs 18.008µs ± 0.046µs 18.002µs ± 0.034µs 18.042µs 18.087µs 18.125µs 18.129µs 0.71% 0.299 -0.571 0.25% 0.003µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 55160061.520op/s 55532351.876op/s ± 140327.449op/s 55548942.652op/s ± 106210.086op/s 55642923.001op/s 55730718.373op/s 55796347.799op/s 55808334.482op/s 0.47% -0.289 -0.582 0.25% 9922.649op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.259µs 10.361µs ± 0.038µs 10.358µs ± 0.024µs 10.384µs 10.426µs 10.480µs 10.487µs 1.25% 0.550 0.841 0.37% 0.003µs 1 200
normalization/normalize_name/normalize_name/good throughput 95352366.725op/s 96518292.482op/s ± 354729.414op/s 96544723.066op/s ± 226950.977op/s 96749190.561op/s 97052115.540op/s 97296899.100op/s 97479778.485op/s 0.97% -0.523 0.797 0.37% 25083.157op/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.640µs; 185.719µs] or [-0.021%; +0.021%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [5384500.166op/s; 5386779.267op/s] or [-0.021%; +0.021%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.001µs; 18.014µs] or [-0.035%; +0.035%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [55512903.841op/s; 55551799.910op/s] or [-0.035%; +0.035%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.356µs; 10.366µs] or [-0.051%; +0.051%] None None None
normalization/normalize_name/normalize_name/good throughput [96469130.397op/s; 96567454.568op/s] or [-0.051%; +0.051%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.688µs 34.132µs ± 0.725µs 33.798µs ± 0.039µs 33.885µs 35.652µs 35.698µs 37.234µs 10.17% 1.822 1.879 2.12% 0.051µ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 [34.031µs; 34.232µs] or [-0.294%; +0.294%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.894µs 3.912µs ± 0.002µs 3.912µs ± 0.001µs 3.913µs 3.916µs 3.917µs 3.918µs 0.15% -2.078 18.659 0.06% 0.000µs 1 200
credit_card/is_card_number/ throughput 255229050.099op/s 255612526.228op/s ± 147131.816op/s 255617420.337op/s ± 78032.558op/s 255695553.428op/s 255777870.493op/s 255851240.545op/s 256783721.600op/s 0.46% 2.106 18.912 0.06% 10403.790op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 78.954µs 79.715µs ± 0.392µs 79.664µs ± 0.262µs 79.946µs 80.353µs 80.847µs 81.323µs 2.08% 0.886 1.206 0.49% 0.028µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12296639.446op/s 12544919.825op/s ± 61467.048op/s 12552791.534op/s ± 41211.493op/s 12590926.674op/s 12625817.399op/s 12647953.889op/s 12665553.103op/s 0.90% -0.851 1.092 0.49% 4346.377op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 72.339µs 72.889µs ± 0.306µs 72.876µs ± 0.207µs 73.058µs 73.435µs 73.624µs 74.029µs 1.58% 0.599 0.249 0.42% 0.022µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13508294.339op/s 13719822.183op/s ± 57378.900op/s 13721867.172op/s ± 39140.899op/s 13765613.107op/s 13803346.491op/s 13812124.953op/s 13823825.535op/s 0.74% -0.575 0.191 0.42% 4057.301op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.897µs 3.913µs ± 0.003µs 3.913µs ± 0.001µs 3.914µs 3.917µs 3.920µs 3.932µs 0.49% 1.016 12.441 0.08% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254337241.032op/s 255560239.010op/s ± 196262.467op/s 255580920.884op/s ± 95462.439op/s 255657343.942op/s 255811446.067op/s 255870212.250op/s 256635756.249op/s 0.41% -0.985 12.385 0.08% 13877.852op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 69.170µs 69.672µs ± 0.322µs 69.594µs ± 0.214µs 69.864µs 70.258µs 70.676µs 70.955µs 1.95% 1.058 1.196 0.46% 0.023µs 1 200
credit_card/is_card_number/378282246310005 throughput 14093516.747op/s 14353342.379op/s ± 65957.431op/s 14368997.452op/s ± 44159.587op/s 14404962.517op/s 14430544.557op/s 14441481.481op/s 14457169.431op/s 0.61% -1.029 1.093 0.46% 4663.895op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 52.157µs 52.216µs ± 0.035µs 52.211µs ± 0.021µs 52.234µs 52.288µs 52.306µs 52.357µs 0.28% 0.943 1.077 0.07% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19099735.936op/s 19151110.259op/s ± 12793.030op/s 19153114.135op/s ± 7664.474op/s 19159756.850op/s 19168078.632op/s 19172463.320op/s 19173058.019op/s 0.10% -0.938 1.064 0.07% 904.604op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.030µs 6.041µs ± 0.011µs 6.038µs ± 0.003µs 6.041µs 6.072µs 6.078µs 6.078µs 0.66% 2.349 4.636 0.18% 0.001µs 1 200
credit_card/is_card_number/x371413321323331 throughput 164514745.578op/s 165536740.112op/s ± 298501.811op/s 165606392.413op/s ± 82318.305op/s 165691411.963op/s 165788170.402op/s 165826845.990op/s 165845401.441op/s 0.14% -2.343 4.614 0.18% 21107.265op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.895µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.917µs 3.920µs 3.921µs 0.20% -1.234 7.728 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255052198.887op/s 255574883.358op/s ± 184464.235op/s 255574468.111op/s ± 111702.708op/s 255681242.716op/s 255846613.291op/s 255934383.336op/s 256768811.631op/s 0.47% 1.252 7.847 0.07% 13043.591op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 63.918µs 64.417µs ± 0.176µs 64.413µs ± 0.095µs 64.494µs 64.751µs 64.931µs 65.082µs 1.04% 0.564 1.442 0.27% 0.012µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15365227.014op/s 15524012.647op/s ± 42288.466op/s 15524704.415op/s ± 22843.605op/s 15550891.451op/s 15585052.905op/s 15614768.964op/s 15645139.356op/s 0.78% -0.539 1.400 0.27% 2990.246op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 58.131µs 58.403µs ± 0.140µs 58.381µs ± 0.077µs 58.465µs 58.647µs 58.820µs 58.979µs 1.03% 1.031 1.896 0.24% 0.010µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16955047.044op/s 17122547.423op/s ± 40872.013op/s 17128903.916op/s ± 22745.098op/s 17150522.039op/s 17178741.823op/s 17192618.326op/s 17202540.815op/s 0.43% -1.011 1.826 0.24% 2890.088op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.893µs 3.913µs ± 0.003µs 3.912µs ± 0.001µs 3.914µs 3.919µs 3.920µs 3.921µs 0.22% -0.865 10.157 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255036267.555op/s 255571423.814op/s ± 189345.448op/s 255593841.283op/s ± 94421.991op/s 255676685.378op/s 255800556.707op/s 255860203.069op/s 256864076.679op/s 0.50% 0.890 10.327 0.07% 13388.745op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 54.633µs 55.089µs ± 0.317µs 55.039µs ± 0.233µs 55.300µs 55.633µs 55.960µs 56.312µs 2.31% 0.834 0.527 0.57% 0.022µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17758320.383op/s 18153191.881op/s ± 104117.364op/s 18169081.685op/s ± 76692.441op/s 18238646.338op/s 18287094.952op/s 18295602.732op/s 18303828.467op/s 0.74% -0.803 0.430 0.57% 7362.209op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 52.158µs 52.220µs ± 0.034µs 52.214µs ± 0.022µs 52.242µs 52.277µs 52.294µs 52.411µs 0.38% 1.164 3.984 0.06% 0.002µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19080112.024op/s 19149814.513op/s ± 12355.072op/s 19152053.791op/s ± 7899.990op/s 19158181.044op/s 19166861.072op/s 19170729.632op/s 19172619.582op/s 0.11% -1.155 3.929 0.06% 873.635op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.028µs 6.042µs ± 0.017µs 6.036µs ± 0.003µs 6.040µs 6.073µs 6.112µs 6.149µs 1.86% 3.131 12.012 0.27% 0.001µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 162639832.175op/s 165513171.948op/s ± 450572.715op/s 165661859.922op/s ± 79462.670op/s 165729639.132op/s 165797155.762op/s 165837862.047op/s 165880679.572op/s 0.13% -3.097 11.695 0.27% 31860.302op/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.912µs; 3.912µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/ throughput [255592135.174op/s; 255632917.283op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [79.661µs; 79.770µs] or [-0.068%; +0.068%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12536401.083op/s; 12553438.566op/s] or [-0.068%; +0.068%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [72.846µs; 72.931µs] or [-0.058%; +0.058%] None None None
credit_card/is_card_number/ 378282246310005 throughput [13711870.020op/s; 13727774.347op/s] or [-0.058%; +0.058%] None None None
credit_card/is_card_number/37828224631 execution_time [3.913µs; 3.913µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/37828224631 throughput [255533038.919op/s; 255587439.100op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/378282246310005 execution_time [69.627µs; 69.716µs] or [-0.064%; +0.064%] None None None
credit_card/is_card_number/378282246310005 throughput [14344201.314op/s; 14362483.445op/s] or [-0.064%; +0.064%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.211µs; 52.221µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19149337.268op/s; 19152883.250op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.039µs; 6.042µs] or [-0.025%; +0.025%] None None None
credit_card/is_card_number/x371413321323331 throughput [165495370.632op/s; 165578109.592op/s] or [-0.025%; +0.025%] 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 [255549318.390op/s; 255600448.327op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [64.392µs; 64.441µs] or [-0.038%; +0.038%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15518151.872op/s; 15529873.421op/s] or [-0.038%; +0.038%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [58.383µs; 58.422µs] or [-0.033%; +0.033%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17116882.955op/s; 17128211.890op/s] or [-0.033%; +0.033%] 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 [255545182.356op/s; 255597665.272op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [55.045µs; 55.133µs] or [-0.080%; +0.080%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18138762.216op/s; 18167621.546op/s] or [-0.079%; +0.079%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.215µs; 52.225µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19148102.219op/s; 19151526.807op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.040µs; 6.044µs] or [-0.038%; +0.038%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165450726.903op/s; 165575616.993op/s] or [-0.038%; +0.038%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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 48.742ms 49.090ms ± 0.939ms 49.000ms ± 0.134ms 49.094ms 49.239ms 51.532ms 60.143ms 22.74% 9.604 102.216 1.91% 0.066ms 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 [48.960ms; 49.220ms] or [-0.265%; +0.265%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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 240.219ns 250.535ns ± 13.156ns 243.781ns ± 2.052ns 254.346ns 280.127ns 291.751ns 298.946ns 22.63% 1.674 1.889 5.24% 0.930ns 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 [248.712ns; 252.358ns] or [-0.728%; +0.728%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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 534.314µs 535.190µs ± 0.589µs 535.058µs ± 0.269µs 535.403µs 536.312µs 537.502µs 537.999µs 0.55% 2.064 5.877 0.11% 0.042µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1858740.937op/s 1868496.437op/s ± 2050.559op/s 1868955.338op/s ± 939.368op/s 1869749.150op/s 1870689.594op/s 1871366.684op/s 1871557.435op/s 0.14% -2.052 5.817 0.11% 144.996op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 380.410µs 381.101µs ± 0.304µs 381.079µs ± 0.188µs 381.296µs 381.635µs 381.870µs 382.118µs 0.27% 0.326 0.215 0.08% 0.021µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2616993.848op/s 2623980.901op/s ± 2089.774op/s 2624125.111op/s ± 1293.822op/s 2625328.323op/s 2627506.403op/s 2628178.103op/s 2628743.874op/s 0.18% -0.321 0.210 0.08% 147.769op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 189.676µs 190.182µs ± 0.512µs 190.142µs ± 0.128µs 190.251µs 190.481µs 190.748µs 195.164µs 2.64% 8.047 72.552 0.27% 0.036µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5123905.225op/s 5258149.277op/s ± 13860.335op/s 5259215.258op/s ± 3553.789op/s 5263212.764op/s 5267068.144op/s 5270841.659op/s 5272152.571op/s 0.25% -7.968 71.562 0.26% 980.074op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.361µs 37.522µs ± 0.069µs 37.518µs ± 0.047µs 37.566µs 37.635µs 37.680µs 37.824µs 0.82% 0.498 0.927 0.18% 0.005µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26438444.142op/s 26650839.155op/s ± 48876.266op/s 26653989.099op/s ± 33696.429op/s 26687332.405op/s 26724868.137op/s 26738368.416op/s 26766023.847op/s 0.42% -0.484 0.882 0.18% 3456.074op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.803µs 45.921µs ± 0.216µs 45.884µs ± 0.030µs 45.937µs 46.018µs 46.292µs 48.107µs 4.85% 8.826 82.094 0.47% 0.015µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20786890.032op/s 21776759.563op/s ± 98563.196op/s 21794271.531op/s ± 14075.418op/s 21804451.622op/s 21818464.800op/s 21828463.264op/s 21832535.718op/s 0.18% -8.739 80.889 0.45% 6969.470op/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 [535.109µs; 535.272µs] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1868212.249op/s; 1868780.625op/s] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [381.059µs; 381.143µs] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2623691.278op/s; 2624270.524op/s] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [190.111µs; 190.253µs] or [-0.037%; +0.037%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5256228.368op/s; 5260070.186op/s] or [-0.037%; +0.037%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.513µs; 37.532µs] or [-0.025%; +0.025%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26644065.375op/s; 26657612.936op/s] or [-0.025%; +0.025%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.891µs; 45.951µs] or [-0.065%; +0.065%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21763099.652op/s; 21790419.474op/s] or [-0.063%; +0.063%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.105ms 3.133ms ± 0.015ms 3.131ms ± 0.008ms 3.139ms 3.158ms 3.180ms 3.200ms 2.21% 1.414 3.158 0.48% 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.131ms; 3.135ms] or [-0.067%; +0.067%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.226µs 3.208µs ± 1.419µs 2.992µs ± 0.026µs 3.025µs 3.666µs 13.817µs 15.020µs 402.00% 7.376 55.590 44.12% 0.100µ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.011µs; 3.404µs] or [-6.129%; +6.129%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.178ms 4.183ms ± 0.007ms 4.182ms ± 0.001ms 4.184ms 4.188ms 4.190ms 4.268ms 2.05% 11.327 144.434 0.16% 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.182ms; 4.184ms] or [-0.022%; +0.022%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.297µs 2.367µs ± 0.021µs 2.366µs ± 0.006µs 2.374µs 2.411µs 2.420µs 2.421µs 2.30% -0.657 2.999 0.89% 0.002µ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.364µs; 2.370µs] or [-0.124%; +0.124%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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.604ms 10.627ms ± 0.013ms 10.625ms ± 0.008ms 10.634ms 10.646ms 10.666ms 10.698ms 0.68% 1.816 6.989 0.12% 0.001ms 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.625ms; 10.629ms] or [-0.017%; +0.017%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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 90.371µs 90.610µs ± 0.224µs 90.579µs ± 0.065µs 90.655µs 90.778µs 90.988µs 93.400µs 3.11% 9.745 118.023 0.25% 0.016µ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.578µs; 90.641µs] or [-0.034%; +0.034%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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 160.810µs 161.695µs ± 0.298µs 161.650µs ± 0.165µs 161.848µs 162.177µs 162.632µs 163.189µs 0.95% 1.133 4.650 0.18% 0.021µ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 [161.654µs; 161.736µs] or [-0.026%; +0.026%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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 189.168ns 191.881ns ± 1.869ns 191.767ns ± 1.318ns 192.843ns 195.515ns 197.593ns 198.505ns 3.51% 0.970 1.075 0.97% 0.132ns 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 [191.622ns; 192.140ns] or [-0.135%; +0.135%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz fd75898 1772707587 yannham/process-context-ffi
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 729.315µs 730.530µs ± 0.463µs 730.491µs ± 0.309µs 730.819µs 731.332µs 731.695µs 731.847µs 0.19% 0.232 -0.164 0.06% 0.033µ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 [730.466µs; 730.594µs] or [-0.009%; +0.009%] None None None

Baseline

Omitted due to size.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts bot commented Mar 4, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.51 MB 8.57 MB +.73% (+64.04 KB) 🔍
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 97.30 MB 97.56 MB +.26% (+260.06 KB) 🔍
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.12 MB 11.13 MB +.12% (+13.78 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 112.92 MB 113.18 MB +.22% (+260.00 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 27.16 MB 27.18 MB +.04% (+13.00 KB) 🔍
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 76.26 KB 79.58 KB +4.35% (+3.32 KB) ⚠️
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 185.98 MB 186.11 MB +.07% (+136.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 916.65 MB 917.36 MB +.07% (+726.24 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.93 MB 9.94 MB +.09% (+10.00 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 76.26 KB 79.58 KB +4.35% (+3.32 KB) ⚠️
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 24.76 MB 24.79 MB +.09% (+24.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 51.43 MB 51.48 MB +.10% (+54.96 KB) 🔍
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 22.97 MB 22.98 MB +.04% (+11.50 KB) 🔍
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 77.44 KB 80.81 KB +4.35% (+3.36 KB) ⚠️
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 190.13 MB 190.32 MB +.09% (+192.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 900.31 MB 901.01 MB +.07% (+719.00 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 7.53 MB 7.54 MB +.11% (+8.50 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 77.44 KB 80.81 KB +4.35% (+3.36 KB) ⚠️
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 26.52 MB 26.55 MB +.08% (+24.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 47.06 MB 47.11 MB +.12% (+57.97 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 85.27 MB 85.51 MB +.28% (+245.45 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 10.04 MB 10.07 MB +.31% (+32.04 KB) 🔍
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 105.90 MB 106.13 MB +.22% (+242.84 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.79 MB 11.83 MB +.31% (+38.01 KB) 🔍

yannham added 3 commits March 5, 2026 11:25
Adds the process context protobuf definition, as well as a couple
definitions taken from opentelemetry that the context depends on.
The previous interface for process context publication was rather
low-level: the payload was taken as an arbitrary bag of bytes. However,
the shape of the payload is known and constrained: it has a protobuf
definition.

This commit makes the interface higher-level by taking a structured
process context instead, handling the protobuf encoding natively.
@yannham yannham force-pushed the yannham/process-context-protobuf branch from bd4ba00 to b696b76 Compare March 5, 2026 10:26
@yannham yannham force-pushed the yannham/process-context-ffi branch from 4da1360 to adb1ef1 Compare March 5, 2026 10:27
This adds an FFI for the creating, populating, publishing, unpublishing
and freeing the OTel process context.
@yannham yannham force-pushed the yannham/process-context-ffi branch from adb1ef1 to fd75898 Compare March 5, 2026 10:49
@yannham yannham force-pushed the yannham/process-context-protobuf branch from b696b76 to 157b0c5 Compare March 5, 2026 11:58
@yannham
Copy link
Copy Markdown
Contributor Author

yannham commented Mar 5, 2026

@ivoanjo mentions that actually #1658 is the preferred way to publish the OTel process context (automatically when setting the tracer's metadata), and that we don't need to expose it to the FFI extensively as done here. Closing for now; we can re-open in the future if this usage changes.

@yannham yannham closed this Mar 5, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants