Skip to content

Add generic async result type support for OpenTelemetry annotations and its Reactive Streams extension#5737

Merged
PerfectSlayer merged 3 commits into
masterfrom
bbujon/otel-annotations-extensions
Aug 29, 2023
Merged

Add generic async result type support for OpenTelemetry annotations and its Reactive Streams extension#5737
PerfectSlayer merged 3 commits into
masterfrom
bbujon/otel-annotations-extensions

Conversation

@PerfectSlayer

@PerfectSlayer PerfectSlayer commented Aug 18, 2023

Copy link
Copy Markdown
Contributor

What Does This Do

This PR is a follow up of #5593 to provide support for other asynchronous result types (than the ones from JDK8).
This brings the support for Reactive Streams type: Producer.

Motivation

This first type was chosen according the most used libraries.

Additional Notes

@PerfectSlayer PerfectSlayer added type: feature Enhancements and improvements inst: opentelemetry OpenTelemetry instrumentation labels Aug 18, 2023
@PerfectSlayer
PerfectSlayer requested a review from a team as a code owner August 18, 2023 06:59
@PerfectSlayer PerfectSlayer changed the title Add generic async result type support for OpenTelemetry annotations and its Reactive Stream extension Add generic async result type support for OpenTelemetry annotations and its Reactive Streams extension Aug 18, 2023
@pr-commenter

pr-commenter Bot commented Aug 18, 2023

Copy link
Copy Markdown

Benchmarks

Startup

Parameters

Baseline Candidate
commit 1.20.0-SNAPSHOT~1790e33a4d 1.20.0-SNAPSHOT~c2058c2b2e
config baseline candidate
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
module Agent Agent
parent None None
variant appsec appsec

Summary

Found 1 performance improvements and 0 performance regressions! Performance is the same for 61 cases.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:insecure-bank:iast:Remote Config better
[-59.937µs; -18.157µs] or [-10.213%; -3.094%]
547.796µs 586.843µs
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.20.0-SNAPSHOT~c2058c2b2e, baseline=1.20.0-SNAPSHOT~1790e33a4d

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (989.389 ms) : 0, 989389
Total [baseline] (9.258 s) : 0, 9258112
Agent [candidate] (993.55 ms) : 0, 993550
Total [candidate] (9.213 s) : 0, 9212564
section appsec
Agent [baseline] (1.074 s) : 0, 1073702
Total [baseline] (9.288 s) : 0, 9288205
Agent [candidate] (1.079 s) : 0, 1079488
Total [candidate] (9.298 s) : 0, 9297978
section iast
Agent [baseline] (1.094 s) : 0, 1094414
Total [baseline] (9.437 s) : 0, 9437127
Agent [candidate] (1.096 s) : 0, 1095673
Total [candidate] (9.453 s) : 0, 9453286
section profiling
Agent [baseline] (1.178 s) : 0, 1178333
Total [baseline] (9.547 s) : 0, 9547184
Agent [candidate] (1.166 s) : 0, 1166046
Total [candidate] (9.541 s) : 0, 9540804
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 989.389 ms -
Agent appsec 1.074 s 84.313 ms (8.5%)
Agent iast 1.094 s 105.025 ms (10.6%)
Agent profiling 1.178 s 188.944 ms (19.1%)
Total tracing 9.258 s -
Total appsec 9.288 s 30.094 ms (0.3%)
Total iast 9.437 s 179.015 ms (1.9%)
Total profiling 9.547 s 289.072 ms (3.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 993.55 ms -
Agent appsec 1.079 s 85.938 ms (8.6%)
Agent iast 1.096 s 102.123 ms (10.3%)
Agent profiling 1.166 s 172.496 ms (17.4%)
Total tracing 9.213 s -
Total appsec 9.298 s 85.414 ms (0.9%)
Total iast 9.453 s 240.722 ms (2.6%)
Total profiling 9.541 s 328.24 ms (3.6%)
gantt
    title petclinic - break down per module: candidate=1.20.0-SNAPSHOT~c2058c2b2e, baseline=1.20.0-SNAPSHOT~1790e33a4d

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (613.658 ms) : 0, 613658
BytebuddyAgent [candidate] (616.069 ms) : 0, 616069
GlobalTracer [baseline] (284.668 ms) : 0, 284668
GlobalTracer [candidate] (286.874 ms) : 0, 286874
AppSec [baseline] (50.037 ms) : 0, 50037
AppSec [candidate] (49.514 ms) : 0, 49514
Remote Config [baseline] (662.423 µs) : 0, 662
Remote Config [candidate] (657.656 µs) : 0, 658
Telemetry [baseline] (6.029 ms) : 0, 6029
Telemetry [candidate] (5.97 ms) : 0, 5970
section appsec
BytebuddyAgent [baseline] (613.015 ms) : 0, 613015
BytebuddyAgent [candidate] (617.398 ms) : 0, 617398
GlobalTracer [baseline] (284.598 ms) : 0, 284598
GlobalTracer [candidate] (285.996 ms) : 0, 285996
AppSec [baseline] (135.359 ms) : 0, 135359
AppSec [candidate] (135.106 ms) : 0, 135106
Remote Config [baseline] (724.866 µs) : 0, 725
Remote Config [candidate] (727.324 µs) : 0, 727
Telemetry [baseline] (5.733 ms) : 0, 5733
Telemetry [candidate] (5.732 ms) : 0, 5732
section iast
BytebuddyAgent [baseline] (721.027 ms) : 0, 721027
BytebuddyAgent [candidate] (721.808 ms) : 0, 721808
GlobalTracer [baseline] (271.574 ms) : 0, 271574
GlobalTracer [candidate] (271.964 ms) : 0, 271964
AppSec [baseline] (46.995 ms) : 0, 46995
AppSec [candidate] (47.42 ms) : 0, 47420
IAST [baseline] (14.127 ms) : 0, 14127
IAST [candidate] (13.928 ms) : 0, 13928
Remote Config [baseline] (579.157 µs) : 0, 579
Remote Config [candidate] (546.584 µs) : 0, 547
Telemetry [baseline] (5.752 ms) : 0, 5752
Telemetry [candidate] (5.721 ms) : 0, 5721
section profiling
BytebuddyAgent [baseline] (636.855 ms) : 0, 636855
BytebuddyAgent [candidate] (630.506 ms) : 0, 630506
GlobalTracer [baseline] (352.461 ms) : 0, 352461
GlobalTracer [candidate] (348.753 ms) : 0, 348753
AppSec [baseline] (49.966 ms) : 0, 49966
AppSec [candidate] (49.449 ms) : 0, 49449
Remote Config [baseline] (659.556 µs) : 0, 660
Remote Config [candidate] (648.567 µs) : 0, 649
Telemetry [baseline] (6.111 ms) : 0, 6111
Telemetry [candidate] (5.995 ms) : 0, 5995
ProfilingAgent [baseline] (78.453 ms) : 0, 78453
ProfilingAgent [candidate] (77.478 ms) : 0, 77478
Profiling [baseline] (78.478 ms) : 0, 78478
Profiling [candidate] (77.502 ms) : 0, 77502
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.20.0-SNAPSHOT~c2058c2b2e, baseline=1.20.0-SNAPSHOT~1790e33a4d

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (988.9 ms) : 0, 988900
Total [baseline] (8.645 s) : 0, 8645055
Agent [candidate] (988.409 ms) : 0, 988409
Total [candidate] (8.642 s) : 0, 8642448
section appsec
Agent [baseline] (1.082 s) : 0, 1081637
Total [baseline] (8.805 s) : 0, 8804797
Agent [candidate] (1.074 s) : 0, 1073828
Total [candidate] (8.712 s) : 0, 8712065
section iast
Agent [baseline] (1.091 s) : 0, 1091136
Total [baseline] (9.142 s) : 0, 9141601
Agent [candidate] (1.091 s) : 0, 1091177
Total [candidate] (9.159 s) : 0, 9159091
section profiling
Agent [baseline] (1.165 s) : 0, 1164744
Total [baseline] (8.876 s) : 0, 8876205
Agent [candidate] (1.159 s) : 0, 1158920
Total [candidate] (8.868 s) : 0, 8868309
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 988.9 ms -
Agent appsec 1.082 s 92.737 ms (9.4%)
Agent iast 1.091 s 102.236 ms (10.3%)
Agent profiling 1.165 s 175.845 ms (17.8%)
Total tracing 8.645 s -
Total appsec 8.805 s 159.742 ms (1.8%)
Total iast 9.142 s 496.546 ms (5.7%)
Total profiling 8.876 s 231.15 ms (2.7%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 988.409 ms -
Agent appsec 1.074 s 85.419 ms (8.6%)
Agent iast 1.091 s 102.768 ms (10.4%)
Agent profiling 1.159 s 170.511 ms (17.3%)
Total tracing 8.642 s -
Total appsec 8.712 s 69.617 ms (0.8%)
Total iast 9.159 s 516.643 ms (6.0%)
Total profiling 8.868 s 225.861 ms (2.6%)
gantt
    title insecure-bank - break down per module: candidate=1.20.0-SNAPSHOT~c2058c2b2e, baseline=1.20.0-SNAPSHOT~1790e33a4d

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (613.884 ms) : 0, 613884
BytebuddyAgent [candidate] (612.959 ms) : 0, 612959
GlobalTracer [baseline] (283.886 ms) : 0, 283886
GlobalTracer [candidate] (284.163 ms) : 0, 284163
AppSec [baseline] (50.131 ms) : 0, 50131
AppSec [candidate] (50.211 ms) : 0, 50211
Remote Config [baseline] (664.83 µs) : 0, 665
Remote Config [candidate] (667.111 µs) : 0, 667
Telemetry [baseline] (6.027 ms) : 0, 6027
Telemetry [candidate] (5.977 ms) : 0, 5977
section appsec
BytebuddyAgent [baseline] (617.977 ms) : 0, 617977
BytebuddyAgent [candidate] (612.874 ms) : 0, 612874
GlobalTracer [baseline] (286.7 ms) : 0, 286700
GlobalTracer [candidate] (284.806 ms) : 0, 284806
AppSec [baseline] (135.978 ms) : 0, 135978
AppSec [candidate] (135.418 ms) : 0, 135418
Remote Config [baseline] (727.636 µs) : 0, 728
Remote Config [candidate] (723.889 µs) : 0, 724
Telemetry [baseline] (5.794 ms) : 0, 5794
Telemetry [candidate] (5.74 ms) : 0, 5740
section iast
BytebuddyAgent [baseline] (719.127 ms) : 0, 719127
BytebuddyAgent [candidate] (718.434 ms) : 0, 718434
GlobalTracer [baseline] (270.413 ms) : 0, 270413
GlobalTracer [candidate] (270.874 ms) : 0, 270874
AppSec [baseline] (46.822 ms) : 0, 46822
AppSec [candidate] (47.375 ms) : 0, 47375
IAST [baseline] (14.148 ms) : 0, 14148
IAST [candidate] (13.879 ms) : 0, 13879
Remote Config [baseline] (586.843 µs) : 0, 587
Remote Config [candidate] (547.796 µs) : 0, 548
Telemetry [baseline] (5.822 ms) : 0, 5822
Telemetry [candidate] (5.674 ms) : 0, 5674
section profiling
BytebuddyAgent [baseline] (628.81 ms) : 0, 628810
BytebuddyAgent [candidate] (626.081 ms) : 0, 626081
GlobalTracer [baseline] (348.334 ms) : 0, 348334
GlobalTracer [candidate] (346.938 ms) : 0, 346938
AppSec [baseline] (49.067 ms) : 0, 49067
AppSec [candidate] (49.203 ms) : 0, 49203
Remote Config [baseline] (659.296 µs) : 0, 659
Remote Config [candidate] (646.018 µs) : 0, 646
Telemetry [baseline] (5.999 ms) : 0, 5999
Telemetry [candidate] (5.987 ms) : 0, 5987
ProfilingAgent [baseline] (78.802 ms) : 0, 78802
ProfilingAgent [candidate] (77.144 ms) : 0, 77144
Profiling [baseline] (78.826 ms) : 0, 78826
Profiling [candidate] (77.168 ms) : 0, 77168
Loading

Load

Parameters

Baseline Candidate
commit 1.20.0-SNAPSHOT~1790e33a4d 1.20.0-SNAPSHOT~c2058c2b2e
config baseline candidate
end_time 2023-08-29T09:45:36 2023-08-29T10:03:43
start_time 2023-08-29T09:45:18 2023-08-29T10:03:25
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 24 cases.

Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.20.0-SNAPSHOT~c2058c2b2e, baseline=1.20.0-SNAPSHOT~1790e33a4d
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.348 ms) : 1328, 1367
.   : milestone, 1348,
appsec (1.675 ms) : 1650, 1700
.   : milestone, 1675,
iast (1.482 ms) : 1459, 1506
.   : milestone, 1482,
profiling (1.491 ms) : 1465, 1517
.   : milestone, 1491,
tracing (1.472 ms) : 1448, 1496
.   : milestone, 1472,
section candidate
no_agent (1.32 ms) : 1301, 1339
.   : milestone, 1320,
appsec (1.678 ms) : 1654, 1703
.   : milestone, 1678,
iast (1.465 ms) : 1441, 1490
.   : milestone, 1465,
profiling (1.508 ms) : 1483, 1534
.   : milestone, 1508,
tracing (1.452 ms) : 1428, 1477
.   : milestone, 1452,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.348 ms [1.328 ms, 1.367 ms] -
appsec 1.675 ms [1.65 ms, 1.7 ms] 327.623 µs (24.3%)
iast 1.482 ms [1.459 ms, 1.506 ms] 134.78 µs (10.0%)
profiling 1.491 ms [1.465 ms, 1.517 ms] 143.492 µs (10.6%)
tracing 1.472 ms [1.448 ms, 1.496 ms] 124.091 µs (9.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.32 ms [1.301 ms, 1.339 ms] -
appsec 1.678 ms [1.654 ms, 1.703 ms] 358.379 µs (27.2%)
iast 1.465 ms [1.441 ms, 1.49 ms] 145.602 µs (11.0%)
profiling 1.508 ms [1.483 ms, 1.534 ms] 188.676 µs (14.3%)
tracing 1.452 ms [1.428 ms, 1.477 ms] 132.656 µs (10.1%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.20.0-SNAPSHOT~c2058c2b2e, baseline=1.20.0-SNAPSHOT~1790e33a4d
    dateFormat X
    axisFormat %s
section baseline
no_agent (361.819 µs) : 342, 382
.   : milestone, 362,
appsec (668.103 µs) : 648, 689
.   : milestone, 668,
iast (457.724 µs) : 437, 479
.   : milestone, 458,
iast_FULL (523.515 µs) : 503, 544
.   : milestone, 524,
iast_INACTIVE (436.679 µs) : 416, 458
.   : milestone, 437,
profiling (439.955 µs) : 419, 461
.   : milestone, 440,
tracing (436.765 µs) : 415, 458
.   : milestone, 437,
section candidate
no_agent (364.305 µs) : 344, 385
.   : milestone, 364,
appsec (668.603 µs) : 647, 690
.   : milestone, 669,
iast (463.379 µs) : 443, 484
.   : milestone, 463,
iast_FULL (535.458 µs) : 515, 556
.   : milestone, 535,
iast_INACTIVE (443.505 µs) : 423, 464
.   : milestone, 444,
profiling (435.25 µs) : 415, 456
.   : milestone, 435,
tracing (438.66 µs) : 418, 459
.   : milestone, 439,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 361.819 µs [341.902 µs, 381.736 µs] -
appsec 668.103 µs [647.669 µs, 688.538 µs] 306.284 µs (84.7%)
iast 457.724 µs [436.875 µs, 478.573 µs] 95.905 µs (26.5%)
iast_FULL 523.515 µs [502.678 µs, 544.351 µs] 161.695 µs (44.7%)
iast_INACTIVE 436.679 µs [415.689 µs, 457.669 µs] 74.859 µs (20.7%)
profiling 439.955 µs [418.552 µs, 461.358 µs] 78.136 µs (21.6%)
tracing 436.765 µs [415.48 µs, 458.049 µs] 74.945 µs (20.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 364.305 µs [343.641 µs, 384.969 µs] -
appsec 668.603 µs [646.915 µs, 690.29 µs] 304.298 µs (83.5%)
iast 463.379 µs [442.605 µs, 484.153 µs] 99.074 µs (27.2%)
iast_FULL 535.458 µs [514.629 µs, 556.287 µs] 171.153 µs (47.0%)
iast_INACTIVE 443.505 µs [422.872 µs, 464.138 µs] 79.2 µs (21.7%)
profiling 435.25 µs [414.884 µs, 455.616 µs] 70.945 µs (19.5%)
tracing 438.66 µs [418.092 µs, 459.227 µs] 74.355 µs (20.4%)

@PerfectSlayer
PerfectSlayer changed the base branch from bbujon/otel-annotations to master August 18, 2023 09:15
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/otel-annotations-extensions branch 2 times, most recently from 09e3260 to 9c58178 Compare August 21, 2023 10:55
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/otel-annotations-extensions branch 2 times, most recently from 55e1e6b to 30688d0 Compare August 23, 2023 07:51
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/otel-annotations-extensions branch from 30688d0 to e39da88 Compare August 23, 2023 08:09
@PerfectSlayer
PerfectSlayer force-pushed the bbujon/otel-annotations-extensions branch from fa95514 to 55b7553 Compare August 25, 2023 11:21

@bantonsson bantonsson left a comment

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.

Nice separation

@bantonsson

Copy link
Copy Markdown
Contributor

GitHub apparently has the hiccups. Commenting once is enough.

@PerfectSlayer
PerfectSlayer force-pushed the bbujon/otel-annotations-extensions branch from 55b7553 to 5b402fd Compare August 28, 2023 16:07
@PerfectSlayer

Copy link
Copy Markdown
Contributor Author

Uz4vgXr - Imgur

@PerfectSlayer
PerfectSlayer force-pushed the bbujon/otel-annotations-extensions branch from 5b402fd to c2058c2 Compare August 29, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inst: opentelemetry OpenTelemetry instrumentation type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants