Skip to content

Conversation

@Aaalibaba42
Copy link
Contributor

What does this PR do?

Refactor health metrics emission via common API.

Motivation

Logic was duplicated and would have required to be duplicated again if another usecase arose. Now the core logic can be integrated elsewhere more easiely.

Additional Notes

I don't have the full context of this part of the code, I may have blindspots or problems in the implementation.

How to test the change?

I (mostly AI) added a bunch of tests (maybe too much of them even ?) to validate the changes.

@pr-commenter
Copy link

pr-commenter bot commented Jan 7, 2026

Benchmarks

Comparison

Benchmark execution time: 2026-01-22 13:22:23

Comparing candidate commit 4f55a0d in PR branch jwiriath/APMSP-1584_refactor_health_metrics with baseline commit 0ee8789 in branch main.

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

scenario:normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて

  • 🟥 execution_time [+18.536µs; +18.658µs] or [+4.849%; +4.881%]
  • 🟥 throughput [-121776.840op/s; -120988.440op/s] or [-4.655%; -4.625%]

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 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 14.358ms 14.403ms ± 0.036ms 14.396ms ± 0.013ms 14.410ms 14.467ms 14.539ms 14.662ms 1.85% 3.414 16.886 0.25% 0.003ms 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.398ms; 14.408ms] or [-0.034%; +0.034%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.759ms 10.793ms ± 0.016ms 10.792ms ± 0.010ms 10.802ms 10.820ms 10.832ms 10.850ms 0.54% 0.439 0.399 0.14% 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.791ms; 10.796ms] or [-0.020%; +0.020%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 60.551ms 61.119ms ± 2.348ms 60.802ms ± 0.061ms 60.906ms 61.100ms 78.466ms 81.752ms 34.45% 7.994 62.501 3.83% 0.166ms 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 [60.794ms; 61.445ms] or [-0.532%; +0.532%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 204.695µs 205.583µs ± 0.487µs 205.477µs ± 0.312µs 205.885µs 206.498µs 206.956µs 206.979µs 0.73% 0.734 0.055 0.24% 0.034µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4831404.863op/s 4864240.930op/s ± 11491.939op/s 4866726.986op/s ± 7391.301op/s 4872688.983op/s 4879279.665op/s 4883494.778op/s 4885313.309op/s 0.38% -0.723 0.034 0.24% 812.603op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.555µs 18.625µs ± 0.035µs 18.615µs ± 0.016µs 18.640µs 18.690µs 18.741µs 18.802µs 1.01% 1.543 3.904 0.19% 0.002µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 53186358.691op/s 53692450.830op/s ± 100200.688op/s 53720986.434op/s ± 46227.052op/s 53751183.494op/s 53805730.628op/s 53852524.885op/s 53893139.951op/s 0.32% -1.523 3.808 0.19% 7085.259op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.711µs 10.773µs ± 0.029µs 10.775µs ± 0.021µs 10.796µs 10.820µs 10.840µs 10.854µs 0.73% 0.104 -0.341 0.27% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 92127980.534op/s 92821882.729op/s ± 251809.240op/s 92804071.485op/s ± 179978.011op/s 93014289.639op/s 93249730.323op/s 93328127.477op/s 93358571.029op/s 0.60% -0.090 -0.349 0.27% 17805.602op/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 [205.516µs; 205.650µs] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4862648.258op/s; 4865833.602op/s] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.620µs; 18.629µs] or [-0.026%; +0.026%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [53678563.978op/s; 53706337.681op/s] or [-0.026%; +0.026%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.769µs; 10.777µs] or [-0.038%; +0.038%] None None None
normalization/normalize_name/normalize_name/good throughput [92786984.390op/s; 92856781.068op/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 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.234µs 3.171µs ± 1.431µs 2.998µs ± 0.022µs 3.017µs 3.335µs 13.838µs 15.167µs 405.90% 7.497 56.842 45.01% 0.101µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [2.973µs; 3.370µs] or [-6.254%; +6.254%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.077µs 162.847µs ± 0.216µs 162.832µs ± 0.111µs 162.959µs 163.224µs 163.422µs 163.476µs 0.40% -0.092 1.333 0.13% 0.015µ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 [162.817µs; 162.877µs] or [-0.018%; +0.018%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 535.270µs 537.076µs ± 2.039µs 536.381µs ± 0.691µs 537.836µs 540.340µs 548.186µs 548.957µs 2.34% 3.218 14.162 0.38% 0.144µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1821636.303op/s 1861960.326op/s ± 6985.029op/s 1864344.994op/s ± 2406.401op/s 1866066.276op/s 1867664.685op/s 1868122.133op/s 1868215.835op/s 0.21% -3.153 13.648 0.37% 493.916op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 400.137µs 400.827µs ± 0.332µs 400.785µs ± 0.188µs 400.982µs 401.422µs 401.762µs 402.362µs 0.39% 1.203 2.324 0.08% 0.023µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2485323.599op/s 2494843.561op/s ± 2065.754op/s 2495105.341op/s ± 1168.300op/s 2496249.244op/s 2497444.901op/s 2497802.460op/s 2499146.598op/s 0.16% -1.196 2.295 0.08% 146.071op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 189.629µs 189.935µs ± 0.155µs 189.908µs ± 0.095µs 190.027µs 190.232µs 190.363µs 190.380µs 0.25% 0.743 0.209 0.08% 0.011µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5252646.930op/s 5264961.289op/s ± 4284.449op/s 5265704.408op/s ± 2621.324op/s 5267963.579op/s 5270643.168op/s 5272171.131op/s 5273457.862op/s 0.15% -0.739 0.202 0.08% 302.956op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 36.499µs 36.613µs ± 0.055µs 36.612µs ± 0.039µs 36.648µs 36.700µs 36.773µs 36.788µs 0.48% 0.378 0.241 0.15% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 27182772.568op/s 27313113.462op/s ± 41014.426op/s 27313773.019op/s ± 28820.013op/s 27342851.566op/s 27373799.111op/s 27395634.424op/s 27398006.409op/s 0.31% -0.368 0.226 0.15% 2900.158op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.813µs 46.041µs ± 0.119µs 46.044µs ± 0.064µs 46.093µs 46.148µs 46.213µs 47.307µs 2.74% 6.041 62.844 0.26% 0.008µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21138386.676op/s 21720106.787op/s ± 55179.746op/s 21718183.411op/s ± 30203.531op/s 21756083.364op/s 21777065.401op/s 21792067.744op/s 21827918.393op/s 0.51% -5.825 59.869 0.25% 3901.797op/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 [536.793µs; 537.359µs] or [-0.053%; +0.053%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1860992.269op/s; 1862928.384op/s] or [-0.052%; +0.052%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [400.781µs; 400.873µs] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2494557.268op/s; 2495129.855op/s] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [189.914µs; 189.956µs] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5264367.505op/s; 5265555.072op/s] or [-0.011%; +0.011%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [36.605µs; 36.620µs] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [27307429.257op/s; 27318797.667op/s] or [-0.021%; +0.021%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [46.024µs; 46.057µs] or [-0.036%; +0.036%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21712459.405op/s; 21727754.169op/s] or [-0.035%; +0.035%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 242.676ns 252.469ns ± 12.970ns 247.473ns ± 3.153ns 253.094ns 283.824ns 292.984ns 296.569ns 19.84% 1.948 2.741 5.12% 0.917ns 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 [250.671ns; 254.266ns] or [-0.712%; +0.712%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.982µs 5.062µs ± 0.055µs 5.067µs ± 0.057µs 5.116µs 5.133µs 5.137µs 5.142µs 1.48% -0.020 -1.664 1.08% 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.055µs; 5.070µs] or [-0.150%; +0.150%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 143.958µs 146.116µs ± 1.799µs 145.808µs ± 0.571µs 146.494µs 147.718µs 153.317µs 164.149µs 12.58% 6.194 53.074 1.23% 0.127µ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 [145.867µs; 146.366µs] or [-0.171%; +0.171%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 26.033µs ± 9.729µs 18.671µs ± 0.460µs 34.697µs 43.670µs 44.573µs 73.311µs 292.66% 1.064 1.305 37.28% 0.688µ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.685µs; 27.381µs] or [-5.179%; +5.179%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.024ms 4.029ms ± 0.006ms 4.028ms ± 0.001ms 4.030ms 4.032ms 4.035ms 4.112ms 2.08% 11.517 148.778 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.028ms; 4.030ms] or [-0.022%; +0.022%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 12.796ms 13.103ms ± 0.109ms 13.104ms ± 0.046ms 13.155ms 13.272ms 13.460ms 13.516ms 3.14% 0.177 2.028 0.83% 0.008ms 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 [13.088ms; 13.119ms] or [-0.115%; +0.115%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.892µs 3.912µs ± 0.002µs 3.912µs ± 0.001µs 3.913µs 3.915µs 3.917µs 3.918µs 0.15% -2.636 23.029 0.06% 0.000µs 1 200
credit_card/is_card_number/ throughput 255251803.358op/s 255630259.882op/s ± 156333.537op/s 255627861.823op/s ± 78238.375op/s 255710317.912op/s 255828297.902op/s 255895322.857op/s 256941102.608op/s 0.51% 2.669 23.356 0.06% 11054.450op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 77.030µs 77.570µs ± 0.332µs 77.508µs ± 0.206µs 77.738µs 78.153µs 78.453µs 78.875µs 1.76% 0.795 0.736 0.43% 0.023µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12678285.939op/s 12891835.354op/s ± 55022.550op/s 12901841.755op/s ± 34232.987op/s 12928052.909op/s 12965218.485op/s 12972518.025op/s 12981975.986op/s 0.62% -0.768 0.655 0.43% 3890.682op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 70.687µs 71.163µs ± 0.309µs 71.159µs ± 0.212µs 71.335µs 71.722µs 72.049µs 72.066µs 1.28% 0.567 -0.074 0.43% 0.022µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13876103.519op/s 14052490.702op/s ± 60825.880op/s 14053054.369op/s ± 41837.643op/s 14096815.885op/s 14141095.868op/s 14146103.495op/s 14146789.090op/s 0.67% -0.546 -0.112 0.43% 4301.039op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.892µs 3.912µs ± 0.003µs 3.912µs ± 0.001µs 3.913µs 3.916µs 3.918µs 3.922µs 0.26% -1.637 17.704 0.06% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254970350.092op/s 255633376.075op/s ± 165026.053op/s 255638159.643op/s ± 75355.084op/s 255713008.977op/s 255827712.742op/s 255899753.918op/s 256908965.841op/s 0.50% 1.670 17.947 0.06% 11669.104op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 67.425µs 67.890µs ± 0.273µs 67.858µs ± 0.169µs 68.060µs 68.331µs 68.660µs 68.928µs 1.58% 0.751 0.904 0.40% 0.019µs 1 200
credit_card/is_card_number/378282246310005 throughput 14507866.695op/s 14729959.450op/s ± 59004.776op/s 14736603.880op/s ± 36714.830op/s 14768107.932op/s 14814511.851op/s 14824495.047op/s 14831252.415op/s 0.64% -0.723 0.822 0.40% 4172.268op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 44.670µs 45.202µs ± 0.194µs 45.217µs ± 0.165µs 45.358µs 45.481µs 45.513µs 45.546µs 0.73% -0.317 -0.679 0.43% 0.014µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 21956005.111op/s 22123251.916op/s ± 95152.322op/s 22115426.197op/s ± 80565.161op/s 22203723.564op/s 22282995.356op/s 22354438.072op/s 22386296.521op/s 1.22% 0.333 -0.657 0.43% 6728.285op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.029µs 6.038µs ± 0.012µs 6.036µs ± 0.002µs 6.039µs 6.050µs 6.106µs 6.113µs 1.28% 4.369 20.638 0.20% 0.001µs 1 200
credit_card/is_card_number/x371413321323331 throughput 163584218.082op/s 165608948.833op/s ± 324382.602op/s 165684607.900op/s ± 67327.833op/s 165744527.267op/s 165804006.383op/s 165852186.133op/s 165860171.167op/s 0.11% -4.348 20.451 0.20% 22937.314op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.891µs 3.913µs ± 0.003µs 3.913µs ± 0.002µs 3.915µs 3.918µs 3.921µs 3.923µs 0.25% -1.942 13.406 0.09% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254909550.973op/s 255548330.160op/s ± 222069.345op/s 255559340.140op/s ± 115195.564op/s 255662730.769op/s 255767691.480op/s 255904384.008op/s 256980275.734op/s 0.56% 1.973 13.606 0.09% 15702.674op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.092µs 65.603µs ± 0.092µs 65.603µs ± 0.053µs 65.660µs 65.745µs 65.784µs 65.817µs 0.33% -0.923 4.176 0.14% 0.007µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15193535.856op/s 15243230.639op/s ± 21429.998op/s 15243268.366op/s ± 12419.820op/s 15254906.497op/s 15273366.621op/s 15295528.426op/s 15362789.256op/s 0.78% 0.946 4.294 0.14% 1515.330op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 52.947µs 53.010µs ± 0.030µs 53.004µs ± 0.017µs 53.024µs 53.068µs 53.096µs 53.107µs 0.19% 0.812 0.621 0.06% 0.002µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 18829870.032op/s 18864262.289op/s ± 10510.679op/s 18866431.901op/s ± 6072.660op/s 18871121.523op/s 18878376.802op/s 18882358.987op/s 18886839.650op/s 0.11% -0.809 0.615 0.06% 743.217op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.895µs 3.912µs ± 0.003µs 3.912µs ± 0.001µs 3.913µs 3.916µs 3.920µs 3.923µs 0.29% -0.367 10.071 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254900148.823op/s 255613877.112op/s ± 168963.555op/s 255627989.596op/s ± 85087.337op/s 255709608.289op/s 255794926.850op/s 255861411.195op/s 256719072.028op/s 0.43% 0.391 10.183 0.07% 11947.528op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 49.745µs 49.816µs ± 0.044µs 49.809µs ± 0.019µs 49.832µs 49.884µs 49.918µs 50.175µs 0.74% 3.808 25.094 0.09% 0.003µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 19930050.481op/s 20074053.222op/s ± 17828.168op/s 20076845.374op/s ± 7539.195op/s 20084055.269op/s 20093134.176op/s 20096911.051op/s 20102651.540op/s 0.13% -3.774 24.748 0.09% 1260.642op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 44.688µs 45.169µs ± 0.155µs 45.179µs ± 0.106µs 45.281µs 45.405µs 45.487µs 45.520µs 0.75% -0.254 0.045 0.34% 0.011µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 21968530.772op/s 22139126.679op/s ± 76258.345op/s 22134303.175op/s ± 52065.810op/s 22187338.353op/s 22263031.663op/s 22343793.623op/s 22377534.407op/s 1.10% 0.274 0.067 0.34% 5392.279op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.029µs 6.036µs ± 0.007µs 6.035µs ± 0.003µs 6.038µs 6.041µs 6.043µs 6.105µs 1.16% 6.955 66.098 0.11% 0.000µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 163807887.849op/s 165676911.178op/s ± 177594.394op/s 165707431.982op/s ± 69036.693op/s 165762202.269op/s 165820344.944op/s 165856215.829op/s 165867376.770op/s 0.10% -6.892 65.181 0.11% 12557.820op/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 [255608593.557op/s; 255651926.207op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [77.524µs; 77.616µs] or [-0.059%; +0.059%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12884209.758op/s; 12899460.950op/s] or [-0.059%; +0.059%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [71.120µs; 71.206µs] or [-0.060%; +0.060%] None None None
credit_card/is_card_number/ 378282246310005 throughput [14044060.820op/s; 14060920.584op/s] or [-0.060%; +0.060%] None None None
credit_card/is_card_number/37828224631 execution_time [3.912µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/37828224631 throughput [255610505.052op/s; 255656247.099op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number/378282246310005 execution_time [67.852µs; 67.928µs] or [-0.056%; +0.056%] None None None
credit_card/is_card_number/378282246310005 throughput [14721781.956op/s; 14738136.945op/s] or [-0.056%; +0.056%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [45.175µs; 45.229µs] or [-0.060%; +0.060%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [22110064.720op/s; 22136439.113op/s] or [-0.060%; +0.060%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.037µs; 6.040µs] or [-0.027%; +0.027%] None None None
credit_card/is_card_number/x371413321323331 throughput [165563992.524op/s; 165653905.141op/s] or [-0.027%; +0.027%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.913µs; 3.914µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/ throughput [255517553.484op/s; 255579106.835op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.590µs; 65.616µs] or [-0.019%; +0.019%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15240260.648op/s; 15246200.631op/s] or [-0.019%; +0.019%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [53.006µs; 53.014µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [18862805.610op/s; 18865718.968op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.912µs; 3.913µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255590460.389op/s; 255637293.836op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [49.809µs; 49.822µs] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [20071582.409op/s; 20076524.034op/s] or [-0.012%; +0.012%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [45.148µs; 45.191µs] or [-0.048%; +0.048%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [22128558.005op/s; 22149695.352op/s] or [-0.048%; +0.048%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.035µs; 6.037µs] or [-0.015%; +0.015%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165652298.303op/s; 165701524.053op/s] or [-0.015%; +0.015%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.290ns 190.703ns ± 2.112ns 190.388ns ± 1.325ns 191.641ns 194.711ns 196.557ns 200.559ns 5.34% 1.355 2.444 1.10% 0.149ns 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.410ns; 190.995ns] or [-0.153%; +0.153%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.373µs 89.817µs ± 0.180µs 89.876µs ± 0.095µs 89.936µs 90.007µs 90.117µs 90.872µs 1.11% 0.551 4.440 0.20% 0.013µ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 [89.792µs; 89.842µs] or [-0.028%; +0.028%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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 547.654µs 548.275µs ± 0.370µs 548.201µs ± 0.181µs 548.379µs 549.183µs 549.318µs 549.500µs 0.24% 1.179 1.164 0.07% 0.026µ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 [548.224µs; 548.327µs] or [-0.009%; +0.009%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.535µs 34.075µs ± 0.907µs 33.667µs ± 0.067µs 33.771µs 35.991µs 36.086µs 37.639µs 11.80% 1.780 1.519 2.65% 0.064µ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.950µs; 34.201µs] or [-0.369%; +0.369%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 4f55a0d 1769087165 jwiriath/APMSP-1584_refactor_health_metrics
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.402µs 2.456µs ± 0.026µs 2.453µs ± 0.013µs 2.467µs 2.511µs 2.517µs 2.598µs 5.93% 1.184 4.179 1.05% 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.452µs; 2.459µs] or [-0.146%; +0.146%] None None None

Baseline

Omitted due to size.

@codecov-commenter
Copy link

codecov-commenter commented Jan 7, 2026

Codecov Report

❌ Patch coverage is 81.40351% with 106 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.18%. Comparing base (9aa79d2) to head (4f55a0d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1433      +/-   ##
==========================================
+ Coverage   71.11%   71.18%   +0.07%     
==========================================
  Files         417      418       +1     
  Lines       67037    67239     +202     
==========================================
+ Hits        47671    47863     +192     
- Misses      19366    19376      +10     
Components Coverage Δ
libdd-crashtracker 61.39% <ø> (-0.02%) ⬇️
libdd-crashtracker-ffi 16.50% <ø> (ø)
libdd-alloc 98.73% <ø> (ø)
libdd-data-pipeline 86.62% <81.40%> (+0.59%) ⬆️
libdd-data-pipeline-ffi 78.57% <ø> (ø)
libdd-common 80.84% <ø> (ø)
libdd-common-ffi 74.19% <ø> (ø)
libdd-telemetry 59.82% <ø> (ø)
libdd-telemetry-ffi 21.17% <ø> (ø)
libdd-dogstatsd-client 83.75% <ø> (ø)
datadog-ipc 82.60% <ø> (ø)
libdd-profiling 80.65% <ø> (ø)
libdd-profiling-ffi 62.46% <ø> (ø)
datadog-sidecar 34.63% <ø> (ø)
datdog-sidecar-ffi 8.48% <ø> (ø)
spawn-worker 55.18% <ø> (ø)
libdd-tinybytes 92.44% <ø> (ø)
libdd-trace-normalization 82.33% <ø> (ø)
libdd-trace-obfuscation 94.17% <ø> (ø)
libdd-trace-protobuf 61.18% <ø> (ø)
libdd-trace-utils 89.74% <ø> (ø)
datadog-tracer-flare 63.49% <ø> (ø)
libdd-log 75.57% <ø> (ø)
🚀 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.

@Aaalibaba42 Aaalibaba42 marked this pull request as ready for review January 7, 2026 12:55
@Aaalibaba42 Aaalibaba42 requested a review from a team as a code owner January 7, 2026 12:55
@dd-octo-sts
Copy link

dd-octo-sts bot commented Jan 7, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 91.23 MB 91.21 MB --.02% (-27.18 KB) 💪
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 8.38 MB 8.38 MB 0% (0 B) 👌
aarch64-apple-darwin
Artifact Baseline Commit Change
/aarch64-apple-darwin/lib/libdatadog_profiling.a 62.36 MB 62.35 MB --.01% (-12.62 KB) 💪
/aarch64-apple-darwin/lib/libdatadog_profiling.dylib 9.41 MB 9.41 MB -0% (-496 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.67 MB 10.67 MB -0% (-824 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 105.55 MB 105.51 MB --.03% (-41.31 KB) 💪
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 25.08 MB 25.07 MB --.03% (-9.50 KB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 73.49 KB 73.49 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 166.29 MB 166.26 MB --.01% (-24.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 830.26 MB 829.65 MB --.07% (-626.79 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.55 MB 9.54 MB --.08% (-8.50 KB) 💪
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 73.49 KB 73.49 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 22.94 MB 22.94 MB --.03% (-8.00 KB) 💪
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 47.92 MB 47.89 MB --.05% (-24.62 KB) 💪
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.15 MB 21.14 MB --.04% (-9.00 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 74.62 KB 74.62 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 170.25 MB 170.23 MB -0% (-16.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 817.21 MB 816.59 MB --.07% (-635.00 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 7.22 MB 7.21 MB --.07% (-5.50 KB) 💪
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 74.62 KB 74.62 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 24.52 MB 24.51 MB --.03% (-8.00 KB) 💪
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 43.63 MB 43.61 MB --.05% (-22.38 KB) 💪
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 79.74 MB 79.72 MB --.02% (-21.66 KB) 💪
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 9.85 MB 9.84 MB --.03% (-4.00 KB) 💪
x86_64-apple-darwin
Artifact Baseline Commit Change
/x86_64-apple-darwin/lib/libdatadog_profiling.a 64.25 MB 64.23 MB --.01% (-12.85 KB) 💪
/x86_64-apple-darwin/lib/libdatadog_profiling.dylib 10.44 MB 10.44 MB --.04% (-4.45 KB) 💪
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 99.57 MB 99.54 MB --.02% (-28.30 KB) 💪
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 11.41 MB 11.40 MB --.03% (-4.46 KB) 💪

.as_ref()
.and_then(|v| Tag::new("type", v).ok());
let custom_tags = type_tag.as_ref().map(|t| vec![t]);
self.emit(metric, custom_tags);
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of emitting each metric can we batch them? You'd need to refactor emit to support this, but the DogstatsD client should support it just fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I'm not mistaken, we'd need to go by DogStatsDActionOwned to have the same iterator type to collect (required by generic V of DogStatsDAction). So we either do more copies/allocations, or more send. Given that we are talking about 3 to 6 metrics per SendResult, I tend to think the simplicity of this code is preferable to what amounts to early optimization. But I'm fine doing the change if you think it's preferable o/

/// - The second element is an optional tag value for error classification
pub(crate) fn collect_metrics(&self) -> Vec<(HealthMetric, Option<String>)> {
// Max capacity: 3 base + 1 outcome + 2 dropped
let mut metrics = Vec::with_capacity(6);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a Vec? Can we use the visitor pattern and only do a vec allocation at the very end in emit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree it would be ever so slightly better, but at the cost of a lot of complexity. My take on these kind of things is more often than not to not touch it unless we know it is significant. But as the other comment, if you feel strongly about it, I'm fine with implementing it o/

// Emit failed metric with type tag
metrics.push((
HealthMetric::Count(TRANSPORT_TRACES_FAILED, 1),
Some(error_type.as_tag_value().into_owned()),
Copy link
Contributor

Choose a reason for hiding this comment

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

does this have to be into_owned() at this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done o/

.unwrap_or_else(|_| tag!("type", "unknown"));
self.emit_metric(
HealthMetric::Count(health_metrics::TRANSPORT_TRACES_FAILED, 1),
Some(vec![&resp_tag, &type_tag]),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why were we sending the status code in two different tags, and why is it ok that we're only sending it in one tag now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know. I didn't catch that when refactoring, I just saw there was a codepath for the status code and handled it in the refactored types. And I immediately can't figure out if it's relevant or not, I'll look for some kind of spec.

@Aaalibaba42 Aaalibaba42 changed the title [APMSP-1584] Refactor health metrics refactor(libdd-data-pipeline): health metrics Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants