Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(trace-utils): v05 events and span links serialization #980

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

paullegranddc
Copy link
Contributor

What does this PR do?

V05 format specifies fallback options for serializing events and span links inside of the meta field.

span_links fallback format spec

event fallback format spec

This PR should be fixing it

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.

@paullegranddc paullegranddc requested review from a team as code owners March 27, 2025 12:54
@pr-commenter
Copy link

pr-commenter bot commented Mar 27, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-03-27 14:59:30

Comparing candidate commit 798fba6 in PR branch paullgdc/trace-util/v05_event_span_links_ser with baseline commit a6d0f84 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 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 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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.193µs 3.244µs ± 1.441µs 3.050µs ± 0.024µs 3.070µs 3.705µs 14.078µs 15.051µs 393.56% 7.398 55.636 44.33% 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.044µs; 3.443µs] or [-6.159%; +6.159%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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 147.070µs 147.550µs ± 0.359µs 147.484µs ± 0.188µs 147.693µs 148.073µs 148.689µs 150.262µs 1.88% 2.871 16.284 0.24% 0.025µ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 [147.501µs; 147.600µs] 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 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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 245.983ns 255.281ns ± 11.014ns 249.897ns ± 2.827ns 259.135ns 279.616ns 284.777ns 285.909ns 14.41% 1.370 0.587 4.30% 0.779ns 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.754ns; 256.807ns] or [-0.598%; +0.598%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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 208.618µs 209.060µs ± 0.153µs 209.055µs ± 0.104µs 209.163µs 209.296µs 209.433µs 209.703µs 0.31% 0.348 1.148 0.07% 0.011µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4768652.784op/s 4783321.943op/s ± 3497.468op/s 4783427.974op/s ± 2378.778op/s 4785727.843op/s 4788527.454op/s 4791144.836op/s 4793440.656op/s 0.21% -0.341 1.134 0.07% 247.308op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.228µs 18.309µs ± 0.053µs 18.318µs ± 0.041µs 18.347µs 18.387µs 18.407µs 18.529µs 1.15% 0.170 0.071 0.29% 0.004µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 53969328.815op/s 54618730.968op/s ± 159080.844op/s 54591749.367op/s ± 120828.729op/s 54743379.297op/s 54857782.021op/s 54860273.743op/s 54861502.839op/s 0.49% -0.152 0.015 0.29% 11248.714op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.648µs 10.710µs ± 0.029µs 10.706µs ± 0.019µs 10.728µs 10.751µs 10.808µs 10.855µs 1.39% 1.084 3.453 0.27% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 92123184.287op/s 93369545.409op/s ± 254128.881op/s 93407815.289op/s ± 162520.768op/s 93537662.847op/s 93737782.561op/s 93853635.317op/s 93913739.508op/s 0.54% -1.050 3.302 0.27% 17969.625op/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 [209.039µs; 209.081µs] or [-0.010%; +0.010%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4782837.228op/s; 4783806.659op/s] or [-0.010%; +0.010%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.301µs; 18.316µs] or [-0.040%; +0.040%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [54596683.893op/s; 54640778.043op/s] or [-0.040%; +0.040%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.706µs; 10.714µs] or [-0.038%; +0.038%] None None None
normalization/normalize_name/normalize_name/good throughput [93334325.591op/s; 93404765.228op/s] or [-0.038%; +0.038%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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 503.908µs 505.562µs ± 0.634µs 505.560µs ± 0.284µs 505.844µs 506.232µs 506.635µs 511.552µs 1.19% 4.002 38.554 0.13% 0.045µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1954836.967op/s 1978000.620op/s ± 2467.661op/s 1978003.067op/s ± 1108.788op/s 1979127.571op/s 1981137.513op/s 1983538.259op/s 1984491.201op/s 0.33% -3.911 37.518 0.12% 174.490op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 462.247µs 463.080µs ± 0.905µs 462.965µs ± 0.202µs 463.168µs 463.677µs 464.007µs 471.709µs 1.89% 8.005 71.657 0.19% 0.064µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2119952.491op/s 2159463.306op/s ± 4153.853op/s 2159989.882op/s ± 943.437op/s 2160915.102op/s 2162002.796op/s 2162695.097op/s 2163345.324op/s 0.16% -7.949 70.960 0.19% 293.722op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 175.695µs 176.765µs ± 0.305µs 176.809µs ± 0.195µs 176.986µs 177.175µs 177.262µs 177.331µs 0.30% -0.806 0.555 0.17% 0.022µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5639170.393op/s 5657257.525op/s ± 9764.421op/s 5655820.298op/s ± 6230.114op/s 5662750.541op/s 5676632.630op/s 5683798.990op/s 5691681.607op/s 0.63% 0.816 0.581 0.17% 690.449op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.517µs 37.619µs ± 0.038µs 37.616µs ± 0.023µs 37.645µs 37.682µs 37.710µs 37.734µs 0.31% 0.155 0.150 0.10% 0.003µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26501012.739op/s 26582362.530op/s ± 26724.403op/s 26584119.883op/s ± 16167.725op/s 26599176.926op/s 26626914.541op/s 26647268.655op/s 26654289.985op/s 0.26% -0.149 0.149 0.10% 1889.701op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 48.202µs 48.319µs ± 0.048µs 48.316µs ± 0.028µs 48.343µs 48.395µs 48.434µs 48.608µs 0.60% 1.206 5.738 0.10% 0.003µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20572899.133op/s 20695801.752op/s ± 20599.579op/s 20696868.259op/s ± 12035.382op/s 20708967.992op/s 20724955.423op/s 20736750.551op/s 20745895.083op/s 0.24% -1.187 5.626 0.10% 1456.610op/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 [505.474µs; 505.650µs] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1977658.626op/s; 1978342.614op/s] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [462.954µs; 463.205µs] or [-0.027%; +0.027%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2158887.622op/s; 2160038.990op/s] or [-0.027%; +0.027%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [176.722µs; 176.807µs] or [-0.024%; +0.024%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5655904.270op/s; 5658610.780op/s] or [-0.024%; +0.024%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.614µs; 37.624µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26578658.785op/s; 26586066.275op/s] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [48.312µs; 48.326µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [20692946.848op/s; 20698656.655op/s] or [-0.014%; +0.014%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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 54.453ms 54.743ms ± 0.283ms 54.597ms ± 0.073ms 54.868ms 55.364ms 55.667ms 55.779ms 2.16% 1.477 1.654 0.52% 0.020ms 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 [54.704ms; 54.782ms] or [-0.072%; +0.072%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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 6.002ms 6.013ms ± 0.010ms 6.011ms ± 0.003ms 6.015ms 6.026ms 6.059ms 6.088ms 1.27% 4.410 25.768 0.17% 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 [6.012ms; 6.015ms] or [-0.024%; +0.024%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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.195µs 24.908µs ± 10.769µs 17.603µs ± 0.351µs 33.314µs 42.932µs 44.378µs 90.270µs 412.82% 2.027 7.613 43.13% 0.761µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [23.416µs; 26.401µs] or [-5.992%; +5.992%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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.896µs 3.914µs ± 0.003µs 3.914µs ± 0.001µs 3.915µs 3.918µs 3.919µs 3.919µs 0.15% -1.446 8.680 0.07% 0.000µs 1 200
credit_card/is_card_number/ throughput 255135182.203op/s 255501828.253op/s ± 174007.233op/s 255507652.455op/s ± 88919.488op/s 255587366.153op/s 255779563.243op/s 255918287.250op/s 256654921.481op/s 0.45% 1.464 8.805 0.07% 12304.169op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 82.114µs 82.567µs ± 0.279µs 82.548µs ± 0.188µs 82.720µs 83.062µs 83.332µs 83.648µs 1.33% 0.858 0.881 0.34% 0.020µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 11954799.882op/s 12111556.907op/s ± 40760.549op/s 12114115.771op/s ± 27521.113op/s 12143311.088op/s 12165291.637op/s 12176626.918op/s 12178214.392op/s 0.53% -0.836 0.815 0.34% 2882.206op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 76.038µs 76.956µs ± 0.343µs 76.912µs ± 0.196µs 77.153µs 77.570µs 77.810µs 78.035µs 1.46% 0.489 0.266 0.44% 0.024µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 12814839.663op/s 12994629.780op/s ± 57805.804op/s 13001938.658op/s ± 33259.637op/s 13030380.660op/s 13078474.905op/s 13112863.561op/s 13151259.208op/s 1.15% -0.462 0.238 0.44% 4087.488op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.893µs 3.914µs ± 0.003µs 3.914µs ± 0.002µs 3.916µs 3.919µs 3.921µs 3.922µs 0.20% -1.397 9.764 0.08% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254978365.260op/s 255476241.124op/s ± 205339.916op/s 255486484.771op/s ± 106877.681op/s 255579939.018op/s 255770373.926op/s 255962382.479op/s 256873192.714op/s 0.54% 1.421 9.934 0.08% 14519.725op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 72.946µs 73.620µs ± 0.352µs 73.586µs ± 0.257µs 73.843µs 74.204µs 74.456µs 74.610µs 1.39% 0.345 -0.436 0.48% 0.025µs 1 200
credit_card/is_card_number/378282246310005 throughput 13402978.891op/s 13583597.815op/s ± 64859.885op/s 13589514.332op/s ± 47353.576op/s 13636673.792op/s 13679705.992op/s 13699726.970op/s 13708763.962op/s 0.88% -0.325 -0.458 0.48% 4586.286op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 51.891µs 52.138µs ± 0.094µs 52.137µs ± 0.060µs 52.190µs 52.300µs 52.406µs 52.456µs 0.61% 0.312 0.513 0.18% 0.007µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19063751.369op/s 19179835.643op/s ± 34656.909op/s 19180171.539op/s ± 22034.803op/s 19202878.512op/s 19233532.414op/s 19251999.472op/s 19271288.350op/s 0.48% -0.299 0.496 0.18% 2450.614op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.479µs 6.646µs ± 0.067µs 6.639µs ± 0.043µs 6.685µs 6.759µs 6.790µs 6.801µs 2.44% -0.061 -0.287 1.00% 0.005µs 1 200
credit_card/is_card_number/x371413321323331 throughput 147038435.847op/s 150490737.231op/s ± 1507217.656op/s 150621499.076op/s ± 978467.219op/s 151553530.273op/s 153219827.449op/s 153581294.011op/s 154342099.623op/s 2.47% 0.112 -0.275 1.00% 106576.383op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.898µs 3.914µs ± 0.004µs 3.914µs ± 0.001µs 3.915µs 3.918µs 3.919µs 3.952µs 0.98% 5.444 62.206 0.09% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 253027494.763op/s 255500223.028op/s ± 235148.528op/s 255511733.472op/s ± 80637.875op/s 255588147.101op/s 255735828.053op/s 255892241.835op/s 256534014.694op/s 0.40% -5.348 61.117 0.09% 16627.512op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 63.630µs 63.929µs ± 0.143µs 63.903µs ± 0.084µs 63.995µs 64.207µs 64.395µs 64.566µs 1.04% 1.235 2.346 0.22% 0.010µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15488049.145op/s 15642345.741op/s ± 34867.725op/s 15648743.324op/s ± 20468.510op/s 15667373.481op/s 15681954.934op/s 15693429.627op/s 15715862.020op/s 0.43% -1.216 2.270 0.22% 2465.521op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 57.410µs 57.609µs ± 0.111µs 57.584µs ± 0.075µs 57.682µs 57.800µs 57.880µs 58.053µs 0.81% 0.856 0.820 0.19% 0.008µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 17225672.747op/s 17358405.106op/s ± 33501.055op/s 17365828.393op/s ± 22737.756op/s 17384962.011op/s 17400888.491op/s 17412705.043op/s 17418615.274op/s 0.30% -0.844 0.780 0.19% 2368.882op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.895µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.918µs 3.919µs 3.934µs 0.52% 0.156 11.314 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254211168.125op/s 255532016.563op/s ± 211957.968op/s 255526766.032op/s ± 99103.306op/s 255626233.644op/s 255869143.649op/s 255966915.171op/s 256733143.074op/s 0.47% -0.123 11.261 0.08% 14987.692op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 54.550µs 54.734µs ± 0.167µs 54.689µs ± 0.039µs 54.729µs 55.110µs 55.557µs 55.584µs 1.64% 2.891 9.436 0.30% 0.012µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17990848.852op/s 18270460.179op/s ± 55364.870op/s 18285368.050op/s ± 13150.119op/s 18298342.170op/s 18308983.854op/s 18322567.281op/s 18331655.102op/s 0.25% -2.864 9.232 0.30% 3914.888op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 51.864µs 52.184µs ± 0.110µs 52.184µs ± 0.072µs 52.256µs 52.373µs 52.425µs 52.486µs 0.58% 0.022 -0.097 0.21% 0.008µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19052629.814op/s 19162885.830op/s ± 40280.342op/s 19162831.772op/s ± 26496.792op/s 19189686.521op/s 19227387.013op/s 19249968.213op/s 19281363.498op/s 0.62% -0.010 -0.094 0.21% 2848.250op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.473µs 6.629µs ± 0.065µs 6.629µs ± 0.045µs 6.676µs 6.745µs 6.768µs 6.790µs 2.43% 0.057 -0.436 0.98% 0.005µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 147277404.316op/s 150858791.153op/s ± 1480590.308op/s 150856616.492op/s ± 1030293.837op/s 151773543.873op/s 153337022.139op/s 154300935.556op/s 154493950.353op/s 2.41% -0.011 -0.432 0.98% 104693.545op/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.009%; +0.009%] None None None
credit_card/is_card_number/ throughput [255477712.524op/s; 255525943.982op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [82.528µs; 82.605µs] or [-0.047%; +0.047%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12105907.887op/s; 12117205.927op/s] or [-0.047%; +0.047%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [76.909µs; 77.004µs] or [-0.062%; +0.062%] None None None
credit_card/is_card_number/ 378282246310005 throughput [12986618.451op/s; 13002641.108op/s] or [-0.062%; +0.062%] None None None
credit_card/is_card_number/37828224631 execution_time [3.914µs; 3.915µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/37828224631 throughput [255447782.987op/s; 255504699.261op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/378282246310005 execution_time [73.571µs; 73.669µs] or [-0.066%; +0.066%] None None None
credit_card/is_card_number/378282246310005 throughput [13574608.859op/s; 13592586.772op/s] or [-0.066%; +0.066%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.125µs; 52.151µs] or [-0.025%; +0.025%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19175032.529op/s; 19184638.757op/s] or [-0.025%; +0.025%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.636µs; 6.655µs] or [-0.139%; +0.139%] None None None
credit_card/is_card_number/x371413321323331 throughput [150281851.359op/s; 150699623.102op/s] or [-0.139%; +0.139%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.913µs; 3.914µs] or [-0.013%; +0.013%] None None None
credit_card/is_card_number_no_luhn/ throughput [255467633.703op/s; 255532812.352op/s] or [-0.013%; +0.013%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [63.910µs; 63.949µs] or [-0.031%; +0.031%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15637513.410op/s; 15647178.073op/s] or [-0.031%; +0.031%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [57.594µs; 57.625µs] or [-0.027%; +0.027%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17353762.182op/s; 17363048.030op/s] or [-0.027%; +0.027%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.913µs; 3.914µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255502641.227op/s; 255561391.899op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [54.710µs; 54.757µs] or [-0.042%; +0.042%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18262787.141op/s; 18278133.218op/s] or [-0.042%; +0.042%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.169µs; 52.200µs] or [-0.029%; +0.029%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19157303.362op/s; 19168468.298op/s] or [-0.029%; +0.029%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.620µs; 6.638µs] or [-0.136%; +0.136%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [150653595.576op/s; 151063986.730op/s] or [-0.136%; +0.136%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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 32.655µs 33.521µs ± 1.100µs 32.864µs ± 0.083µs 34.510µs 35.540µs 35.650µs 35.798µs 8.93% 1.045 -0.723 3.27% 0.078µ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.369µs; 33.674µs] or [-0.455%; +0.455%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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.901µs 4.994µs ± 0.035µs 4.994µs ± 0.022µs 5.020µs 5.046µs 5.062µs 5.064µs 1.39% -0.222 -0.252 0.70% 0.002µ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.989µs; 4.999µs] or [-0.097%; +0.097%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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.405µs 2.437µs ± 0.017µs 2.434µs ± 0.009µs 2.447µs 2.467µs 2.476µs 2.504µs 2.89% 0.567 0.389 0.70% 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.435µs; 2.439µs] or [-0.097%; +0.097%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 798fba6 1743086869 paullgdc/trace-util/v05_event_span_links_ser
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 67.576µs 67.770µs ± 0.209µs 67.737µs ± 0.047µs 67.790µs 67.973µs 68.099µs 70.258µs 3.72% 8.879 99.214 0.31% 0.015µ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 [67.741µs; 67.799µs] or [-0.043%; +0.043%] None None None

Baseline

Omitted due to size.

@paullegranddc paullegranddc changed the title fix(trace-utils: v05 events and span links serialization fix(trace-utils): v05 events and span links serialization Mar 27, 2025
Copy link
Contributor

@hoolioh hoolioh left a comment

Choose a reason for hiding this comment

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

Couple of comments. Additionally it'd be great to add spanlinks and spanevents support to v05 snapshots in data-pipeline/tests/ to have them covered.

Comment on lines +149 to +150
if !span.span_links.is_empty() {
let serialized_span_links = serde_json::to_string(&span.span_links)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should check here for the 25kb limit on the tag value, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, anything beyond 25KB limits is dropped. the implementation should try to stuff as many as links possible under the limit and drop the others.

There used to be dropped_attributes_count to count the dropped attributes in case of oversized span links which i didn't see our implementation.

if !span.span_links.is_empty() {
let serialized_span_links = serde_json::to_string(&span.span_links)?;
meta.insert(
dict.get_or_insert(&tinybytes::BytesString::from("span_links"))?,
Copy link
Contributor

Choose a reason for hiding this comment

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

In the RFC there is some discussion about "span_links" or "_dd.span_links". Did they finally choose the former?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's a mistake the key should definitely be "_dd.span_links" from other implementations

Copy link
Contributor

@ganeshnj ganeshnj left a comment

Choose a reason for hiding this comment

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

a few minor comments around tests and one major around tag size limit

overall looks good.

Comment on lines +35 to +45
///This structure is a wrapper around a slice of span events
///
/// It is meant to overrdide the default serialization, so we can serialize attributes
/// differently from the original impl.
/// Span events are serialized to JSON and added to "meta" when serializing to v0.5
///
/// The main difference with messagepacck serialization is that attributes with any types
/// are supposed to be mapped to their natural JSON representation.
///
/// Sadly, I haven't found a good way of overriding the default Serialize behavior, other
/// than just doing it for the whole data structures that embed it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
///This structure is a wrapper around a slice of span events
///
/// It is meant to overrdide the default serialization, so we can serialize attributes
/// differently from the original impl.
/// Span events are serialized to JSON and added to "meta" when serializing to v0.5
///
/// The main difference with messagepacck serialization is that attributes with any types
/// are supposed to be mapped to their natural JSON representation.
///
/// Sadly, I haven't found a good way of overriding the default Serialize behavior, other
/// than just doing it for the whole data structures that embed it.
/// This structure is a wrapper around a slice of span events
///
/// It is meant to override the default serialization, so we can serialize attributes
/// differently from the original impl.
/// Span events are serialized to JSON and added to "meta" when serializing to v0.5
///
/// The main difference with messagepack serialization is that attributes with any types
/// are supposed to be mapped to their natural JSON representation.

you can skip the justification and personalization.

@@ -82,8 +209,47 @@ mod tests {
)]),
metrics: HashMap::from([(BytesString::from("metrics_field"), 1.1)]),
meta_struct: HashMap::new(),
span_links: vec![],
span_events: vec![],
span_links: vec![SpanLinkBytes {
Copy link
Contributor

Choose a reason for hiding this comment

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

/suggestion

  • would be nice to have test case for multiple span links
  • a complex attributes (remember we do some flattening for array and maps), I'm not sure at this point we have them already or we have to do ourselves
    eg
{"key": [[1,2], ["3", "4"]]} to {"key.0.0": "1", "key.0.1": 2, "key.1.0": 3, "key.1.1":4}

Comment on lines +149 to +150
if !span.span_links.is_empty() {
let serialized_span_links = serde_json::to_string(&span.span_links)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, anything beyond 25KB limits is dropped. the implementation should try to stuff as many as links possible under the limit and drop the others.

There used to be dropped_attributes_count to count the dropped attributes in case of oversized span links which i didn't see our implementation.

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.

3 participants