Skip to content

refactor: cleanup the telemetry configuration api #1002

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

Merged
merged 5 commits into from
Apr 7, 2025

Conversation

paullegranddc
Copy link
Contributor

This PR does 2 things

  • Make the trace_exporter not send app-started and app-closed telemetry payloads.

Libraries already have a telemetry client sending lifecycle events and sending duplicates from the trace exporter is a bug.
There is already an API on the TelemetryWorker to drop the lifecycle events and it's juste a matter of using it.

  • Refactor the ddtelemetry builder config API

The API was very much not clear.
The spawn_with_config function took a config that would act as default, with a lower priority than fields set in the ConfigBuilder.

Using Builder::run would also try to pull configuration directly from env variables which is not good since there are other sources that could override it. This was so that integrations in the sidecar, and ddtrace dotnet would work without having to specify all configurations... but it's pretty horrible.

In practice after checking in libdatadog and other repositories I'm pretty sure this weird pattern can be replaced by putting the config in the builder and then overriding some fields as needed.

This PR also hides the endpoint behind a setter an a getter that properly set the telemetry path based on if direct submission is enabled or not.

What does this PR do?

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

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

How to test the change?

Describe here in detail how the change can be validated.

The API was very much not clear.
The spawn_with_config function took a config that would act as default, with a lower priority than fields set in the ConfigBuilder.

Using Builder::run would also try to pull configuration directly from env variables which is not good since there are other sources that could override it.
This was so that integrations in the sidecar, and ddtrace dotnet would work without having to specify all configurations... but it's pretty horrible.

In practice after checking in libdatadog and other repositories I'm pretty sure this weird pattern can be replaced by putting the config in the builder and then overriding some fields as needed.
@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 10.18957% with 379 lines in your changes missing coverage. Please review.

Project coverage is 71.60%. Comparing base (b79a04f) to head (0c54fed).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1002      +/-   ##
==========================================
- Coverage   71.85%   71.60%   -0.25%     
==========================================
  Files         335      334       -1     
  Lines       50353    50354       +1     
==========================================
- Hits        36180    36058     -122     
- Misses      14173    14296     +123     
Components Coverage Δ
crashtracker 42.85% <100.00%> (-0.03%) ⬇️
crashtracker-ffi 6.25% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 90.74% <100.00%> (+0.01%) ⬆️
data-pipeline-ffi 90.35% <100.00%> (ø)
ddcommon 79.95% <ø> (ø)
ddcommon-ffi 66.37% <ø> (ø)
ddtelemetry 60.28% <6.51%> (-1.57%) ⬇️
ddtelemetry-ffi 21.43% <2.47%> (-1.04%) ⬇️
dogstatsd-client 82.57% <ø> (ø)
ipc 82.42% <ø> (ø)
profiling 77.58% <ø> (+0.01%) ⬆️
profiling-ffi 62.28% <ø> (ø)
serverless 0.00% <ø> (ø)
sidecar 40.95% <0.00%> (-1.59%) ⬇️
sidecar-ffi 0.58% <ø> (-12.95%) ⬇️
spawn-worker 54.37% <ø> (ø)
tinybytes 91.59% <ø> (ø)
trace-mini-agent 73.82% <ø> (ø)
trace-normalization 98.24% <ø> (ø)
trace-obfuscation 96.00% <ø> (ø)
trace-protobuf 78.13% <ø> (ø)
trace-utils 93.05% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pr-commenter
Copy link

pr-commenter bot commented Apr 4, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-04-07 14:05:31

Comparing candidate commit 0c54fed in PR branch paullgdc/ddtelemetry/fix_config_api with baseline commit b79a04f 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 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.372ns 255.472ns ± 13.866ns 248.816ns ± 2.481ns 253.715ns 284.942ns 301.993ns 304.209ns 22.26% 1.867 2.709 5.41% 0.980ns 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.550ns; 257.393ns] or [-0.752%; +0.752%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.202µs 3.187µs ± 1.434µs 2.997µs ± 0.034µs 3.025µs 3.636µs 14.038µs 15.052µs 402.20% 7.401 55.739 44.86% 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.989µs; 3.386µs] or [-6.233%; +6.233%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.390µs 2.418µs ± 0.015µs 2.414µs ± 0.009µs 2.424µs 2.445µs 2.454µs 2.464µs 2.07% 0.782 -0.134 0.62% 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.416µs; 2.420µs] or [-0.086%; +0.086%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.862µs 68.098µs ± 0.175µs 68.078µs ± 0.057µs 68.136µs 68.270µs 68.553µs 70.006µs 2.83% 7.025 70.128 0.26% 0.012µ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 [68.074µs; 68.123µs] or [-0.036%; +0.036%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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 146.714µs 147.527µs ± 0.505µs 147.409µs ± 0.283µs 147.786µs 148.396µs 149.130µs 150.324µs 1.98% 1.584 4.486 0.34% 0.036µ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.457µs; 147.597µs] or [-0.047%; +0.047%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.061ms 6.074ms ± 0.008ms 6.072ms ± 0.003ms 6.076ms 6.083ms 6.097ms 6.134ms 1.01% 4.038 26.389 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 [6.073ms; 6.075ms] 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 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 3.895µs 3.914µs ± 0.003µs 3.914µs ± 0.002µs 3.915µs 3.917µs 3.919µs 3.921µs 0.19% -1.575 7.243 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 255028226.716op/s 255524615.354op/s ± 194062.234op/s 255501785.128op/s ± 100997.742op/s 255602492.131op/s 255875593.378op/s 255984400.572op/s 256753361.776op/s 0.49% 1.590 7.349 0.08% 13722.272op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 81.918µs 82.265µs ± 0.189µs 82.225µs ± 0.094µs 82.357µs 82.556µs 82.906µs 83.421µs 1.45% 1.926 7.538 0.23% 0.013µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 11987344.508op/s 12155872.893op/s ± 27782.331op/s 12161707.647op/s ± 13901.105op/s 12173870.309op/s 12187156.085op/s 12205374.967op/s 12207339.052op/s 0.38% -1.886 7.272 0.23% 1964.507op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 76.202µs 76.773µs ± 0.325µs 76.721µs ± 0.192µs 76.924µs 77.402µs 77.997µs 78.021µs 1.69% 1.256 2.304 0.42% 0.023µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 12817010.658op/s 13025638.349op/s ± 54856.556op/s 13034181.298op/s ± 32579.367op/s 13065889.542op/s 13092641.558op/s 13109630.488op/s 13122982.279op/s 0.68% -1.222 2.179 0.42% 3878.944op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.899µs 3.914µs ± 0.008µs 3.913µs ± 0.001µs 3.915µs 3.917µs 3.921µs 3.994µs 2.07% 8.418 77.343 0.22% 0.001µs 1 200
credit_card/is_card_number/37828224631 throughput 250348220.074op/s 255509869.801op/s ± 543023.279op/s 255539730.954op/s ± 89098.015op/s 255630304.973op/s 255867012.582op/s 255994107.546op/s 256502426.838op/s 0.38% -8.363 76.692 0.21% 38397.544op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 72.830µs 73.730µs ± 0.438µs 73.708µs ± 0.326µs 74.040µs 74.447µs 74.768µs 75.109µs 1.90% 0.304 -0.137 0.59% 0.031µs 1 200
credit_card/is_card_number/378282246310005 throughput 13313896.350op/s 13563457.024op/s ± 80365.667op/s 13567011.154op/s ± 59937.117op/s 13625027.815op/s 13680656.844op/s 13727722.067op/s 13730649.880op/s 1.21% -0.273 -0.178 0.59% 5682.711op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 51.876µs 52.132µs ± 0.081µs 52.137µs ± 0.057µs 52.190µs 52.258µs 52.290µs 52.319µs 0.35% -0.217 -0.331 0.16% 0.006µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19113463.793op/s 19182098.158op/s ± 29938.656op/s 19180181.119op/s ± 21028.302op/s 19202440.175op/s 19231394.771op/s 19249824.938op/s 19276643.936op/s 0.50% 0.225 -0.324 0.16% 2116.983op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.427µs 6.450µs ± 0.043µs 6.439µs ± 0.002µs 6.443µs 6.537µs 6.642µs 6.753µs 4.87% 4.486 21.515 0.67% 0.003µs 1 200
credit_card/is_card_number/x371413321323331 throughput 148080795.703op/s 155048689.517op/s ± 1006185.871op/s 155294803.300op/s ± 57216.230op/s 155345539.737op/s 155490070.759op/s 155543762.288op/s 155586112.107op/s 0.19% -4.421 20.766 0.65% 71148.085op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.892µs 3.914µs ± 0.003µs 3.914µs ± 0.001µs 3.916µs 3.919µs 3.921µs 3.923µs 0.24% -1.494 12.120 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 254908433.420op/s 255491531.412op/s ± 198942.833op/s 255521056.771op/s ± 83453.047op/s 255577317.515op/s 255762359.232op/s 255919750.748op/s 256914709.644op/s 0.55% 1.522 12.329 0.08% 14067.383op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 63.798µs 63.943µs ± 0.066µs 63.929µs ± 0.037µs 63.979µs 64.061µs 64.136µs 64.268µs 0.53% 1.244 3.241 0.10% 0.005µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15559895.588op/s 15639020.046op/s ± 16203.290op/s 15642362.587op/s ± 8966.824op/s 15649201.518op/s 15659369.111op/s 15671183.003op/s 15674555.494op/s 0.21% -1.233 3.194 0.10% 1145.746op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 57.411µs 57.560µs ± 0.105µs 57.534µs ± 0.029µs 57.583µs 57.676µs 57.964µs 58.404µs 1.51% 3.943 23.770 0.18% 0.007µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 17121971.711op/s 17373235.313op/s ± 31471.636op/s 17381074.617op/s ± 8789.701op/s 17387995.328op/s 17402546.516op/s 17414823.556op/s 17418142.737op/s 0.21% -3.888 23.175 0.18% 2225.381op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.895µs 3.914µs ± 0.003µs 3.914µs ± 0.002µs 3.916µs 3.918µs 3.921µs 3.924µs 0.25% -1.036 6.477 0.08% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254860268.072op/s 255506959.848op/s ± 202646.439op/s 255501031.688op/s ± 109290.883op/s 255595488.780op/s 255841128.985op/s 255920282.478op/s 256753464.941op/s 0.49% 1.053 6.577 0.08% 14329.267op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 54.568µs 54.716µs ± 0.155µs 54.664µs ± 0.031µs 54.703µs 55.109µs 55.254µs 55.601µs 1.71% 2.666 7.669 0.28% 0.011µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17985196.120op/s 18276238.007op/s ± 51500.930op/s 18293572.556op/s ± 10437.833op/s 18302199.924op/s 18311116.222op/s 18323861.370op/s 18325881.643op/s 0.18% -2.645 7.497 0.28% 3641.666op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 51.884µs 52.117µs ± 0.073µs 52.121µs ± 0.048µs 52.165µs 52.223µs 52.260µs 52.415µs 0.56% -0.099 1.266 0.14% 0.005µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19078475.832op/s 19187506.882op/s ± 26855.197op/s 19186156.230op/s ± 17680.696op/s 19204058.779op/s 19228868.012op/s 19263832.307op/s 19273865.161op/s 0.46% 0.113 1.256 0.14% 1898.949op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.427µs 6.541µs ± 0.089µs 6.554µs ± 0.083µs 6.605µs 6.682µs 6.735µs 6.747µs 2.94% 0.197 -1.096 1.36% 0.006µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 148219520.167op/s 152911516.033op/s ± 2078504.449op/s 152570608.863op/s ± 1917562.055op/s 155301961.778op/s 155414706.939op/s 155501735.527op/s 155586439.230op/s 1.98% -0.163 -1.146 1.36% 146972.459op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.913µs; 3.914µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [255497720.195op/s; 255551510.513op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [82.239µs; 82.291µs] or [-0.032%; +0.032%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12152022.529op/s; 12159723.257op/s] or [-0.032%; +0.032%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [76.728µs; 76.818µs] or [-0.059%; +0.059%] None None None
credit_card/is_card_number/ 378282246310005 throughput [13018035.758op/s; 13033240.941op/s] or [-0.058%; +0.058%] None None None
credit_card/is_card_number/37828224631 execution_time [3.913µs; 3.915µs] or [-0.030%; +0.030%] None None None
credit_card/is_card_number/37828224631 throughput [255434611.997op/s; 255585127.605op/s] or [-0.029%; +0.029%] None None None
credit_card/is_card_number/378282246310005 execution_time [73.669µs; 73.791µs] or [-0.082%; +0.082%] None None None
credit_card/is_card_number/378282246310005 throughput [13552319.116op/s; 13574594.933op/s] or [-0.082%; +0.082%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.121µs; 52.143µs] or [-0.022%; +0.022%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19177948.948op/s; 19186247.367op/s] or [-0.022%; +0.022%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.444µs; 6.456µs] or [-0.093%; +0.093%] None None None
credit_card/is_card_number/x371413321323331 throughput [154909241.832op/s; 155188137.201op/s] or [-0.090%; +0.090%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.914µs; 3.914µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ throughput [255463959.849op/s; 255519102.976op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [63.934µs; 63.952µs] or [-0.014%; +0.014%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15636774.426op/s; 15641265.666op/s] or [-0.014%; +0.014%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [57.545µs; 57.575µs] or [-0.025%; +0.025%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17368873.647op/s; 17377596.979op/s] or [-0.025%; +0.025%] 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 [255478875.001op/s; 255535044.696op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [54.695µs; 54.738µs] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18269100.473op/s; 18283375.540op/s] or [-0.039%; +0.039%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.107µs; 52.127µs] or [-0.019%; +0.019%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19183785.010op/s; 19191228.754op/s] or [-0.019%; +0.019%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.529µs; 6.553µs] or [-0.189%; +0.189%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [152623455.306op/s; 153199576.759op/s] or [-0.188%; +0.188%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.932µs 5.010µs ± 0.034µs 5.003µs ± 0.029µs 5.047µs 5.054µs 5.056µs 5.066µs 1.26% -0.021 -1.425 0.68% 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 [5.005µs; 5.014µs] or [-0.095%; +0.095%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.601µs 209.079µs ± 0.158µs 209.074µs ± 0.105µs 209.184µs 209.320µs 209.433µs 209.600µs 0.25% -0.009 0.651 0.08% 0.011µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4770985.411op/s 4782880.790op/s ± 3606.726op/s 4783002.485op/s ± 2407.478op/s 4785342.337op/s 4788013.093op/s 4792001.237op/s 4793837.681op/s 0.23% 0.015 0.651 0.08% 255.034op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.601µs 18.676µs ± 0.034µs 18.671µs ± 0.013µs 18.690µs 18.721µs 18.780µs 18.953µs 1.51% 2.882 20.203 0.18% 0.002µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 52761906.976op/s 53544290.960op/s ± 98113.153op/s 53557864.849op/s ± 37666.418op/s 53588700.141op/s 53685722.778op/s 53706638.292op/s 53761726.207op/s 0.38% -2.807 19.454 0.18% 6937.648op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.828µs 10.876µs ± 0.026µs 10.871µs ± 0.016µs 10.894µs 10.918µs 10.946µs 10.964µs 0.86% 0.395 0.263 0.23% 0.002µs 1 200
normalization/normalize_name/normalize_name/good throughput 91206180.692op/s 91944730.683op/s ± 215715.471op/s 91986653.445op/s ± 131875.848op/s 92074101.959op/s 92314419.789op/s 92340397.429op/s 92351715.113op/s 0.40% -0.380 0.238 0.23% 15253.387op/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.057µs; 209.101µ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 [4782380.933op/s; 4783380.648op/s] or [-0.010%; +0.010%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.671µs; 18.681µs] or [-0.026%; +0.026%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [53530693.421op/s; 53557888.500op/s] or [-0.025%; +0.025%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.873µs; 10.880µs] or [-0.033%; +0.033%] None None None
normalization/normalize_name/normalize_name/good throughput [91914834.594op/s; 91974626.773op/s] or [-0.033%; +0.033%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.185µs 33.783µs ± 0.944µs 33.368µs ± 0.083µs 33.475µs 35.752µs 35.818µs 37.634µs 12.79% 1.770 1.594 2.79% 0.067µ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.652µs; 33.914µs] or [-0.387%; +0.387%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.751µs 26.733µs ± 11.203µs 18.512µs ± 0.214µs 35.551µs 46.965µs 48.607µs 92.070µs 397.35% 1.705 5.468 41.80% 0.792µ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.180µs; 28.286µs] or [-5.808%; +5.808%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.792µs 504.960µs ± 0.568µs 504.933µs ± 0.349µs 505.289µs 505.698µs 506.255µs 508.942µs 0.79% 1.671 10.792 0.11% 0.040µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1964861.079op/s 1980358.392op/s ± 2221.518op/s 1980460.665op/s ± 1367.041op/s 1981760.755op/s 1983753.937op/s 1984540.968op/s 1984944.855op/s 0.23% -1.638 10.520 0.11% 157.085op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 453.590µs 455.436µs ± 0.558µs 455.454µs ± 0.390µs 455.826µs 456.207µs 456.720µs 457.033µs 0.35% -0.164 0.158 0.12% 0.039µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2188027.964op/s 2195702.617op/s ± 2689.474op/s 2195610.689op/s ± 1883.739op/s 2197509.096op/s 2200212.326op/s 2201965.922op/s 2204635.599op/s 0.41% 0.172 0.164 0.12% 190.175op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 177.297µs 177.638µs ± 0.107µs 177.636µs ± 0.059µs 177.693µs 177.822µs 177.904µs 177.956µs 0.18% 0.218 0.531 0.06% 0.008µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5619374.287op/s 5629442.409op/s ± 3380.062op/s 5629487.972op/s ± 1878.296op/s 5631401.491op/s 5635071.105op/s 5636476.099op/s 5640237.842op/s 0.19% -0.214 0.530 0.06% 239.006op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.628µs 37.711µs ± 0.040µs 37.708µs ± 0.026µs 37.738µs 37.788µs 37.808µs 37.815µs 0.28% 0.359 -0.272 0.11% 0.003µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26444687.555op/s 26517441.731op/s ± 28196.896op/s 26519857.158op/s ± 18525.525op/s 26536947.234op/s 26562601.437op/s 26569194.077op/s 26576239.000op/s 0.21% -0.354 -0.277 0.11% 1993.822op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 48.211µs 48.324µs ± 0.047µs 48.320µs ± 0.030µs 48.350µs 48.396µs 48.433µs 48.571µs 0.52% 0.846 3.054 0.10% 0.003µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 20588561.463op/s 20693824.480op/s ± 20314.575op/s 20695305.838op/s ± 12797.847op/s 20707591.344op/s 20722197.793op/s 20739319.261op/s 20742139.613op/s 0.23% -0.833 2.998 0.10% 1436.457op/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 [504.881µs; 505.038µs] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1980050.511op/s; 1980666.273op/s] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [455.358µs; 455.513µs] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2195329.882op/s; 2196075.353op/s] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [177.623µs; 177.652µs] or [-0.008%; +0.008%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5628973.965op/s; 5629910.853op/s] or [-0.008%; +0.008%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.706µs; 37.717µs] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26513533.913op/s; 26521349.550op/s] or [-0.015%; +0.015%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [48.317µs; 48.330µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [20691009.075op/s; 20696639.884op/s] or [-0.014%; +0.014%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 0c54fed 1744033991 paullgdc/ddtelemetry/fix_config_api
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.410ms 54.737ms ± 0.252ms 54.691ms ± 0.135ms 54.807ms 55.222ms 55.471ms 56.311ms 2.96% 1.959 7.301 0.46% 0.018ms 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.702ms; 54.771ms] or [-0.064%; +0.064%] None None None

Baseline

Omitted due to size.

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.

Looks good to me - nothing block. A few questions/comment.

// It should receive 3 payloads: app-started, metrics and app-closing.
mock_metrics.assert_hits(3);
// It should receive 1 payloads: metrics
mock_metrics.assert_hits(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

/question

do all the libraries have telemetry which send started and closing?

Just wondering if this would ever make sense to do all the telemetry via native.

Copy link
Contributor Author

@paullegranddc paullegranddc Apr 4, 2025

Choose a reason for hiding this comment

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

Yes all the libraries have a telemetry cleint sending started and closing. This is tested in system-tests
The issue is the additional data sent with app-started and app-closing. The existing telemetry clients in libraries also send their dependencies and configuration.

There is an API for this on the telemetry client, and we could eventually replace the in-language telemetry client with the libdatadog one, but IMO this should not be done in the same initiative as the trace exporter integration to prevent scope creep.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect 👌


if let Some(id) = self.runtime_id {
builder.runtime_id = Some(id);
}

let (worker, handle) = builder
.spawn_with_config(self.config)
.spawn()
Copy link
Contributor

@ganeshnj ganeshnj Apr 4, 2025

Choose a reason for hiding this comment

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

these two APIs with_config and spawn_with_config/spawn look very confusing, could you add some docs which one to use and when?

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 removed spawn_with_config in favor of spawn

The issue was that the config passed in spawn_with_config would actually be used as the default values.
So if you did this, you would end up with debug_logging_enabled = true in the final config.

let mut builder = TelemetryWorkerBuilder::new(...):
builder.config.debug_logging_enabled = Some(true);
builder
    .spawn_with_config(Config {
        debug_logging_enabled: false,
        ..default(),
    })

Copy link
Contributor

Choose a reason for hiding this comment

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

frankly we should just remove one, two configs all coming from manual code configuration is a bad API.

Although, I'm not going to block the PR for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I know, but I'm fixing the priority first, and then I think I'll add a builder pattern in a followup PR. The issue is that doing both at the same time makes the changes really hard to distinguish

@r1viollet
Copy link
Contributor

r1viollet commented Apr 4, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 77.58 MB 77.67 MB +.11% (+89.17 KB) 🔍
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.78 MB 7.78 MB +.05% (+4.34 KB) 🔍
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 23.97 MB 24.01 MB +.16% (+40.73 KB) 🔍
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 7.71 MB 7.71 MB +.05% (+4.21 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 22.54 MB 22.58 MB +.17% (+41.53 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 71.82 MB 71.90 MB +.12% (+90.04 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 16.83 MB 16.85 MB +.15% (+26.00 KB) 🔍
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 61.83 KB 61.83 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 112.71 MB 113.01 MB +.27% (+312.00 KB) 🔍
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 629.43 MB 630.55 MB +.17% (+1.11 MB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 5.03 MB 5.04 MB +.16% (+8.50 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 61.83 KB 61.83 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 16.03 MB 16.05 MB +.14% (+24.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 26.65 MB 26.71 MB +.19% (+52.13 KB) 🔍
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 14.23 MB 14.25 MB +.15% (+22.00 KB) 🔍
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 62.78 KB 62.78 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 114.69 MB 115.01 MB +.27% (+328.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 621.56 MB 622.49 MB +.15% (+956.79 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 3.80 MB 3.81 MB +.19% (+7.50 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 62.78 KB 62.78 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 16.65 MB 16.67 MB +.14% (+24.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 24.56 MB 24.60 MB +.19% (+47.79 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 66.88 MB 66.96 MB +.12% (+85.14 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.24 MB 8.24 MB +.08% (+6.89 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so.debug 23.13 MB 23.17 MB +.16% (+38.37 KB) 🔍
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 67.79 MB 67.87 MB +.12% (+88.38 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 8.12 MB 8.13 MB +.17% (+14.89 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so.debug 20.75 MB 20.79 MB +.18% (+39.71 KB) 🔍

@paullegranddc paullegranddc merged commit 59a0bbc into main Apr 7, 2025
35 checks passed
@paullegranddc paullegranddc deleted the paullgdc/ddtelemetry/fix_config_api branch April 7, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants