Skip to content

Conversation

ekump
Copy link
Contributor

@ekump ekump commented Sep 12, 2025

What does this PR do?

TraceExporterError is now template based. The error message is static and dynamic context is included separately as key value pairs. In Rust, the Display trait can be used to get a string that combines the template and context for standard error logging scenarios. For cases where we want to ensure we don't include any dynamic content the template field can be used. The FFI layer has also been updated to separate template and context.

Motivation

Sometimes we don't want to log strings with dynamic content in them.

Additional Notes

Breaking change for FFI API users
For ExporterError msg: *mut c_char* has been replaced with msg_template: *const c_char. New fields have also been added.

Possible Breaking change for Rust API users
The public API changes to TraceExporterError are additive, but the format of the string returned by the Display trait has changed.

How to test the change?

Describe here in detail how the change can be validated.

@pr-commenter
Copy link

pr-commenter bot commented Sep 12, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-09-15 19:44:43

Comparing candidate commit 20c9bb8 in PR branch ekump/template-trace-exporter-errors with baseline commit 90e16a8 in branch main.

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

scenario:credit_card/is_card_number/ 378282246310005

  • 🟩 execution_time [-11.153µs; -10.983µs] or [-13.536%; -13.330%]
  • 🟩 throughput [+1869579.302op/s; +1896181.410op/s] or [+15.404%; +15.623%]

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 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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.822ms 14.876ms ± 0.032ms 14.873ms ± 0.014ms 14.886ms 14.919ms 14.963ms 15.135ms 1.76% 3.133 21.408 0.21% 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.871ms; 14.880ms] or [-0.030%; +0.030%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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.385µs 2.429µs ± 0.019µs 2.428µs ± 0.009µs 2.434µs 2.477µs 2.487µs 2.490µs 2.58% 1.148 2.186 0.76% 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.426µs; 2.431µs] or [-0.106%; +0.106%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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 34.162µs 34.832µs ± 1.038µs 34.386µs ± 0.105µs 34.502µs 37.011µs 37.046µs 38.973µs 13.34% 1.778 1.556 2.97% 0.073µ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.689µs; 34.976µs] or [-0.413%; +0.413%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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.650ms 61.073ms ± 2.357ms 60.740ms ± 0.042ms 60.804ms 61.096ms 76.195ms 83.272ms 37.10% 8.181 66.693 3.85% 0.167ms 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.747ms; 61.400ms] or [-0.535%; +0.535%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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 159.509µs 160.012µs ± 0.313µs 159.955µs ± 0.173µs 160.158µs 160.450µs 161.259µs 161.912µs 1.22% 2.218 8.556 0.19% 0.022µ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 [159.969µs; 160.056µs] or [-0.027%; +0.027%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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 5.005µs 5.073µs ± 0.036µs 5.075µs ± 0.033µs 5.102µs 5.129µs 5.132µs 5.134µs 1.16% 0.167 -1.302 0.72% 0.003µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [5.068µs; 5.078µs] or [-0.100%; +0.100%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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 6.196ms 6.249ms ± 0.042ms 6.242ms ± 0.015ms 6.261ms 6.301ms 6.439ms 6.625ms 6.14% 4.655 34.302 0.67% 0.003ms 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 [6.243ms; 6.255ms] or [-0.093%; +0.093%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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.893µs 3.911µs ± 0.003µs 3.911µs ± 0.001µs 3.913µs 3.916µs 3.919µs 3.921µs 0.26% -0.749 9.727 0.07% 0.000µs 1 200
credit_card/is_card_number/ throughput 255026322.467op/s 255666451.310op/s ± 185213.457op/s 255690667.299op/s ± 92242.098op/s 255758428.020op/s 255896634.819op/s 255960526.620op/s 256902354.399op/s 0.47% 0.773 9.870 0.07% 13096.569op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 77.065µs 77.646µs ± 0.391µs 77.612µs ± 0.252µs 77.880µs 78.492µs 78.650µs 78.806µs 1.54% 0.734 0.031 0.50% 0.028µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12689377.899op/s 12879228.140op/s ± 64651.347op/s 12884605.551op/s ± 42046.622op/s 12925291.241op/s 12963422.964op/s 12971172.369op/s 12976070.918op/s 0.71% -0.711 -0.014 0.50% 4571.541op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 70.885µs 71.329µs ± 0.257µs 71.321µs ± 0.160µs 71.446µs 71.796µs 72.130µs 72.311µs 1.39% 0.897 1.183 0.36% 0.018µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13829181.945op/s 14019809.549op/s ± 50284.799op/s 14021079.993op/s ± 31482.929op/s 14057198.389op/s 14088554.385op/s 14105167.196op/s 14107291.596op/s 0.61% -0.871 1.109 0.36% 3555.672op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.899µs 3.912µs ± 0.003µs 3.912µs ± 0.002µs 3.914µs 3.917µs 3.919µs 3.923µs 0.30% 0.282 1.655 0.08% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254881600.668op/s 255604296.327op/s ± 197978.213op/s 255649049.145op/s ± 122367.904op/s 255735483.301op/s 255858876.852op/s 255951758.850op/s 256460096.434op/s 0.32% -0.274 1.665 0.08% 13999.174op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 67.585µs 67.810µs ± 0.210µs 67.737µs ± 0.104µs 67.902µs 68.200µs 68.539µs 68.659µs 1.36% 1.630 2.938 0.31% 0.015µs 1 200
credit_card/is_card_number/378282246310005 throughput 14564796.022op/s 14747228.237op/s ± 45491.148op/s 14763019.442op/s ± 22614.841op/s 14781336.715op/s 14790362.010op/s 14795513.764op/s 14796201.815op/s 0.22% -1.609 2.845 0.31% 3216.710op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 44.743µs 45.066µs ± 0.128µs 45.059µs ± 0.090µs 45.151µs 45.278µs 45.359µs 45.388µs 0.73% 0.073 -0.382 0.28% 0.009µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 22032312.073op/s 22190074.216op/s ± 63109.014op/s 22192914.912op/s ± 44326.103op/s 22234727.313op/s 22286577.790op/s 22326056.982op/s 22349705.029op/s 0.71% -0.059 -0.384 0.28% 4462.481op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.026µs 6.034µs ± 0.009µs 6.033µs ± 0.002µs 6.035µs 6.041µs 6.097µs 6.106µs 1.21% 6.405 45.831 0.15% 0.001µs 1 200
credit_card/is_card_number/x371413321323331 throughput 163761174.895op/s 165715974.589op/s ± 246967.305op/s 165747042.489op/s ± 54106.805op/s 165808545.699op/s 165876791.138op/s 165921406.856op/s 165944085.060op/s 0.12% -6.375 45.517 0.15% 17463.226op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.892µs 3.911µs ± 0.003µs 3.911µs ± 0.001µs 3.912µs 3.915µs 3.917µs 3.921µs 0.27% -1.212 14.595 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255015182.230op/s 255703849.722op/s ± 167458.840op/s 255712159.114op/s ± 86115.036op/s 255798808.691op/s 255887696.186op/s 255956375.916op/s 256934596.429op/s 0.48% 1.242 14.792 0.07% 11841.128op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 65.403µs 65.480µs ± 0.042µs 65.472µs ± 0.023µs 65.502µs 65.552µs 65.616µs 65.676µs 0.31% 1.125 2.262 0.06% 0.003µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15226238.013op/s 15271751.471op/s ± 9793.794op/s 15273604.920op/s ± 5377.312op/s 15278295.653op/s 15284245.688op/s 15287323.493op/s 15289713.081op/s 0.11% -1.119 2.238 0.06% 692.526op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 52.939µs 53.014µs ± 0.036µs 53.007µs ± 0.021µs 53.032µs 53.079µs 53.138µs 53.144µs 0.26% 1.024 1.704 0.07% 0.003µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 18816659.135op/s 18862985.265op/s ± 12834.318op/s 18865534.555op/s ± 7409.084op/s 18871448.443op/s 18879887.728op/s 18886421.268op/s 18889561.628op/s 0.13% -1.018 1.688 0.07% 907.523op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.890µs 3.911µs ± 0.003µs 3.911µs ± 0.001µs 3.913µs 3.915µs 3.917µs 3.917µs 0.16% -2.229 19.025 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255280726.934op/s 255685779.693op/s ± 168627.249op/s 255696100.639op/s ± 92287.044op/s 255779214.824op/s 255895655.261op/s 255946908.675op/s 257038321.428op/s 0.52% 2.261 19.322 0.07% 11923.747op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 49.742µs 49.801µs ± 0.034µs 49.796µs ± 0.022µs 49.820µs 49.871µs 49.896µs 49.929µs 0.27% 0.865 0.984 0.07% 0.002µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 20028576.095op/s 20080027.372op/s ± 13561.860op/s 20082094.806op/s ± 8879.406op/s 20089799.907op/s 20098187.345op/s 20102616.838op/s 20103725.220op/s 0.11% -0.860 0.971 0.07% 958.968op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 44.709µs 45.075µs ± 0.127µs 45.079µs ± 0.080µs 45.149µs 45.272µs 45.338µs 45.417µs 0.75% -0.224 -0.001 0.28% 0.009µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 22018182.655op/s 22185433.896op/s ± 62743.559op/s 22183048.831op/s ± 39510.693op/s 22225825.351op/s 22293357.012op/s 22334057.331op/s 22366834.216op/s 0.83% 0.241 0.010 0.28% 4436.640op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.027µs 6.036µs ± 0.010µs 6.034µs ± 0.003µs 6.038µs 6.043µs 6.101µs 6.112µs 1.29% 5.709 38.848 0.17% 0.001µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 163624488.809op/s 165686199.239op/s ± 272372.348op/s 165736321.125op/s ± 90793.735op/s 165815793.314op/s 165880748.640op/s 165913912.812op/s 165925609.051op/s 0.11% -5.668 38.444 0.16% 19259.633op/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.911µs; 3.912µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/ throughput [255640782.507op/s; 255692120.114op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [77.592µs; 77.701µs] or [-0.070%; +0.070%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12870268.085op/s; 12888188.195op/s] or [-0.070%; +0.070%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [71.293µs; 71.364µs] or [-0.050%; +0.050%] None None None
credit_card/is_card_number/ 378282246310005 throughput [14012840.560op/s; 14026778.539op/s] or [-0.050%; +0.050%] None None None
credit_card/is_card_number/37828224631 execution_time [3.912µs; 3.913µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/37828224631 throughput [255576858.451op/s; 255631734.204op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/378282246310005 execution_time [67.781µs; 67.839µs] or [-0.043%; +0.043%] None None None
credit_card/is_card_number/378282246310005 throughput [14740923.601op/s; 14753532.872op/s] or [-0.043%; +0.043%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [45.048µs; 45.083µs] or [-0.039%; +0.039%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [22181327.914op/s; 22198820.518op/s] or [-0.039%; +0.039%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.033µs; 6.036µs] or [-0.021%; +0.021%] None None None
credit_card/is_card_number/x371413321323331 throughput [165681747.295op/s; 165750201.882op/s] or [-0.021%; +0.021%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.910µs; 3.911µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ throughput [255680641.537op/s; 255727057.906op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [65.475µs; 65.486µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15270394.146op/s; 15273108.797op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [53.009µs; 53.019µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [18861206.552op/s; 18864763.978op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.911µs; 3.911µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255662409.578op/s; 255709149.808op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [49.796µs; 49.805µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [20078147.829op/s; 20081906.916op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [45.057µs; 45.093µs] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [22176738.242op/s; 22194129.550op/s] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.034µs; 6.037µs] or [-0.023%; +0.023%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165648451.052op/s; 165723947.427op/s] or [-0.023%; +0.023%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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.228µs 3.213µs ± 1.455µs 3.032µs ± 0.022µs 3.053µs 3.407µs 13.854µs 15.408µs 408.16% 7.499 56.915 45.16% 0.103µ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.414µs] or [-6.274%; +6.274%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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.545ns 253.996ns ± 13.316ns 249.465ns ± 4.968ns 253.553ns 285.350ns 289.342ns 291.099ns 16.69% 1.482 0.876 5.23% 0.942ns 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 [252.151ns; 255.842ns] or [-0.727%; +0.727%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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.001µs 185.499µs ± 0.249µs 185.492µs ± 0.166µs 185.656µs 185.897µs 186.133µs 186.312µs 0.44% 0.465 0.220 0.13% 0.018µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 5367328.561op/s 5390867.421op/s ± 7221.521op/s 5391059.363op/s ± 4819.178op/s 5395929.169op/s 5401492.316op/s 5404138.588op/s 5405384.953op/s 0.27% -0.457 0.204 0.13% 510.639op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 17.695µs 17.791µs ± 0.068µs 17.785µs ± 0.022µs 17.809µs 17.845µs 17.905µs 18.599µs 4.58% 8.474 98.219 0.38% 0.005µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 53766744.500op/s 56209716.945op/s ± 208140.956op/s 56228140.736op/s ± 69859.769op/s 56290079.335op/s 56409079.983op/s 56460417.577op/s 56512602.548op/s 0.51% -8.153 93.170 0.37% 14717.788op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.240µs 10.408µs ± 0.150µs 10.329µs ± 0.037µs 10.574µs 10.676µs 10.719µs 10.735µs 3.93% 0.864 -0.968 1.44% 0.011µs 1 200
normalization/normalize_name/normalize_name/good throughput 93149753.047op/s 96096436.757op/s ± 1367045.427op/s 96813728.189op/s ± 342216.793op/s 97048405.188op/s 97369579.638op/s 97560246.767op/s 97652854.460op/s 0.87% -0.852 -0.991 1.42% 96664.709op/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.465µs; 185.534µs] or [-0.019%; +0.019%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [5389866.588op/s; 5391868.254op/s] or [-0.019%; +0.019%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [17.781µs; 17.800µs] or [-0.053%; +0.053%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [56180870.610op/s; 56238563.280op/s] or [-0.051%; +0.051%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.388µs; 10.429µs] or [-0.200%; +0.200%] None None None
normalization/normalize_name/normalize_name/good throughput [95906977.409op/s; 96285896.106op/s] or [-0.197%; +0.197%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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.824µs 26.676µs ± 10.496µs 18.545µs ± 0.166µs 35.486µs 45.163µs 54.716µs 76.105µs 310.38% 1.075 1.220 39.25% 0.742µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [25.221µs; 28.131µs] or [-5.453%; +5.453%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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 494.330µs 495.466µs ± 0.992µs 495.219µs ± 0.261µs 495.604µs 498.621µs 499.286µs 500.071µs 0.98% 3.013 9.096 0.20% 0.070µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1999717.373op/s 2018311.613op/s ± 4016.888op/s 2019308.177op/s ± 1065.609op/s 2020305.416op/s 2021374.406op/s 2022464.450op/s 2022940.823op/s 0.18% -3.001 9.034 0.20% 284.037op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 370.167µs 370.990µs ± 0.329µs 370.955µs ± 0.225µs 371.217µs 371.548µs 371.928µs 372.121µs 0.31% 0.608 0.562 0.09% 0.023µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2687298.891op/s 2695490.596op/s ± 2389.127op/s 2695744.293op/s ± 1639.555op/s 2697333.314op/s 2698760.642op/s 2699581.980op/s 2701483.067op/s 0.21% -0.602 0.550 0.09% 168.937op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 166.788µs 167.546µs ± 0.154µs 167.532µs ± 0.081µs 167.621µs 167.802µs 167.899µs 168.187µs 0.39% -0.179 3.976 0.09% 0.011µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5945746.309op/s 5968521.119op/s ± 5482.303op/s 5969022.577op/s ± 2885.591op/s 5971659.891op/s 5975242.832op/s 5982829.751op/s 5995618.458op/s 0.45% 0.195 4.006 0.09% 387.657op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 36.246µs 36.545µs ± 0.110µs 36.544µs ± 0.075µs 36.618µs 36.730µs 36.809µs 36.857µs 0.86% 0.211 -0.111 0.30% 0.008µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 27131658.332op/s 27363604.545op/s ± 82356.262op/s 27364201.788op/s ± 56443.300op/s 27422791.765op/s 27500149.934op/s 27515194.235op/s 27589132.433op/s 0.82% -0.194 -0.120 0.30% 5823.467op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.487µs 45.618µs ± 0.060µs 45.617µs ± 0.042µs 45.654µs 45.726µs 45.765µs 45.783µs 0.36% 0.258 -0.101 0.13% 0.004µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21842009.465op/s 21921038.411op/s ± 28689.706op/s 21921660.029op/s ± 20138.156op/s 21942332.868op/s 21964106.290op/s 21982597.526op/s 21984324.688op/s 0.29% -0.251 -0.106 0.13% 2028.669op/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 [495.328µs; 495.603µs] or [-0.028%; +0.028%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [2017754.911op/s; 2018868.315op/s] or [-0.028%; +0.028%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [370.945µs; 371.036µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2695159.486op/s; 2695821.706op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [167.525µs; 167.567µs] or [-0.013%; +0.013%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5967761.325op/s; 5969280.914op/s] or [-0.013%; +0.013%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [36.530µs; 36.560µs] or [-0.042%; +0.042%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [27352190.760op/s; 27375018.331op/s] or [-0.042%; +0.042%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.610µs; 45.627µs] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21917062.294op/s; 21925014.528op/s] or [-0.018%; +0.018%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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 85.205µs 85.400µs ± 0.246µs 85.381µs ± 0.050µs 85.426µs 85.509µs 85.704µs 88.660µs 3.84% 11.702 152.109 0.29% 0.017µ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 [85.366µs; 85.434µs] or [-0.040%; +0.040%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 20c9bb8 1757964680 ekump/template-trace-exporter-errors
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 8.186ms 8.204ms ± 0.010ms 8.203ms ± 0.006ms 8.208ms 8.219ms 8.237ms 8.267ms 0.78% 1.663 6.615 0.13% 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 [8.202ms; 8.205ms] or [-0.018%; +0.018%] None None None

Baseline

Omitted due to size.

@ekump ekump force-pushed the ekump/template-trace-exporter-errors branch from b845566 to f027fb4 Compare September 12, 2025 23:38
@ekump ekump marked this pull request as ready for review September 12, 2025 23:39
@ekump ekump requested review from a team as code owners September 12, 2025 23:39
@ekump ekump force-pushed the ekump/template-trace-exporter-errors branch from f027fb4 to b39e712 Compare September 12, 2025 23:39
/// Contains key-value pairs that can be safely used for logging or debugging.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ErrorContext {
fields: Vec<(String, String)>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Went with this over a HashMap because it should be more efficient when there are only a few entries. Also, I can't imagine when we'd need to do a key lookup so why incur the hashing costs?

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 85.63734% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.72%. Comparing base (90e16a8) to head (20c9bb8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1218      +/-   ##
==========================================
+ Coverage   71.55%   71.72%   +0.17%     
==========================================
  Files         354      354              
  Lines       55959    56438     +479     
==========================================
+ Hits        40042    40481     +439     
- Misses      15917    15957      +40     
Components Coverage Δ
datadog-crashtracker 49.30% <ø> (ø)
datadog-crashtracker-ffi 5.93% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 90.14% <85.63%> (-0.08%) ⬇️
data-pipeline-ffi 90.29% <91.50%> (+2.10%) ⬆️
ddcommon 84.29% <ø> (ø)
ddcommon-ffi 73.84% <ø> (ø)
ddtelemetry 59.98% <ø> (ø)
ddtelemetry-ffi 21.24% <ø> (ø)
dogstatsd-client 83.26% <ø> (ø)
datadog-ipc 82.45% <ø> (-0.05%) ⬇️
datadog-profiling 76.90% <ø> (ø)
datadog-profiling-ffi 62.12% <ø> (ø)
datadog-sidecar 36.57% <ø> (ø)
datdog-sidecar-ffi 8.93% <ø> (ø)
spawn-worker 55.35% <ø> (ø)
tinybytes 92.22% <ø> (ø)
datadog-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.17% <ø> (ø)
datadog-trace-protobuf 77.10% <ø> (ø)
datadog-trace-utils 89.91% <ø> (ø)
datadog-tracer-flare 53.15% <ø> (ø)
datadog-log 76.31% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ekump ekump force-pushed the ekump/template-trace-exporter-errors branch from b39e712 to 045d040 Compare September 15, 2025 13:28
Copy link

@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.

Nice work, some questions and suggestions but looking solid.

Comment on lines +14 to +16
pub key: *const c_char,
/// Value for this context field
pub value: *const c_char,

Choose a reason for hiding this comment

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

for consistency, we should use CharSlice.

Choose a reason for hiding this comment

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

Suggested change
pub key: *const c_char,
/// Value for this context field
pub value: *const c_char,
pub key: CharSlice,
/// Value for this context field
pub value: CharSlice,

Comment on lines +90 to +92
pub context_fields: *const ContextField,
/// Number of context fields
pub context_count: usize,

Choose a reason for hiding this comment

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

Did you try using Vec https://github.com/DataDog/libdatadog/blob/a156b6a8daebe95a006290868ace32fb78625d72/ddcommon-ffi/src/vec.rs

we already have it integrated in the tracersm and don't have to reinvent.

pub code: ExporterErrorCode,
pub msg: *mut c_char,
/// Static error message template
pub msg_template: *const c_char,

Choose a reason for hiding this comment

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

should this be also CharSlice?

Choose a reason for hiding this comment

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

would there be different msg_template for same error code? if not - this seems redundant to me.

unsafe {
// Free the msg_template
if !self.msg_template.is_null() {
// SAFETY: msg_template is originated from CString::into_raw in new() and

Choose a reason for hiding this comment

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

by definition template is static string, so ideally this is a no-op.

can it be avoided?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not it is a CString created from a static string. Although I wonder if could use a const CString instead of creating a CString from the 'static str to skip allocations.

}

impl BuilderErrorKind {
const INVALID_URI_TEMPLATE: &'static str = "Invalid URI provided: {details}";

Choose a reason for hiding this comment

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

how {details} will be interpreted by the tracers?

imo we should not have any templates in the template message just like structured logging.

  • error code
  • error message (without any template)
  • context (key-value collection)

void handle_error(ddog_TraceExporterError *err) {
fprintf(stderr, "Operation failed with error: %d, reason: %s\n", err->code, err->msg);
fprintf(stderr, "Operation failed with error: %d\n", err->code);

Choose a reason for hiding this comment

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

very cool.

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