Skip to content

[SVLS-6337] Set resource group correctly for Azure functions on flex consumption plans#1241

Merged
dd-mergequeue[bot] merged 11 commits intomainfrom
kathie.huang/fix-flex-rg-span-attribute
Oct 1, 2025
Merged

[SVLS-6337] Set resource group correctly for Azure functions on flex consumption plans#1241
dd-mergequeue[bot] merged 11 commits intomainfrom
kathie.huang/fix-flex-rg-span-attribute

Conversation

@kathiehuang
Copy link
Copy Markdown
Contributor

@kathiehuang kathiehuang commented Sep 24, 2025

What does this PR do?

We plan on changing the public docs to ask customers who are using Datadog to monitor their Azure functions on the flex consumption plan to add a DD_AZURE_RESOURCE_GROUP environment variable in their Azure app settings. This PR handles the logic to check for that env var to accurately update the resource group span attribute for flex consumption functions.

  • Changes the logic for setting the resource group for Azure metadata to:
    • First check for a DD_AZURE_RESOURCE_GROUP environment variable (which we ask flex consumption function users to add in Azure app settings)
    • Then check for the WEBSITE_RESOURCE_GROUP environment variable (which Azure automatically has for any function not on flex consumption plans)
    • Then check WEBSITE_SKU to see if the function is on a flex consumption plan. If so, it should have set DD_AZURE_RESOURCE_GROUP, so set the resource group to unknown.
    • Otherwise, extract the resource group from the WEBSITE_OWNER_NAME environment variable (which includes the resource group in a structure that is consistent across all plans except flex consumption). It sets the Azure metadata resource group span attribute accordingly.
  • With this standalone PR, the resource group will just be set to unknown. But we also made a PR for serverless-components/crates/datadog-trace-agent to check for these environment variables similarly so that if we see that the customer hasn't set DD_AZURE_RESOURCE_GROUP for a flex consumption function, we will shut down the tracer (link to PR). We also plan to update the serverless-compat layers for defense in depth.

Also fixed spelling error for WEBSITE_OWNER_NAME variable

Motivation

  • Currently the aas.resource.group span attribute for functions on flex consumption plans is set incorrectly in Datadog - they're all set to "flex"
    • This is important to fix because aas.resource.id is built using aas.resource.group, and the resource id is used in billing, which needs to be accurate
493586648-eebdef47-f783-445a-8550-3a88e49db6b5

Jira Ticket - more context on our investigation can be found here, e.g. there is a precedent for asking for this env var with Azure Container Apps using serverless-init

Additional Notes

Once this PR is merged, we plan to make a new PR in serverless-components/datadog-trace-agent to update the libdatadog commit hash.

How to test the change?

  1. Use git log to find this PR's most recent commit hash (currently d1b35ef21fff3c4588073504905081c8923bbc4b)
  2. Clone serverless-components and update the commit hash in datadog-trace-agent/Cargo.toml
    everywhere that libdatadog is used
  3. Follow the instructions in the Serverless Compatability Layer docs to build the Rust binary
  4. Deploy an Azure function on flex consumption plan using the terraform tool, setting use_serverless_compat_local_path to true and making sure the built binary is in your python folder
  5. Hit an endpoint in your function or wait a minute for the invoker to invoke your function and check the Datadog traces for your function. Without the DD_AZURE_RESOURCE_GROUP env var, you should see unknown as the resource group. (There is a PR in serverless-components/datadog-trace-agent that will shut down the trace agent, causing no traces to be sent to Datadog, if DD_AZURE_RESOURCE_GROUP is missing)
  6. Go to Settings > Environment Variables in the Azure Portal for your function and add DD_AZURE_RESOURCE_GROUP as an environment variable with your resource group. Repeat step 5, you should see the correct resource group in the resource.group span attribute!

No DD_AZURE_RESOURCE_GROUP environment variable -> unknown resource group:
image

DD_AZURE_RESOURCE_GROUP environment variable set -> resource group correctly set
image

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Sep 24, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: d88f866 | Docs | Was this helpful? Give us feedback!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.63%. Comparing base (d346130) to head (d88f866).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1241      +/-   ##
==========================================
- Coverage   71.64%   71.63%   -0.01%     
==========================================
  Files         355      355              
  Lines       56385    56443      +58     
==========================================
+ Hits        40398    40435      +37     
- Misses      15987    16008      +21     
Components Coverage Δ
datadog-crashtracker 49.33% <ø> (ø)
datadog-crashtracker-ffi 5.93% <ø> (ø)
datadog-alloc 98.73% <ø> (ø)
data-pipeline 90.47% <ø> (ø)
data-pipeline-ffi 88.19% <ø> (ø)
ddcommon 84.54% <100.00%> (+0.24%) ⬆️
ddcommon-ffi 73.84% <ø> (ø)
ddtelemetry 59.49% <ø> (ø)
ddtelemetry-ffi 21.24% <ø> (ø)
dogstatsd-client 83.26% <ø> (ø)
datadog-ipc 82.39% <ø> (ø)
datadog-profiling 76.90% <ø> (ø)
datadog-profiling-ffi 62.12% <ø> (ø)
datadog-sidecar 37.19% <ø> (ø)
datdog-sidecar-ffi 11.87% <ø> (ø)
spawn-worker 55.35% <ø> (ø)
tinybytes 92.22% <ø> (ø)
datadog-trace-normalization 98.24% <ø> (ø)
datadog-trace-obfuscation 94.17% <ø> (ø)
datadog-trace-protobuf 59.65% <ø> (ø)
datadog-trace-utils 89.77% <ø> (ø)
datadog-tracer-flare 54.52% <ø> (ø)
datadog-log 76.31% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kathiehuang kathiehuang force-pushed the kathie.huang/fix-flex-rg-span-attribute branch from d71aa73 to 8d45f9b Compare September 24, 2025 22:46
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Sep 24, 2025

Benchmarks

Comparison

Benchmark execution time: 2025-10-01 16:33:58

Comparing candidate commit d88f866 in PR branch kathie.huang/fix-flex-rg-span-attribute with baseline commit d346130 in branch main.

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

scenario:credit_card/is_card_number/378282246310005

  • 🟥 execution_time [+9.941µs; +10.242µs] or [+14.594%; +15.035%]
  • 🟥 throughput [-1921393.825op/s; -1866528.434op/s] or [-13.087%; -12.713%]

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 d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.249ms 6.308ms ± 0.033ms 6.301ms ± 0.017ms 6.323ms 6.370ms 6.402ms 6.472ms 2.72% 1.487 3.804 0.51% 0.002ms 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.303ms; 6.312ms] or [-0.071%; +0.071%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.986µs 5.038µs ± 0.036µs 5.021µs ± 0.022µs 5.076µs 5.093µs 5.097µs 5.098µs 1.53% 0.341 -1.567 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.033µs; 5.043µs] or [-0.100%; +0.100%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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 87.451µs 87.706µs ± 0.225µs 87.682µs ± 0.073µs 87.752µs 87.942µs 88.080µs 90.345µs 3.04% 8.289 93.244 0.26% 0.016µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [87.675µs; 87.737µs] or [-0.036%; +0.036%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.838µs 26.031µs ± 9.696µs 18.493µs ± 0.287µs 34.337µs 44.348µs 45.261µs 66.337µs 258.72% 0.982 0.589 37.16% 0.686µ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.688µs; 27.375µs] or [-5.162%; +5.162%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 534.226µs 534.948µs ± 0.309µs 534.914µs ± 0.194µs 535.124µs 535.539µs 535.735µs 535.870µs 0.18% 0.543 0.261 0.06% 0.022µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 1866124.861op/s 1869342.861op/s ± 1080.104op/s 1869460.623op/s ± 679.238op/s 1870051.702op/s 1870852.643op/s 1871608.352op/s 1871867.169op/s 0.13% -0.539 0.256 0.06% 76.375op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 385.220µs 386.319µs ± 1.014µs 386.197µs ± 0.292µs 386.484µs 386.971µs 389.960µs 395.751µs 2.47% 7.013 58.381 0.26% 0.072µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2526840.502op/s 2588554.426op/s ± 6675.801op/s 2589350.847op/s ± 1956.670op/s 2591326.671op/s 2592944.982op/s 2594515.432op/s 2595918.602op/s 0.25% -6.925 57.296 0.26% 472.050op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 193.595µs 194.204µs ± 0.237µs 194.196µs ± 0.153µs 194.343µs 194.599µs 194.772µs 195.553µs 0.70% 0.940 4.423 0.12% 0.017µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5113710.760op/s 5149223.646op/s ± 6285.172op/s 5149442.583op/s ± 4064.532op/s 5153674.260op/s 5158836.293op/s 5162108.241op/s 5165432.491op/s 0.31% -0.919 4.316 0.12% 444.429op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 35.986µs 36.117µs ± 0.053µs 36.119µs ± 0.039µs 36.153µs 36.202µs 36.241µs 36.243µs 0.34% -0.010 -0.508 0.15% 0.004µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 27591276.780op/s 27687865.877op/s ± 40578.484op/s 27686102.921op/s ± 30226.819op/s 27717726.027op/s 27754271.278op/s 27774080.005op/s 27788260.482op/s 0.37% 0.017 -0.508 0.15% 2869.332op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 44.896µs 45.087µs ± 0.152µs 45.085µs ± 0.143µs 45.204µs 45.331µs 45.374µs 45.419µs 0.74% 0.211 -1.236 0.34% 0.011µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 22017174.375op/s 22179745.236op/s ± 74634.157op/s 22180470.966op/s ± 70118.605op/s 22262968.985op/s 22272081.439op/s 22273644.147op/s 22273732.291op/s 0.42% -0.204 -1.243 0.34% 5277.432op/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 [534.905µs; 534.990µs] or [-0.008%; +0.008%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [1869193.169op/s; 1869492.553op/s] or [-0.008%; +0.008%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [386.178µs; 386.459µs] or [-0.036%; +0.036%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2587629.224op/s; 2589479.628op/s] or [-0.036%; +0.036%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [194.171µs; 194.237µs] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5148352.581op/s; 5150094.710op/s] or [-0.017%; +0.017%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [36.110µs; 36.124µs] or [-0.020%; +0.020%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [27682242.089op/s; 27693489.665op/s] or [-0.020%; +0.020%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.066µs; 45.108µs] or [-0.047%; +0.047%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [22169401.660op/s; 22190088.812op/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 d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.205µs 3.247µs ± 1.451µs 3.016µs ± 0.025µs 3.042µs 3.665µs 14.499µs 14.841µs 392.14% 7.293 54.457 44.58% 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.045µs; 3.448µs] or [-6.194%; +6.194%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.347ms 14.431ms ± 0.036ms 14.429ms ± 0.020ms 14.449ms 14.488ms 14.552ms 14.586ms 1.09% 1.092 2.890 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.426ms; 14.436ms] 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 d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.379ms 61.055ms ± 2.297ms 60.801ms ± 0.063ms 60.861ms 60.954ms 77.509ms 80.645ms 32.64% 8.007 62.711 3.75% 0.162ms 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.737ms; 61.374ms] or [-0.521%; +0.521%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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 241.218ns 252.997ns ± 13.476ns 247.695ns ± 4.078ns 254.425ns 284.718ns 297.585ns 298.915ns 20.68% 1.760 2.448 5.31% 0.953ns 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 [251.130ns; 254.865ns] or [-0.738%; +0.738%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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 186.491µs 186.807µs ± 0.288µs 186.761µs ± 0.124µs 186.883µs 187.220µs 188.034µs 188.980µs 1.19% 3.945 23.342 0.15% 0.020µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 5291572.945op/s 5353141.081op/s ± 8193.214op/s 5354438.029op/s ± 3562.262op/s 5358014.132op/s 5360868.649op/s 5361829.218op/s 5362196.967op/s 0.14% -3.900 22.905 0.15% 579.348op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 17.630µs 17.876µs ± 0.095µs 17.914µs ± 0.027µs 17.936µs 17.962µs 17.983µs 18.009µs 0.53% -1.244 0.130 0.53% 0.007µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 55528999.326op/s 55943015.415op/s ± 299894.001op/s 55823157.818op/s ± 83652.995op/s 55968269.723op/s 56558123.527op/s 56671812.771op/s 56720130.116op/s 1.61% 1.254 0.149 0.53% 21205.708op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 9.853µs 9.913µs ± 0.047µs 9.898µs ± 0.013µs 9.921µs 10.043µs 10.072µs 10.090µs 1.94% 2.152 4.250 0.48% 0.003µs 1 200
normalization/normalize_name/normalize_name/good throughput 99111078.741op/s 100879549.421op/s ± 476481.652op/s 101033101.737op/s ± 131672.690op/s 101131891.885op/s 101354281.333op/s 101442922.723op/s 101496145.453op/s 0.46% -2.128 4.163 0.47% 33692.341op/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 [186.767µs; 186.847µs] or [-0.021%; +0.021%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [5352005.580op/s; 5354276.581op/s] or [-0.021%; +0.021%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [17.863µs; 17.889µs] or [-0.074%; +0.074%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [55901452.991op/s; 55984577.839op/s] or [-0.074%; +0.074%] None None None
normalization/normalize_name/normalize_name/good execution_time [9.906µs; 9.920µs] or [-0.066%; +0.066%] None None None
normalization/normalize_name/normalize_name/good throughput [100813513.646op/s; 100945585.195op/s] or [-0.065%; +0.065%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.912µs ± 0.003µs 3.912µs ± 0.002µs 3.914µs 3.917µs 3.919µs 3.920µs 0.21% -0.605 4.149 0.08% 0.000µs 1 200
credit_card/is_card_number/ throughput 255101735.410op/s 255604100.208op/s ± 201079.835op/s 255626264.605op/s ± 127993.241op/s 255741692.290op/s 255884097.095op/s 255923177.517op/s 256753201.633op/s 0.44% 0.619 4.225 0.08% 14218.491op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 76.820µs 78.424µs ± 0.816µs 78.378µs ± 0.516µs 78.906µs 79.588µs 80.538µs 83.813µs 6.93% 1.539 8.345 1.04% 0.058µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 11931311.069op/s 12752522.107op/s ± 130800.432op/s 12758693.981op/s ± 84170.003op/s 12836141.453op/s 12937350.847op/s 13008962.654op/s 13017485.738op/s 2.03% -1.309 6.661 1.02% 9248.987op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 69.865µs 70.998µs ± 0.679µs 70.884µs ± 0.420µs 71.392µs 72.175µs 72.874µs 74.833µs 5.57% 1.321 4.352 0.95% 0.048µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13363024.342op/s 14086173.792op/s ± 133071.724op/s 14107612.079op/s ± 83038.454op/s 14176501.144op/s 14274419.968op/s 14302627.252op/s 14313361.826op/s 1.46% -1.196 3.615 0.94% 9409.592op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.898µs 3.913µs ± 0.006µs 3.912µs ± 0.002µs 3.914µs 3.917µs 3.921µs 3.963µs 1.31% 6.174 51.022 0.15% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 252321789.718op/s 255574474.062op/s ± 381017.913op/s 255614701.570op/s ± 145218.352op/s 255761638.563op/s 255885234.051op/s 255923518.491op/s 256571007.255op/s 0.37% -6.107 50.310 0.15% 26942.035op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 76.862µs 78.210µs ± 0.872µs 78.014µs ± 0.634µs 78.747µs 79.870µs 80.481µs 80.721µs 3.47% 0.740 0.032 1.11% 0.062µs 1 200
credit_card/is_card_number/378282246310005 throughput 12388275.045op/s 12787679.926op/s ± 141526.469op/s 12818149.076op/s ± 104143.898op/s 12886336.339op/s 12972314.837op/s 13001634.010op/s 13010382.689op/s 1.50% -0.691 -0.062 1.10% 10007.433op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 52.145µs 52.230µs ± 0.056µs 52.226µs ± 0.028µs 52.253µs 52.298µs 52.318µs 52.791µs 1.08% 5.117 49.192 0.11% 0.004µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 18942673.255op/s 19146282.772op/s ± 20358.298op/s 19147652.234op/s ± 10157.480op/s 19157783.430op/s 19170114.846op/s 19173553.979op/s 19177330.478op/s 0.15% -5.038 48.146 0.11% 1439.549op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 6.027µs 6.039µs ± 0.016µs 6.034µs ± 0.003µs 6.038µs 6.072µs 6.107µs 6.109µs 1.25% 2.854 8.056 0.26% 0.001µs 1 200
credit_card/is_card_number/x371413321323331 throughput 163683145.387op/s 165603164.728op/s ± 427470.213op/s 165736486.889op/s ± 84593.882op/s 165812918.598op/s 165881033.441op/s 165907224.926op/s 165911686.721op/s 0.11% -2.839 7.959 0.26% 30226.709op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.891µs 3.911µs ± 0.003µs 3.911µs ± 0.002µs 3.913µs 3.915µs 3.918µs 3.920µs 0.21% -1.462 12.454 0.07% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255129275.810op/s 255671116.960op/s ± 182138.217op/s 255671684.362op/s ± 107568.840op/s 255779636.990op/s 255907040.317op/s 255969187.956op/s 256983865.695op/s 0.51% 1.488 12.652 0.07% 12879.117op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 64.028µs 64.415µs ± 0.167µs 64.402µs ± 0.095µs 64.497µs 64.716µs 64.865µs 64.986µs 0.91% 0.534 0.715 0.26% 0.012µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15387900.868op/s 15524446.352op/s ± 40111.693op/s 15527449.545op/s ± 22827.845op/s 15548653.731op/s 15586397.212op/s 15608699.541op/s 15618126.397op/s 0.58% -0.515 0.687 0.26% 2836.325op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 58.134µs 58.344µs ± 0.142µs 58.303µs ± 0.079µs 58.408µs 58.614µs 58.769µs 58.910µs 1.04% 1.158 1.259 0.24% 0.010µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 16974922.710op/s 17139786.732op/s ± 41669.585op/s 17151683.708op/s ± 23261.670op/s 17167794.077op/s 17190419.782op/s 17200420.138op/s 17201713.291op/s 0.29% -1.144 1.209 0.24% 2946.485op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.890µs 3.913µs ± 0.004µs 3.913µs ± 0.002µs 3.915µs 3.919µs 3.921µs 3.922µs 0.24% -0.774 5.959 0.09% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 254985886.526op/s 255570379.702op/s ± 241065.766op/s 255585561.566op/s ± 142875.438op/s 255726966.409op/s 255904561.155op/s 255939531.769op/s 257057314.030op/s 0.58% 0.795 6.090 0.09% 17045.924op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 54.556µs 54.860µs ± 0.241µs 54.811µs ± 0.149µs 54.966µs 55.298µs 55.749µs 55.774µs 1.76% 1.446 2.523 0.44% 0.017µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17929650.518op/s 18228413.736op/s ± 79470.289op/s 18244514.782op/s ± 49480.242op/s 18289581.340op/s 18310908.908op/s 18325697.470op/s 18329954.812op/s 0.47% -1.414 2.391 0.43% 5619.398op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 52.147µs 52.214µs ± 0.036µs 52.210µs ± 0.023µs 52.236µs 52.277µs 52.325µs 52.340µs 0.25% 0.712 0.651 0.07% 0.003µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19105968.068op/s 19152017.729op/s ± 13259.658op/s 19153576.519op/s ± 8306.663op/s 19160863.936op/s 19171753.394op/s 19175078.974op/s 19176472.386op/s 0.12% -0.708 0.641 0.07% 937.599op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 6.026µs 6.037µs ± 0.009µs 6.035µs ± 0.003µs 6.039µs 6.045µs 6.072µs 6.109µs 1.23% 3.929 21.157 0.16% 0.001µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 163692944.439op/s 165657277.821op/s ± 255990.321op/s 165709569.736op/s ± 95169.122op/s 165795348.906op/s 165876482.630op/s 165925199.161op/s 165934382.315op/s 0.14% -3.893 20.778 0.15% 18101.249op/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.913µs] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ throughput [255576232.477op/s; 255631967.939op/s] or [-0.011%; +0.011%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [78.311µs; 78.537µs] or [-0.144%; +0.144%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12734394.426op/s; 12770649.789op/s] or [-0.142%; +0.142%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [70.904µs; 71.092µs] or [-0.132%; +0.132%] None None None
credit_card/is_card_number/ 378282246310005 throughput [14067731.331op/s; 14104616.253op/s] or [-0.131%; +0.131%] None None None
credit_card/is_card_number/37828224631 execution_time [3.912µs; 3.914µs] or [-0.021%; +0.021%] None None None
credit_card/is_card_number/37828224631 throughput [255521668.643op/s; 255627279.480op/s] or [-0.021%; +0.021%] None None None
credit_card/is_card_number/378282246310005 execution_time [78.089µs; 78.331µs] or [-0.155%; +0.155%] None None None
credit_card/is_card_number/378282246310005 throughput [12768065.718op/s; 12807294.133op/s] or [-0.153%; +0.153%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.222µs; 52.237µs] or [-0.015%; +0.015%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19143461.308op/s; 19149104.236op/s] or [-0.015%; +0.015%] None None None
credit_card/is_card_number/x371413321323331 execution_time [6.036µs; 6.041µs] or [-0.036%; +0.036%] None None None
credit_card/is_card_number/x371413321323331 throughput [165543921.468op/s; 165662407.989op/s] or [-0.036%; +0.036%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.911µs; 3.912µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ throughput [255645874.355op/s; 255696359.565op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [64.392µs; 64.438µs] or [-0.036%; +0.036%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15518887.257op/s; 15530005.447op/s] or [-0.036%; +0.036%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [58.324µs; 58.364µs] or [-0.034%; +0.034%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17134011.729op/s; 17145561.736op/s] or [-0.034%; +0.034%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.912µs; 3.913µs] or [-0.013%; +0.013%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255536970.305op/s; 255603789.099op/s] or [-0.013%; +0.013%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [54.827µs; 54.894µs] or [-0.061%; +0.061%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18217399.918op/s; 18239427.554op/s] or [-0.060%; +0.060%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.209µs; 52.219µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19150180.068op/s; 19153855.390op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [6.035µs; 6.038µs] or [-0.022%; +0.022%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [165621800.024op/s; 165692755.617op/s] or [-0.021%; +0.021%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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 35.403µs 35.717µs ± 0.460µs 35.541µs ± 0.065µs 35.608µs 36.524µs 36.598µs 39.404µs 10.87% 3.407 19.421 1.29% 0.033µ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 [35.653µs; 35.780µs] or [-0.179%; +0.179%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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 157.000µs 157.931µs ± 0.439µs 157.843µs ± 0.155µs 158.019µs 158.533µs 159.278µs 161.449µs 2.28% 4.316 28.339 0.28% 0.031µ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 [157.870µs; 157.991µs] or [-0.038%; +0.038%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.473ms 10.502ms ± 0.014ms 10.500ms ± 0.008ms 10.510ms 10.525ms 10.540ms 10.585ms 0.81% 1.359 5.487 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 [10.500ms; 10.504ms] or [-0.018%; +0.018%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz d88f866 1759335724 kathie.huang/fix-flex-rg-span-attribute
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.422µs 2.446µs ± 0.016µs 2.442µs ± 0.008µs 2.452µs 2.489µs 2.497µs 2.510µs 2.83% 1.667 2.874 0.67% 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.444µs; 2.448µs] or [-0.092%; +0.092%] None None None

Baseline

Omitted due to size.

@lucaspimentel
Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Copy link
Copy Markdown
Contributor

@duncanpharvey duncanpharvey 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! Just one minor comment

Comment thread ddcommon/src/azure_app_services.rs Outdated
let extracted =
AzureMetadata::extract_resource_group(query.get_var(WEBSITE_OWNER_NAME));
match extracted.as_deref() {
Some("flex") => None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very much an edge case but what if a customer happens to name their resource group flex? Would the span attribute end up resolving to unknown?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems to me that the WEBSITE_RESOURCE_GROUP environment variable is normally available in Azure Functions (except if they're on the flex consumption plan), so if we're not in a flex consumption function, then checking WEBSITE_RESOURCE_GROUP should be able to return the correct resource group, and we won't get to the part where it checks WEBSITE_OWNER_NAME.

Is WEBSITE_RESOURCE_GROUP sometimes not set in Azure functions? If so, when checking WEBSITE_OWNER_NAME and extracting the resource group from there, if it's "flex", I could also check if the WEBSITE_SKU env var is also not FlexConsumption (and return "flex")?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah I think checking if the WEBSITE_SKU is FlexConsumption (or whatever the specific value is) is a better approach compared to checking if the extracted value from the WEBSITE_OWNER_NAME is flex. Then it doesn't matter what the extracted value parsed from WEBSITE_OWNER_NAME is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, that makes sense! I changed it check WEBSITE_SKU == FlexConsumption rather than checking if the extracted value is flex!

@kathiehuang
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

@kathiehuang kathiehuang force-pushed the kathie.huang/fix-flex-rg-span-attribute branch from a777daf to d1b35ef Compare September 29, 2025 13:15
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Sep 29, 2025

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 71.29 MB 71.29 MB +0% (+2.70 KB) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.25 MB 7.25 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.27 MB 9.27 MB +0% (+48 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 83.61 MB 83.62 MB +0% (+2.52 KB) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 18.47 MB 18.47 MB +0% (+1.00 KB) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 65.77 KB 65.77 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 125.27 MB 125.28 MB +0% (+8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 654.82 MB 654.82 MB +0% (+1.33 KB) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 5.92 MB 5.92 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 65.77 KB 65.77 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 17.44 MB 17.44 MB +.04% (+8.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 32.39 MB 32.39 MB +0% (+1.63 KB) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 15.75 MB 15.75 MB +0% (+1.50 KB) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 66.79 KB 66.79 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 127.61 MB 127.62 MB +0% (+8.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 645.00 MB 645.00 MB +0% (+1.62 KB) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 4.53 MB 4.53 MB +.02% (+1.00 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 66.79 KB 66.79 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 18.57 MB 18.57 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 30.42 MB 30.42 MB +0% (+1.40 KB) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 63.91 MB 63.91 MB +0% (+2.69 KB) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.56 MB 8.56 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 78.33 MB 78.33 MB +0% (+3.13 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.91 MB 9.91 MB 0% (0 B) 👌

Copy link
Copy Markdown
Contributor

@duncanpharvey duncanpharvey left a comment

Choose a reason for hiding this comment

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

LGTM!

@kathiehuang
Copy link
Copy Markdown
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link
Copy Markdown

dd-devflow-routing-codex Bot commented Oct 1, 2025

View all feedbacks in Devflow UI.

2025-10-01 16:20:52 UTC ℹ️ Start processing command /merge


2025-10-01 16:20:58 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 45m (p90).


2025-10-01 16:22:02 UTC ⚠️ MergeQueue: This merge request build was cancelled

kathie.huang@datadoghq.com cancelled this merge request build

@kathiehuang
Copy link
Copy Markdown
Contributor Author

/remove

@dd-devflow-routing-codex
Copy link
Copy Markdown

dd-devflow-routing-codex Bot commented Oct 1, 2025

View all feedbacks in Devflow UI.

2025-10-01 16:21:55 UTC ℹ️ Start processing command /remove


2025-10-01 16:21:59 UTC ℹ️ Devflow: /remove

@kathiehuang
Copy link
Copy Markdown
Contributor Author

/merge

@dd-devflow-routing-codex
Copy link
Copy Markdown

dd-devflow-routing-codex Bot commented Oct 1, 2025

View all feedbacks in Devflow UI.

2025-10-01 16:23:32 UTC ℹ️ Start processing command /merge


2025-10-01 16:23:39 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2025-10-01 16:44:25 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 45m (p90).


2025-10-01 17:05:56 UTC ℹ️ MergeQueue: This merge request was merged

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