Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add azure-functions instrumentation #8432

Merged
merged 7 commits into from
Mar 5, 2025

Conversation

duncanpharvey
Copy link
Contributor

@duncanpharvey duncanpharvey commented Feb 21, 2025

What Does This Do

Add azure-functions instrumentation for Http triggers.

Motivation

Automatically generate spans for http requests made to Azure Functions.

Additional Notes

Azure documentation

Testing in a function deployed to Azure

Screenshot 2025-02-21 at 11 07 56 AM

Contributor Checklist

Jira ticket: SVLS-5920

@duncanpharvey duncanpharvey requested review from a team as code owners February 21, 2025 16:11
@duncanpharvey duncanpharvey requested a review from smola February 21, 2025 16:11
@pr-commenter
Copy link

pr-commenter bot commented Feb 21, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master duncan-harvey/azure-functions-instrumentation
git_commit_date 1740599532 1740599851
git_commit_sha 9e4966b a40817f
release_version 1.47.0-SNAPSHOT~9e4966b4a4 1.47.0-SNAPSHOT~a40817f409
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1740602461 1740602461
ci_job_id 824844117 824844117
ci_pipeline_id 57115569 57115569
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-q8fdmkyr-project-304-concurrent-1-egul8hcw 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Linux runner-q8fdmkyr-project-304-concurrent-1-egul8hcw 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.47.0-SNAPSHOT~a40817f409, baseline=1.47.0-SNAPSHOT~9e4966b4a4

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.039 s) : 0, 1039183
Total [baseline] (10.463 s) : 0, 10463131
Agent [candidate] (1.041 s) : 0, 1040667
Total [candidate] (10.342 s) : 0, 10341932
section appsec
Agent [baseline] (1.181 s) : 0, 1181474
Total [baseline] (10.752 s) : 0, 10751959
Agent [candidate] (1.182 s) : 0, 1181775
Total [candidate] (10.716 s) : 0, 10715711
section iast
Agent [baseline] (1.177 s) : 0, 1176574
Total [baseline] (10.997 s) : 0, 10997068
Agent [candidate] (1.179 s) : 0, 1179298
Total [candidate] (11.027 s) : 0, 11026763
section profiling
Agent [baseline] (1.263 s) : 0, 1262594
Total [baseline] (10.838 s) : 0, 10838179
Agent [candidate] (1.259 s) : 0, 1259377
Total [candidate] (10.823 s) : 0, 10822857
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.039 s -
Agent appsec 1.181 s 142.291 ms (13.7%)
Agent iast 1.177 s 137.39 ms (13.2%)
Agent profiling 1.263 s 223.411 ms (21.5%)
Total tracing 10.463 s -
Total appsec 10.752 s 288.829 ms (2.8%)
Total iast 10.997 s 533.938 ms (5.1%)
Total profiling 10.838 s 375.049 ms (3.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.041 s -
Agent appsec 1.182 s 141.109 ms (13.6%)
Agent iast 1.179 s 138.632 ms (13.3%)
Agent profiling 1.259 s 218.711 ms (21.0%)
Total tracing 10.342 s -
Total appsec 10.716 s 373.779 ms (3.6%)
Total iast 11.027 s 684.831 ms (6.6%)
Total profiling 10.823 s 480.925 ms (4.7%)
gantt
    title petclinic - break down per module: candidate=1.47.0-SNAPSHOT~a40817f409, baseline=1.47.0-SNAPSHOT~9e4966b4a4

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (717.486 ms) : 0, 717486
BytebuddyAgent [candidate] (717.05 ms) : 0, 717050
GlobalTracer [baseline] (239.118 ms) : 0, 239118
GlobalTracer [candidate] (239.18 ms) : 0, 239180
AppSec [baseline] (55.55 ms) : 0, 55550
AppSec [candidate] (55.421 ms) : 0, 55421
Remote Config [baseline] (715.632 µs) : 0, 716
Remote Config [candidate] (705.361 µs) : 0, 705
Telemetry [baseline] (11.359 ms) : 0, 11359
Telemetry [candidate] (13.023 ms) : 0, 13023
section appsec
BytebuddyAgent [baseline] (733.953 ms) : 0, 733953
BytebuddyAgent [candidate] (735.064 ms) : 0, 735064
GlobalTracer [baseline] (235.746 ms) : 0, 235746
GlobalTracer [candidate] (236.208 ms) : 0, 236208
AppSec [baseline] (177.245 ms) : 0, 177245
AppSec [candidate] (175.597 ms) : 0, 175597
Remote Config [baseline] (654.191 µs) : 0, 654
Remote Config [candidate] (662.772 µs) : 0, 663
Telemetry [baseline] (8.232 ms) : 0, 8232
Telemetry [candidate] (8.303 ms) : 0, 8303
IAST [baseline] (21.392 ms) : 0, 21392
IAST [candidate] (21.284 ms) : 0, 21284
section iast
BytebuddyAgent [baseline] (841.31 ms) : 0, 841310
BytebuddyAgent [candidate] (842.378 ms) : 0, 842378
GlobalTracer [baseline] (230.572 ms) : 0, 230572
GlobalTracer [candidate] (231.767 ms) : 0, 231767
AppSec [baseline] (57.293 ms) : 0, 57293
AppSec [candidate] (57.419 ms) : 0, 57419
Remote Config [baseline] (614.145 µs) : 0, 614
Remote Config [candidate] (616.409 µs) : 0, 616
Telemetry [baseline] (8.729 ms) : 0, 8729
Telemetry [candidate] (8.783 ms) : 0, 8783
IAST [baseline] (22.972 ms) : 0, 22972
IAST [candidate] (22.96 ms) : 0, 22960
section profiling
BytebuddyAgent [baseline] (710.961 ms) : 0, 710961
BytebuddyAgent [candidate] (707.897 ms) : 0, 707897
GlobalTracer [baseline] (349.443 ms) : 0, 349443
GlobalTracer [candidate] (348.866 ms) : 0, 348866
AppSec [baseline] (55.502 ms) : 0, 55502
AppSec [candidate] (54.477 ms) : 0, 54477
Remote Config [baseline] (668.14 µs) : 0, 668
Remote Config [candidate] (690.567 µs) : 0, 691
Telemetry [baseline] (8.937 ms) : 0, 8937
Telemetry [candidate] (8.93 ms) : 0, 8930
ProfilingAgent [baseline] (96.464 ms) : 0, 96464
ProfilingAgent [candidate] (96.132 ms) : 0, 96132
Profiling [baseline] (96.488 ms) : 0, 96488
Profiling [candidate] (96.155 ms) : 0, 96155
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.47.0-SNAPSHOT~a40817f409, baseline=1.47.0-SNAPSHOT~9e4966b4a4

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.036 s) : 0, 1035957
Total [baseline] (8.685 s) : 0, 8684870
Agent [candidate] (1.045 s) : 0, 1045488
Total [candidate] (8.717 s) : 0, 8716674
section iast
Agent [baseline] (1.169 s) : 0, 1168673
Total [baseline] (9.239 s) : 0, 9239304
Agent [candidate] (1.179 s) : 0, 1178904
Total [candidate] (9.26 s) : 0, 9259986
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.178 s) : 0, 1177644
Total [baseline] (9.195 s) : 0, 9194891
Agent [candidate] (1.172 s) : 0, 1171527
Total [candidate] (9.205 s) : 0, 9204824
section iast_TELEMETRY_OFF
Agent [baseline] (1.179 s) : 0, 1179337
Total [baseline] (9.23 s) : 0, 9229760
Agent [candidate] (1.171 s) : 0, 1170540
Total [candidate] (9.232 s) : 0, 9232338
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.036 s -
Agent iast 1.169 s 132.716 ms (12.8%)
Agent iast_HARDCODED_SECRET_DISABLED 1.178 s 141.686 ms (13.7%)
Agent iast_TELEMETRY_OFF 1.179 s 143.38 ms (13.8%)
Total tracing 8.685 s -
Total iast 9.239 s 554.434 ms (6.4%)
Total iast_HARDCODED_SECRET_DISABLED 9.195 s 510.021 ms (5.9%)
Total iast_TELEMETRY_OFF 9.23 s 544.89 ms (6.3%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.045 s -
Agent iast 1.179 s 133.416 ms (12.8%)
Agent iast_HARDCODED_SECRET_DISABLED 1.172 s 126.04 ms (12.1%)
Agent iast_TELEMETRY_OFF 1.171 s 125.052 ms (12.0%)
Total tracing 8.717 s -
Total iast 9.26 s 543.312 ms (6.2%)
Total iast_HARDCODED_SECRET_DISABLED 9.205 s 488.149 ms (5.6%)
Total iast_TELEMETRY_OFF 9.232 s 515.663 ms (5.9%)
gantt
    title insecure-bank - break down per module: candidate=1.47.0-SNAPSHOT~a40817f409, baseline=1.47.0-SNAPSHOT~9e4966b4a4

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (716.144 ms) : 0, 716144
BytebuddyAgent [candidate] (721.564 ms) : 0, 721564
GlobalTracer [baseline] (238.639 ms) : 0, 238639
GlobalTracer [candidate] (239.805 ms) : 0, 239805
AppSec [baseline] (55.521 ms) : 0, 55521
AppSec [candidate] (55.272 ms) : 0, 55272
Remote Config [baseline] (700.984 µs) : 0, 701
Remote Config [candidate] (697.125 µs) : 0, 697
Telemetry [baseline] (9.974 ms) : 0, 9974
Telemetry [candidate] (12.851 ms) : 0, 12851
section iast
BytebuddyAgent [baseline] (835.317 ms) : 0, 835317
BytebuddyAgent [candidate] (843.3 ms) : 0, 843300
GlobalTracer [baseline] (229.565 ms) : 0, 229565
GlobalTracer [candidate] (231.016 ms) : 0, 231016
AppSec [baseline] (56.679 ms) : 0, 56679
AppSec [candidate] (57.091 ms) : 0, 57091
Remote Config [baseline] (610.469 µs) : 0, 610
Remote Config [candidate] (620.448 µs) : 0, 620
Telemetry [baseline] (8.668 ms) : 0, 8668
Telemetry [candidate] (8.626 ms) : 0, 8626
IAST [baseline] (22.849 ms) : 0, 22849
IAST [candidate] (22.721 ms) : 0, 22721
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (841.283 ms) : 0, 841283
BytebuddyAgent [candidate] (836.68 ms) : 0, 836680
GlobalTracer [baseline] (230.693 ms) : 0, 230693
GlobalTracer [candidate] (230.004 ms) : 0, 230004
AppSec [baseline] (57.973 ms) : 0, 57973
AppSec [candidate] (57.405 ms) : 0, 57405
Remote Config [baseline] (619.299 µs) : 0, 619
Remote Config [candidate] (607.101 µs) : 0, 607
Telemetry [baseline] (8.906 ms) : 0, 8906
Telemetry [candidate] (8.683 ms) : 0, 8683
IAST [baseline] (23.119 ms) : 0, 23119
IAST [candidate] (22.88 ms) : 0, 22880
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (843.095 ms) : 0, 843095
BytebuddyAgent [candidate] (835.29 ms) : 0, 835290
GlobalTracer [baseline] (231.97 ms) : 0, 231970
GlobalTracer [candidate] (230.945 ms) : 0, 230945
AppSec [baseline] (53.377 ms) : 0, 53377
AppSec [candidate] (56.572 ms) : 0, 56572
Remote Config [baseline] (624.509 µs) : 0, 625
Remote Config [candidate] (622.667 µs) : 0, 623
Telemetry [baseline] (8.676 ms) : 0, 8676
Telemetry [candidate] (8.63 ms) : 0, 8630
IAST [baseline] (26.527 ms) : 0, 26527
IAST [candidate] (23.205 ms) : 0, 23205
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-02-26T20:13:23 2025-02-26T20:21:10
git_branch master duncan-harvey/azure-functions-instrumentation
git_commit_date 1740599532 1740599851
git_commit_sha 9e4966b a40817f
release_version 1.47.0-SNAPSHOT~9e4966b4a4 1.47.0-SNAPSHOT~a40817f409
start_time 2025-02-26T20:13:08 2025-02-26T20:20:56
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1740601671 1740601671
ci_job_id 824844120 824844120
ci_pipeline_id 57115569 57115569
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-q8fdmkyr-project-304-concurrent-2-fwp39h5f 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Linux runner-q8fdmkyr-project-304-concurrent-2-fwp39h5f 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
variant iast iast

Summary

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

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.47.0-SNAPSHOT~a40817f409, baseline=1.47.0-SNAPSHOT~9e4966b4a4
    dateFormat X
    axisFormat %s
section baseline
no_agent (386.721 µs) : 366, 407
.   : milestone, 387,
iast (518.372 µs) : 496, 541
.   : milestone, 518,
iast_FULL (734.914 µs) : 713, 757
.   : milestone, 735,
iast_GLOBAL (558.922 µs) : 537, 581
.   : milestone, 559,
iast_HARDCODED_SECRET_DISABLED (516.824 µs) : 495, 539
.   : milestone, 517,
iast_INACTIVE (464.428 µs) : 443, 486
.   : milestone, 464,
iast_TELEMETRY_OFF (500.717 µs) : 479, 523
.   : milestone, 501,
tracing (463.853 µs) : 442, 486
.   : milestone, 464,
section candidate
no_agent (386.802 µs) : 367, 406
.   : milestone, 387,
iast (513.684 µs) : 491, 537
.   : milestone, 514,
iast_FULL (738.247 µs) : 716, 760
.   : milestone, 738,
iast_GLOBAL (570.869 µs) : 548, 593
.   : milestone, 571,
iast_HARDCODED_SECRET_DISABLED (519.615 µs) : 498, 541
.   : milestone, 520,
iast_INACTIVE (462.716 µs) : 442, 484
.   : milestone, 463,
iast_TELEMETRY_OFF (502.153 µs) : 479, 525
.   : milestone, 502,
tracing (463.23 µs) : 442, 485
.   : milestone, 463,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 386.721 µs [366.298 µs, 407.144 µs] -
iast 518.372 µs [495.625 µs, 541.119 µs] 131.651 µs (34.0%)
iast_FULL 734.914 µs [712.934 µs, 756.894 µs] 348.193 µs (90.0%)
iast_GLOBAL 558.922 µs [537.259 µs, 580.585 µs] 172.201 µs (44.5%)
iast_HARDCODED_SECRET_DISABLED 516.824 µs [495.007 µs, 538.641 µs] 130.103 µs (33.6%)
iast_INACTIVE 464.428 µs [443.176 µs, 485.68 µs] 77.707 µs (20.1%)
iast_TELEMETRY_OFF 500.717 µs [478.863 µs, 522.572 µs] 113.997 µs (29.5%)
tracing 463.853 µs [442.048 µs, 485.658 µs] 77.132 µs (19.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 386.802 µs [367.187 µs, 406.417 µs] -
iast 513.684 µs [490.74 µs, 536.628 µs] 126.882 µs (32.8%)
iast_FULL 738.247 µs [716.452 µs, 760.042 µs] 351.445 µs (90.9%)
iast_GLOBAL 570.869 µs [548.39 µs, 593.347 µs] 184.067 µs (47.6%)
iast_HARDCODED_SECRET_DISABLED 519.615 µs [497.766 µs, 541.465 µs] 132.813 µs (34.3%)
iast_INACTIVE 462.716 µs [441.571 µs, 483.862 µs] 75.914 µs (19.6%)
iast_TELEMETRY_OFF 502.153 µs [479.171 µs, 525.136 µs] 115.351 µs (29.8%)
tracing 463.23 µs [441.776 µs, 484.684 µs] 76.428 µs (19.8%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.47.0-SNAPSHOT~a40817f409, baseline=1.47.0-SNAPSHOT~9e4966b4a4
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.366 ms) : 1346, 1386
.   : milestone, 1366,
appsec (1.764 ms) : 1740, 1788
.   : milestone, 1764,
appsec_no_iast (1.77 ms) : 1746, 1794
.   : milestone, 1770,
code_origins (1.688 ms) : 1655, 1721
.   : milestone, 1688,
iast (1.524 ms) : 1499, 1548
.   : milestone, 1524,
profiling (1.542 ms) : 1516, 1567
.   : milestone, 1542,
tracing (1.513 ms) : 1489, 1537
.   : milestone, 1513,
section candidate
no_agent (1.367 ms) : 1347, 1387
.   : milestone, 1367,
appsec (1.768 ms) : 1745, 1792
.   : milestone, 1768,
appsec_no_iast (1.753 ms) : 1730, 1777
.   : milestone, 1753,
code_origins (1.685 ms) : 1651, 1719
.   : milestone, 1685,
iast (1.528 ms) : 1504, 1551
.   : milestone, 1528,
profiling (1.555 ms) : 1531, 1580
.   : milestone, 1555,
tracing (1.513 ms) : 1489, 1537
.   : milestone, 1513,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.366 ms [1.346 ms, 1.386 ms] -
appsec 1.764 ms [1.74 ms, 1.788 ms] 398.371 µs (29.2%)
appsec_no_iast 1.77 ms [1.746 ms, 1.794 ms] 404.11 µs (29.6%)
code_origins 1.688 ms [1.655 ms, 1.721 ms] 321.993 µs (23.6%)
iast 1.524 ms [1.499 ms, 1.548 ms] 157.529 µs (11.5%)
profiling 1.542 ms [1.516 ms, 1.567 ms] 175.896 µs (12.9%)
tracing 1.513 ms [1.489 ms, 1.537 ms] 146.731 µs (10.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.367 ms [1.347 ms, 1.387 ms] -
appsec 1.768 ms [1.745 ms, 1.792 ms] 401.086 µs (29.3%)
appsec_no_iast 1.753 ms [1.73 ms, 1.777 ms] 386.337 µs (28.3%)
code_origins 1.685 ms [1.651 ms, 1.719 ms] 317.896 µs (23.3%)
iast 1.528 ms [1.504 ms, 1.551 ms] 160.418 µs (11.7%)
profiling 1.555 ms [1.531 ms, 1.58 ms] 188.318 µs (13.8%)
tracing 1.513 ms [1.489 ms, 1.537 ms] 145.979 µs (10.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master duncan-harvey/azure-functions-instrumentation
git_commit_date 1740599532 1740599851
git_commit_sha 9e4966b a40817f
release_version 1.47.0-SNAPSHOT~9e4966b4a4 1.47.0-SNAPSHOT~a40817f409
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1740602127 1740602127
ci_job_id 824844122 824844122
ci_pipeline_id 57115569 57115569
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-q8fdmkyr-project-304-concurrent-3-3vxu1ecf 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Linux runner-q8fdmkyr-project-304-concurrent-3-3vxu1ecf 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:50:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
variant appsec appsec

Summary

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

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.47.0-SNAPSHOT~a40817f409, baseline=1.47.0-SNAPSHOT~9e4966b4a4
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.055 s) : 15055000, 15055000
.   : milestone, 15055000,
appsec (15.142 s) : 15142000, 15142000
.   : milestone, 15142000,
iast (19.222 s) : 19222000, 19222000
.   : milestone, 19222000,
iast_GLOBAL (18.054 s) : 18054000, 18054000
.   : milestone, 18054000,
profiling (15.535 s) : 15535000, 15535000
.   : milestone, 15535000,
tracing (15.05 s) : 15050000, 15050000
.   : milestone, 15050000,
section candidate
no_agent (15.408 s) : 15408000, 15408000
.   : milestone, 15408000,
appsec (15.064 s) : 15064000, 15064000
.   : milestone, 15064000,
iast (18.581 s) : 18581000, 18581000
.   : milestone, 18581000,
iast_GLOBAL (18.199 s) : 18199000, 18199000
.   : milestone, 18199000,
profiling (14.901 s) : 14901000, 14901000
.   : milestone, 14901000,
tracing (15.051 s) : 15051000, 15051000
.   : milestone, 15051000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.055 s [15.055 s, 15.055 s] -
appsec 15.142 s [15.142 s, 15.142 s] 87.0 ms (0.6%)
iast 19.222 s [19.222 s, 19.222 s] 4.167 s (27.7%)
iast_GLOBAL 18.054 s [18.054 s, 18.054 s] 2.999 s (19.9%)
profiling 15.535 s [15.535 s, 15.535 s] 480.0 ms (3.2%)
tracing 15.05 s [15.05 s, 15.05 s] -5.0 ms (-0.0%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.408 s [15.408 s, 15.408 s] -
appsec 15.064 s [15.064 s, 15.064 s] -344.0 ms (-2.2%)
iast 18.581 s [18.581 s, 18.581 s] 3.173 s (20.6%)
iast_GLOBAL 18.199 s [18.199 s, 18.199 s] 2.791 s (18.1%)
profiling 14.901 s [14.901 s, 14.901 s] -507.0 ms (-3.3%)
tracing 15.051 s [15.051 s, 15.051 s] -357.0 ms (-2.3%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.47.0-SNAPSHOT~a40817f409, baseline=1.47.0-SNAPSHOT~9e4966b4a4
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.481 ms) : 1469, 1493
.   : milestone, 1481,
appsec (2.377 ms) : 2333, 2421
.   : milestone, 2377,
iast (2.125 ms) : 2070, 2179
.   : milestone, 2125,
iast_GLOBAL (2.172 ms) : 2116, 2228
.   : milestone, 2172,
profiling (2.003 ms) : 1958, 2047
.   : milestone, 2003,
tracing (1.958 ms) : 1915, 2000
.   : milestone, 1958,
section candidate
no_agent (1.478 ms) : 1466, 1489
.   : milestone, 1478,
appsec (2.373 ms) : 2329, 2416
.   : milestone, 2373,
iast (2.125 ms) : 2070, 2180
.   : milestone, 2125,
iast_GLOBAL (2.166 ms) : 2110, 2221
.   : milestone, 2166,
profiling (1.989 ms) : 1945, 2034
.   : milestone, 1989,
tracing (1.954 ms) : 1912, 1997
.   : milestone, 1954,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.481 ms [1.469 ms, 1.493 ms] -
appsec 2.377 ms [2.333 ms, 2.421 ms] 896.07 µs (60.5%)
iast 2.125 ms [2.07 ms, 2.179 ms] 643.537 µs (43.5%)
iast_GLOBAL 2.172 ms [2.116 ms, 2.228 ms] 690.887 µs (46.7%)
profiling 2.003 ms [1.958 ms, 2.047 ms] 521.715 µs (35.2%)
tracing 1.958 ms [1.915 ms, 2.0 ms] 476.548 µs (32.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.478 ms [1.466 ms, 1.489 ms] -
appsec 2.373 ms [2.329 ms, 2.416 ms] 894.996 µs (60.6%)
iast 2.125 ms [2.07 ms, 2.18 ms] 647.154 µs (43.8%)
iast_GLOBAL 2.166 ms [2.11 ms, 2.221 ms] 688.047 µs (46.6%)
profiling 1.989 ms [1.945 ms, 2.034 ms] 511.577 µs (34.6%)
tracing 1.954 ms [1.912 ms, 1.997 ms] 476.693 µs (32.3%)

@smola smola requested review from a team and ygree and removed request for a team and smola February 21, 2025 17:59
pass {
group = 'com.microsoft.azure.functions'
module = 'azure-functions-java-library'
versions = '[1.2.2,)'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you're targeting this one and not earlier versions because it's the oldest one targeting Java 8 ?
A round major version as lower bound is pretty standard, but a specific version like this deserves a comment I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1.2.2 is the earliest stable version I was able to use. Using 1.2.0 results in an error (see below). Prior to 1.2.0 all versions are beta versions. I added a comment to reflect this in code.

The following artifacts could not be resolved: com.microsoft.maven:java-8-parent:pom:8.0.0-SNAPSHOT (absent)

Comment on lines 34 to 36
public String hierarchyMarkerType() {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if the Instrumenter.ForTypeHierarchy is the most relevant here, given that we return null here 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

If we assume that "com.microsoft.azure.functions.annotation.FunctionName" will be visible for any types using that annotation then I would suggest returning "com.microsoft.azure.functions.annotation.FunctionName" here.

You can then change hierarchyMatcher to return

    return declaresMethod(isAnnotatedWith(named(hierarchyMarkerType())));

to avoid duplicating the constant in the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mcculls When I update hierarchyMarkerType to return com.microsoft.azure.functions.annotation.FunctionName the class that should be instrumented appears to be skipped as I'm not seeing any spans created for it.

  @Override
  public String hierarchyMarkerType() {
    return "com.microsoft.azure.functions.annotation.FunctionName";
  }

For context here's an example of the class that should be instrumented. I wonder if it has something to do with how the Azure Function environment is loading classes?
https://github.com/DataDog/dd-trace-java/blob/95d4c18846c516e62cf7807aaa7ec361816c4478/dd-java-agent/instrumentation/azure-functions/src/test/groovy/Function.java

Copy link
Contributor

Choose a reason for hiding this comment

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

it could be, in other words it sounds that we cannot assume that "com.microsoft.azure.functions.annotation.FunctionName" will be visible (as in defined as a resource) for any types using that annotation

If that's the case then it's fine to leave hierarchyMarkerType as null - just add a comment saying this was intentional because of the class-loading in the Azure Function environment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, I added a comment in code for this

Comment on lines +3749 to +3750
if (azureFunctions) {
defaultVersion = "v1";
Copy link
Contributor

Choose a reason for hiding this comment

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

ah ? Why ? Can you add a comment to justify 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.

To be consistent with the instrumentation in other runtimes (node, python) the operation name should be azure.functions.invoke. I added a comment to reflect this in the code.

Copy link
Contributor

@vandonr vandonr left a comment

Choose a reason for hiding this comment

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

I don't see any blocker

@duncanpharvey duncanpharvey merged commit 6055d50 into master Mar 5, 2025
212 of 214 checks passed
@duncanpharvey duncanpharvey deleted the duncan-harvey/azure-functions-instrumentation branch March 5, 2025 13:56
@github-actions github-actions bot added this to the 1.48.0 milestone Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: azure-functions Azure Functions instrumentation type: feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants