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 ServiceTalk async context propagation instrumentation #7241

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

ygree
Copy link
Contributor

@ygree ygree commented Jun 26, 2024

What Does This Do

This is an instrumentation of the ServiceTalk framework, specifically targeting the concurrent module to enable asynchronous propagation of the Datadog tracing context.

It takes the existing parts of the ServiceTalk framework that aim to capture, preserve, and propagate context across asynchronous boundaries, and instruments them specifically for in-process asynchronous propagation of the Datadog context.

Motivation

A customer request to fix ServiceTalk in-process async context propagation.

Additional Notes

Jira ticket: AIDM-122

Supersedes #7188

@ygree ygree self-assigned this Jun 26, 2024
@pr-commenter
Copy link

pr-commenter bot commented Jun 26, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/servicetalk-concurrent-instrumentation
git_commit_date 1719496894 1719511699
git_commit_sha 8daf509 b30519d
release_version 1.37.0-SNAPSHOT~8daf50933c 1.37.0-SNAPSHOT~b30519ddea
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1719514848 1719514848
ci_job_id 555485707 555485707
ci_pipeline_id 37767716 37767716
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.062 s) : 0, 1061895
Total [baseline] (8.554 s) : 0, 8553735
Agent [candidate] (1.062 s) : 0, 1061906
Total [candidate] (8.591 s) : 0, 8590870
section iast
Agent [baseline] (1.173 s) : 0, 1173448
Total [baseline] (9.027 s) : 0, 9027071
Agent [candidate] (1.179 s) : 0, 1178582
Total [candidate] (9.016 s) : 0, 9016290
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.169 s) : 0, 1168586
Total [baseline] (9.013 s) : 0, 9013041
Agent [candidate] (1.171 s) : 0, 1171403
Total [candidate] (8.982 s) : 0, 8981808
section iast_TELEMETRY_OFF
Agent [baseline] (1.166 s) : 0, 1165790
Total [baseline] (9.032 s) : 0, 9031684
Agent [candidate] (1.174 s) : 0, 1174355
Total [candidate] (9.018 s) : 0, 9018013
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.062 s -
Agent iast 1.173 s 111.553 ms (10.5%)
Agent iast_HARDCODED_SECRET_DISABLED 1.169 s 106.69 ms (10.0%)
Agent iast_TELEMETRY_OFF 1.166 s 103.895 ms (9.8%)
Total tracing 8.554 s -
Total iast 9.027 s 473.336 ms (5.5%)
Total iast_HARDCODED_SECRET_DISABLED 9.013 s 459.306 ms (5.4%)
Total iast_TELEMETRY_OFF 9.032 s 477.949 ms (5.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.062 s -
Agent iast 1.179 s 116.676 ms (11.0%)
Agent iast_HARDCODED_SECRET_DISABLED 1.171 s 109.497 ms (10.3%)
Agent iast_TELEMETRY_OFF 1.174 s 112.449 ms (10.6%)
Total tracing 8.591 s -
Total iast 9.016 s 425.42 ms (5.0%)
Total iast_HARDCODED_SECRET_DISABLED 8.982 s 390.938 ms (4.6%)
Total iast_TELEMETRY_OFF 9.018 s 427.144 ms (5.0%)
gantt
    title insecure-bank - break down per module: candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (664.832 ms) : 0, 664832
BytebuddyAgent [candidate] (664.898 ms) : 0, 664898
GlobalTracer [baseline] (304.345 ms) : 0, 304345
GlobalTracer [candidate] (304.455 ms) : 0, 304455
AppSec [baseline] (49.992 ms) : 0, 49992
AppSec [candidate] (49.873 ms) : 0, 49873
Remote Config [baseline] (716.295 µs) : 0, 716
Remote Config [candidate] (762.082 µs) : 0, 762
Telemetry [baseline] (7.616 ms) : 0, 7616
Telemetry [candidate] (7.63 ms) : 0, 7630
section iast
BytebuddyAgent [baseline] (781.557 ms) : 0, 781557
BytebuddyAgent [candidate] (786.472 ms) : 0, 786472
GlobalTracer [baseline] (294.925 ms) : 0, 294925
GlobalTracer [candidate] (295.536 ms) : 0, 295536
AppSec [baseline] (47.198 ms) : 0, 47198
AppSec [candidate] (47.318 ms) : 0, 47318
IAST [baseline] (28.189 ms) : 0, 28189
IAST [candidate] (26.589 ms) : 0, 26589
Remote Config [baseline] (579.375 µs) : 0, 579
Remote Config [candidate] (615.347 µs) : 0, 615
Telemetry [baseline] (7.737 ms) : 0, 7737
Telemetry [candidate] (8.7 ms) : 0, 8700
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (778.517 ms) : 0, 778517
BytebuddyAgent [candidate] (779.949 ms) : 0, 779949
GlobalTracer [baseline] (294.604 ms) : 0, 294604
GlobalTracer [candidate] (294.75 ms) : 0, 294750
AppSec [baseline] (47.173 ms) : 0, 47173
AppSec [candidate] (47.134 ms) : 0, 47134
IAST [baseline] (27.392 ms) : 0, 27392
IAST [candidate] (28.659 ms) : 0, 28659
Remote Config [baseline] (629.042 µs) : 0, 629
Remote Config [candidate] (623.999 µs) : 0, 624
Telemetry [baseline] (6.969 ms) : 0, 6969
Telemetry [candidate] (6.991 ms) : 0, 6991
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (777.915 ms) : 0, 777915
BytebuddyAgent [candidate] (783.597 ms) : 0, 783597
GlobalTracer [baseline] (294.566 ms) : 0, 294566
GlobalTracer [candidate] (295.335 ms) : 0, 295335
AppSec [baseline] (46.963 ms) : 0, 46963
AppSec [candidate] (46.884 ms) : 0, 46884
IAST [baseline] (24.776 ms) : 0, 24776
IAST [candidate] (26.11 ms) : 0, 26110
Remote Config [baseline] (601.723 µs) : 0, 602
Remote Config [candidate] (591.85 µs) : 0, 592
Telemetry [baseline] (7.649 ms) : 0, 7649
Telemetry [candidate] (8.463 ms) : 0, 8463
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066203
Total [baseline] (10.388 s) : 0, 10387610
Agent [candidate] (1.074 s) : 0, 1074049
Total [candidate] (10.381 s) : 0, 10381426
section appsec
Agent [baseline] (1.189 s) : 0, 1188518
Total [baseline] (10.499 s) : 0, 10499497
Agent [candidate] (1.191 s) : 0, 1191306
Total [candidate] (10.519 s) : 0, 10518747
section iast
Agent [baseline] (1.172 s) : 0, 1172262
Total [baseline] (10.784 s) : 0, 10783689
Agent [candidate] (1.169 s) : 0, 1169500
Total [candidate] (10.723 s) : 0, 10722994
section profiling
Agent [baseline] (1.273 s) : 0, 1273062
Total [baseline] (10.68 s) : 0, 10679755
Agent [candidate] (1.266 s) : 0, 1265558
Total [candidate] (10.658 s) : 0, 10658028
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.066 s -
Agent appsec 1.189 s 122.315 ms (11.5%)
Agent iast 1.172 s 106.059 ms (9.9%)
Agent profiling 1.273 s 206.858 ms (19.4%)
Total tracing 10.388 s -
Total appsec 10.499 s 111.888 ms (1.1%)
Total iast 10.784 s 396.08 ms (3.8%)
Total profiling 10.68 s 292.146 ms (2.8%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.074 s -
Agent appsec 1.191 s 117.257 ms (10.9%)
Agent iast 1.169 s 95.451 ms (8.9%)
Agent profiling 1.266 s 191.509 ms (17.8%)
Total tracing 10.381 s -
Total appsec 10.519 s 137.321 ms (1.3%)
Total iast 10.723 s 341.567 ms (3.3%)
Total profiling 10.658 s 276.602 ms (2.7%)
gantt
    title petclinic - break down per module: candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (667.813 ms) : 0, 667813
BytebuddyAgent [candidate] (672.534 ms) : 0, 672534
GlobalTracer [baseline] (305.421 ms) : 0, 305421
GlobalTracer [candidate] (308.023 ms) : 0, 308023
AppSec [baseline] (50.23 ms) : 0, 50230
AppSec [candidate] (50.341 ms) : 0, 50341
Remote Config [baseline] (857.798 µs) : 0, 858
Remote Config [candidate] (745.174 µs) : 0, 745
Telemetry [baseline] (7.468 ms) : 0, 7468
Telemetry [candidate] (7.677 ms) : 0, 7677
section appsec
BytebuddyAgent [baseline] (678.993 ms) : 0, 678993
BytebuddyAgent [candidate] (680.966 ms) : 0, 680966
GlobalTracer [baseline] (299.697 ms) : 0, 299697
GlobalTracer [candidate] (300.706 ms) : 0, 300706
AppSec [baseline] (154.105 ms) : 0, 154105
AppSec [candidate] (154.785 ms) : 0, 154785
Remote Config [baseline] (650.25 µs) : 0, 650
Remote Config [candidate] (654.87 µs) : 0, 655
Telemetry [baseline] (8.744 ms) : 0, 8744
Telemetry [candidate] (9.608 ms) : 0, 9608
IAST [baseline] (23.671 ms) : 0, 23671
IAST [candidate] (19.96 ms) : 0, 19960
section iast
BytebuddyAgent [baseline] (780.807 ms) : 0, 780807
BytebuddyAgent [candidate] (779.131 ms) : 0, 779131
GlobalTracer [baseline] (295.151 ms) : 0, 295151
GlobalTracer [candidate] (295.191 ms) : 0, 295191
AppSec [baseline] (46.968 ms) : 0, 46968
AppSec [candidate] (47.102 ms) : 0, 47102
Remote Config [baseline] (640.373 µs) : 0, 640
Remote Config [candidate] (612.035 µs) : 0, 612
Telemetry [baseline] (6.92 ms) : 0, 6920
Telemetry [candidate] (7.01 ms) : 0, 7010
IAST [baseline] (28.487 ms) : 0, 28487
IAST [candidate] (27.177 ms) : 0, 27177
section profiling
ProfilingAgent [baseline] (96.461 ms) : 0, 96461
ProfilingAgent [candidate] (96.77 ms) : 0, 96770
BytebuddyAgent [baseline] (668.404 ms) : 0, 668404
BytebuddyAgent [candidate] (663.296 ms) : 0, 663296
GlobalTracer [baseline] (391.011 ms) : 0, 391011
GlobalTracer [candidate] (388.61 ms) : 0, 388610
AppSec [baseline] (51.603 ms) : 0, 51603
AppSec [candidate] (51.827 ms) : 0, 51827
Remote Config [baseline] (665.085 µs) : 0, 665
Remote Config [candidate] (674.041 µs) : 0, 674
Telemetry [baseline] (7.462 ms) : 0, 7462
Telemetry [candidate] (7.401 ms) : 0, 7401
Profiling [baseline] (96.485 ms) : 0, 96485
Profiling [candidate] (96.795 ms) : 0, 96795
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-06-27T18:33:26 2024-06-27T18:40:16
git_branch master ygree/servicetalk-concurrent-instrumentation
git_commit_date 1719496894 1719511699
git_commit_sha 8daf509 b30519d
release_version 1.37.0-SNAPSHOT~8daf50933c 1.37.0-SNAPSHOT~b30519ddea
start_time 2024-06-27T18:33:12 2024-06-27T18:40:02
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1719513962 1719513962
ci_job_id 555485708 555485708
ci_pipeline_id 37767716 37767716
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

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

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.338 ms) : 1319, 1357
.   : milestone, 1338,
appsec (1.72 ms) : 1695, 1745
.   : milestone, 1720,
appsec_no_iast (1.731 ms) : 1707, 1756
.   : milestone, 1731,
iast (1.466 ms) : 1444, 1488
.   : milestone, 1466,
profiling (1.508 ms) : 1484, 1532
.   : milestone, 1508,
tracing (1.464 ms) : 1439, 1489
.   : milestone, 1464,
section candidate
no_agent (1.355 ms) : 1335, 1375
.   : milestone, 1355,
appsec (1.737 ms) : 1714, 1761
.   : milestone, 1737,
appsec_no_iast (1.716 ms) : 1690, 1742
.   : milestone, 1716,
iast (1.494 ms) : 1471, 1517
.   : milestone, 1494,
profiling (1.524 ms) : 1498, 1549
.   : milestone, 1524,
tracing (1.469 ms) : 1446, 1493
.   : milestone, 1469,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.338 ms [1.319 ms, 1.357 ms] -
appsec 1.72 ms [1.695 ms, 1.745 ms] 382.244 µs (28.6%)
appsec_no_iast 1.731 ms [1.707 ms, 1.756 ms] 393.161 µs (29.4%)
iast 1.466 ms [1.444 ms, 1.488 ms] 128.219 µs (9.6%)
profiling 1.508 ms [1.484 ms, 1.532 ms] 169.852 µs (12.7%)
tracing 1.464 ms [1.439 ms, 1.489 ms] 125.784 µs (9.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.355 ms [1.335 ms, 1.375 ms] -
appsec 1.737 ms [1.714 ms, 1.761 ms] 382.255 µs (28.2%)
appsec_no_iast 1.716 ms [1.69 ms, 1.742 ms] 360.827 µs (26.6%)
iast 1.494 ms [1.471 ms, 1.517 ms] 138.986 µs (10.3%)
profiling 1.524 ms [1.498 ms, 1.549 ms] 168.599 µs (12.4%)
tracing 1.469 ms [1.446 ms, 1.493 ms] 114.385 µs (8.4%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
    dateFormat X
    axisFormat %s
section baseline
no_agent (366.822 µs) : 347, 386
.   : milestone, 367,
iast (481.869 µs) : 461, 503
.   : milestone, 482,
iast_FULL (554.572 µs) : 533, 576
.   : milestone, 555,
iast_GLOBAL (509.538 µs) : 488, 531
.   : milestone, 510,
iast_HARDCODED_SECRET_DISABLED (480.509 µs) : 460, 501
.   : milestone, 481,
iast_INACTIVE (455.34 µs) : 434, 476
.   : milestone, 455,
iast_TELEMETRY_OFF (473.173 µs) : 452, 495
.   : milestone, 473,
tracing (447.03 µs) : 426, 468
.   : milestone, 447,
section candidate
no_agent (370.191 µs) : 350, 390
.   : milestone, 370,
iast (482.162 µs) : 461, 503
.   : milestone, 482,
iast_FULL (552.638 µs) : 531, 574
.   : milestone, 553,
iast_GLOBAL (508.967 µs) : 487, 531
.   : milestone, 509,
iast_HARDCODED_SECRET_DISABLED (490.144 µs) : 469, 511
.   : milestone, 490,
iast_INACTIVE (460.297 µs) : 439, 482
.   : milestone, 460,
iast_TELEMETRY_OFF (478.102 µs) : 457, 500
.   : milestone, 478,
tracing (454.047 µs) : 434, 474
.   : milestone, 454,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 366.822 µs [347.351 µs, 386.292 µs] -
iast 481.869 µs [460.924 µs, 502.814 µs] 115.047 µs (31.4%)
iast_FULL 554.572 µs [533.395 µs, 575.748 µs] 187.75 µs (51.2%)
iast_GLOBAL 509.538 µs [487.649 µs, 531.426 µs] 142.716 µs (38.9%)
iast_HARDCODED_SECRET_DISABLED 480.509 µs [459.581 µs, 501.437 µs] 113.688 µs (31.0%)
iast_INACTIVE 455.34 µs [434.33 µs, 476.351 µs] 88.519 µs (24.1%)
iast_TELEMETRY_OFF 473.173 µs [451.555 µs, 494.792 µs] 106.352 µs (29.0%)
tracing 447.03 µs [425.634 µs, 468.426 µs] 80.208 µs (21.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 370.191 µs [350.102 µs, 390.281 µs] -
iast 482.162 µs [460.916 µs, 503.408 µs] 111.971 µs (30.2%)
iast_FULL 552.638 µs [531.363 µs, 573.913 µs] 182.447 µs (49.3%)
iast_GLOBAL 508.967 µs [487.076 µs, 530.858 µs] 138.776 µs (37.5%)
iast_HARDCODED_SECRET_DISABLED 490.144 µs [468.828 µs, 511.459 µs] 119.952 µs (32.4%)
iast_INACTIVE 460.297 µs [438.697 µs, 481.897 µs] 90.106 µs (24.3%)
iast_TELEMETRY_OFF 478.102 µs [456.659 µs, 499.546 µs] 107.911 µs (29.2%)
tracing 454.047 µs [433.626 µs, 474.468 µs] 83.856 µs (22.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/servicetalk-concurrent-instrumentation
git_commit_date 1719496894 1719511699
git_commit_sha 8daf509 b30519d
release_version 1.37.0-SNAPSHOT~8daf50933c 1.37.0-SNAPSHOT~b30519ddea
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1719514484 1719514484
ci_job_id 555485709 555485709
ci_pipeline_id 37767716 37767716
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
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.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.551 s) : 15551000, 15551000
.   : milestone, 15551000,
appsec (15.302 s) : 15302000, 15302000
.   : milestone, 15302000,
iast (19.127 s) : 19127000, 19127000
.   : milestone, 19127000,
iast_GLOBAL (17.97 s) : 17970000, 17970000
.   : milestone, 17970000,
profiling (15.887 s) : 15887000, 15887000
.   : milestone, 15887000,
tracing (15.01 s) : 15010000, 15010000
.   : milestone, 15010000,
section candidate
no_agent (14.98 s) : 14980000, 14980000
.   : milestone, 14980000,
appsec (14.984 s) : 14984000, 14984000
.   : milestone, 14984000,
iast (18.719 s) : 18719000, 18719000
.   : milestone, 18719000,
iast_GLOBAL (17.871 s) : 17871000, 17871000
.   : milestone, 17871000,
profiling (15.309 s) : 15309000, 15309000
.   : milestone, 15309000,
tracing (15.102 s) : 15102000, 15102000
.   : milestone, 15102000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.551 s [15.551 s, 15.551 s] -
appsec 15.302 s [15.302 s, 15.302 s] -249.0 ms (-1.6%)
iast 19.127 s [19.127 s, 19.127 s] 3.576 s (23.0%)
iast_GLOBAL 17.97 s [17.97 s, 17.97 s] 2.419 s (15.6%)
profiling 15.887 s [15.887 s, 15.887 s] 336.0 ms (2.2%)
tracing 15.01 s [15.01 s, 15.01 s] -541.0 ms (-3.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.98 s [14.98 s, 14.98 s] -
appsec 14.984 s [14.984 s, 14.984 s] 4.0 ms (0.0%)
iast 18.719 s [18.719 s, 18.719 s] 3.739 s (25.0%)
iast_GLOBAL 17.871 s [17.871 s, 17.871 s] 2.891 s (19.3%)
profiling 15.309 s [15.309 s, 15.309 s] 329.0 ms (2.2%)
tracing 15.102 s [15.102 s, 15.102 s] 122.0 ms (0.8%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.37.0-SNAPSHOT~b30519ddea, baseline=1.37.0-SNAPSHOT~8daf50933c
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.464 ms) : 1453, 1476
.   : milestone, 1464,
appsec (2.229 ms) : 2195, 2263
.   : milestone, 2229,
iast (1.992 ms) : 1950, 2034
.   : milestone, 1992,
iast_GLOBAL (2.027 ms) : 1985, 2068
.   : milestone, 2027,
profiling (1.873 ms) : 1839, 1908
.   : milestone, 1873,
tracing (1.842 ms) : 1810, 1874
.   : milestone, 1842,
section candidate
no_agent (1.467 ms) : 1456, 1479
.   : milestone, 1467,
appsec (2.247 ms) : 2210, 2283
.   : milestone, 2247,
iast (1.996 ms) : 1953, 2039
.   : milestone, 1996,
iast_GLOBAL (2.037 ms) : 1993, 2080
.   : milestone, 2037,
profiling (1.878 ms) : 1842, 1914
.   : milestone, 1878,
tracing (1.857 ms) : 1823, 1891
.   : milestone, 1857,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.464 ms [1.453 ms, 1.476 ms] -
appsec 2.229 ms [2.195 ms, 2.263 ms] 764.483 µs (52.2%)
iast 1.992 ms [1.95 ms, 2.034 ms] 527.172 µs (36.0%)
iast_GLOBAL 2.027 ms [1.985 ms, 2.068 ms] 562.136 µs (38.4%)
profiling 1.873 ms [1.839 ms, 1.908 ms] 408.963 µs (27.9%)
tracing 1.842 ms [1.81 ms, 1.874 ms] 377.399 µs (25.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.467 ms [1.456 ms, 1.479 ms] -
appsec 2.247 ms [2.21 ms, 2.283 ms] 779.442 µs (53.1%)
iast 1.996 ms [1.953 ms, 2.039 ms] 528.923 µs (36.1%)
iast_GLOBAL 2.037 ms [1.993 ms, 2.08 ms] 569.585 µs (38.8%)
profiling 1.878 ms [1.842 ms, 1.914 ms] 411.068 µs (28.0%)
tracing 1.857 ms [1.823 ms, 1.891 ms] 389.692 µs (26.6%)

@ygree ygree force-pushed the ygree/servicetalk-concurrent-instrumentation branch 2 times, most recently from 028cdf2 to 90f8975 Compare June 26, 2024 19:49
@ygree ygree force-pushed the ygree/servicetalk-concurrent-instrumentation branch 2 times, most recently from fb8a65f to d891109 Compare June 26, 2024 22:52
@ygree ygree marked this pull request as ready for review June 27, 2024 03:46
@ygree ygree requested review from a team as code owners June 27, 2024 03:46
@PerfectSlayer PerfectSlayer added the inst: others All other instrumentations label Jun 27, 2024

testImplementation group: 'io.servicetalk', name: 'servicetalk-concurrent-api', version: '0.42.0'
testImplementation group: 'io.servicetalk', name: 'servicetalk-context-api', version: '0.42.0'
}
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to add a latestDepTest section to detect future incompatible versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

private static final class Construct {
@Advice.OnMethodEnter(suppress = Throwable.class)
public static boolean enter(@Advice.Origin Class<?> clazz) {
int level = CallDepthThreadLocalMap.incrementCallDepth(clazz);
Copy link
Collaborator

Choose a reason for hiding this comment

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

here the threadlocal is incremented but if the constructor throws there is no reset being done hence this advice will not work anymore for next calls. I do not think is possible to add onThrowable = Throwable.class to a constructor exit advice so perhaps we need another solution

Copy link
Contributor

Choose a reason for hiding this comment

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

Is the goal here to just associate the active span with the ContextMap at the time it was created?

Looking at the code history CopyOnWriteContextMap has always been a final class with a couple of constructors - you could decide to just instrument the constructor which takes an existing ContextMap as that's the one the default constructor delegates to. There would be no nested calls there because you're only instrumenting the specific CopyOnWriteContextMap type, so you could drop the entry advice and simplify the exit advice to always record the active span.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@PerfectSlayer PerfectSlayer changed the title ServiceTalk async context propagation instrumentation Add ServiceTalk async context propagation instrumentation Jun 27, 2024
@ygree ygree force-pushed the ygree/servicetalk-concurrent-instrumentation branch from d891109 to 983e34d Compare June 27, 2024 17:53
@ygree ygree force-pushed the ygree/servicetalk-concurrent-instrumentation branch from 983e34d to b30519d Compare June 27, 2024 18:08
@ygree ygree enabled auto-merge (squash) June 27, 2024 18:31
@ygree ygree merged commit 833a988 into master Jul 1, 2024
82 checks passed
@ygree ygree deleted the ygree/servicetalk-concurrent-instrumentation branch July 1, 2024 06:44
@PerfectSlayer PerfectSlayer added this to the 1.37.0 milestone Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: others All other instrumentations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants