-
Notifications
You must be signed in to change notification settings - Fork 303
Migrating all HttpServer Instrumentations to Extract full Context #8820
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
base: master
Are you sure you want to change the base?
Conversation
resolve merge conflicts
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 12 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~4e94f29e7f, baseline=1.50.0-SNAPSHOT~9eafda94cf
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.019 s) : 0, 1019155
Total [baseline] (10.529 s) : 0, 10529310
Agent [candidate] (1.027 s) : 0, 1027326
Total [candidate] (10.563 s) : 0, 10562720
section appsec
Agent [baseline] (1.169 s) : 0, 1168889
Total [baseline] (10.702 s) : 0, 10701845
Agent [candidate] (1.162 s) : 0, 1162378
Total [candidate] (10.702 s) : 0, 10701825
section iast
Agent [baseline] (1.152 s) : 0, 1151612
Total [baseline] (10.95 s) : 0, 10950066
Agent [candidate] (1.149 s) : 0, 1149495
Total [candidate] (10.863 s) : 0, 10862536
section profiling
Agent [baseline] (1.281 s) : 0, 1280984
Total [baseline] (10.815 s) : 0, 10814726
Agent [candidate] (1.275 s) : 0, 1275116
Total [candidate] (10.756 s) : 0, 10756476
gantt
title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~4e94f29e7f, baseline=1.50.0-SNAPSHOT~9eafda94cf
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (682.102 ms) : 0, 682102
BytebuddyAgent [candidate] (687.186 ms) : 0, 687186
GlobalTracer [baseline] (240.342 ms) : 0, 240342
GlobalTracer [candidate] (241.954 ms) : 0, 241954
AppSec [baseline] (54.347 ms) : 0, 54347
AppSec [candidate] (54.816 ms) : 0, 54816
Debugger [baseline] (9.812 ms) : 0, 9812
Debugger [candidate] (10.572 ms) : 0, 10572
Remote Config [baseline] (688.7 µs) : 0, 689
Remote Config [candidate] (701.001 µs) : 0, 701
Telemetry [baseline] (8.294 ms) : 0, 8294
Telemetry [candidate] (8.456 ms) : 0, 8456
section appsec
BytebuddyAgent [baseline] (705.716 ms) : 0, 705716
BytebuddyAgent [candidate] (700.409 ms) : 0, 700409
GlobalTracer [baseline] (238.181 ms) : 0, 238181
GlobalTracer [candidate] (237.57 ms) : 0, 237570
AppSec [baseline] (176.319 ms) : 0, 176319
AppSec [candidate] (175.756 ms) : 0, 175756
Debugger [baseline] (5.964 ms) : 0, 5964
Debugger [candidate] (5.943 ms) : 0, 5943
Remote Config [baseline] (630.169 µs) : 0, 630
Remote Config [candidate] (631.852 µs) : 0, 632
Telemetry [baseline] (7.423 ms) : 0, 7423
Telemetry [candidate] (7.742 ms) : 0, 7742
IAST [baseline] (21.845 ms) : 0, 21845
IAST [candidate] (21.7 ms) : 0, 21700
section iast
BytebuddyAgent [baseline] (803.669 ms) : 0, 803669
BytebuddyAgent [candidate] (801.994 ms) : 0, 801994
GlobalTracer [baseline] (231.676 ms) : 0, 231676
GlobalTracer [candidate] (230.689 ms) : 0, 230689
AppSec [baseline] (49.288 ms) : 0, 49288
AppSec [candidate] (50.413 ms) : 0, 50413
Debugger [baseline] (5.853 ms) : 0, 5853
Debugger [candidate] (5.985 ms) : 0, 5985
Remote Config [baseline] (576.447 µs) : 0, 576
Remote Config [candidate] (588.059 µs) : 0, 588
Telemetry [baseline] (7.863 ms) : 0, 7863
Telemetry [candidate] (7.966 ms) : 0, 7966
IAST [baseline] (29.171 ms) : 0, 29171
IAST [candidate] (27.535 ms) : 0, 27535
section profiling
BytebuddyAgent [baseline] (673.979 ms) : 0, 673979
BytebuddyAgent [candidate] (670.948 ms) : 0, 670948
GlobalTracer [baseline] (375.484 ms) : 0, 375484
GlobalTracer [candidate] (373.721 ms) : 0, 373721
AppSec [baseline] (62.318 ms) : 0, 62318
AppSec [candidate] (61.826 ms) : 0, 61826
Debugger [baseline] (6.227 ms) : 0, 6227
Debugger [candidate] (6.306 ms) : 0, 6306
Remote Config [baseline] (655.991 µs) : 0, 656
Remote Config [candidate] (663.025 µs) : 0, 663
Telemetry [baseline] (8.187 ms) : 0, 8187
Telemetry [candidate] (8.165 ms) : 0, 8165
ProfilingAgent [baseline] (103.009 ms) : 0, 103009
ProfilingAgent [candidate] (102.751 ms) : 0, 102751
Profiling [baseline] (103.032 ms) : 0, 103032
Profiling [candidate] (102.774 ms) : 0, 102774
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~4e94f29e7f, baseline=1.50.0-SNAPSHOT~9eafda94cf
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.027 s) : 0, 1026825
Total [baseline] (8.708 s) : 0, 8707585
Agent [candidate] (1.021 s) : 0, 1020875
Total [candidate] (8.646 s) : 0, 8646094
section iast
Agent [baseline] (1.149 s) : 0, 1149348
Total [baseline] (9.227 s) : 0, 9227246
Agent [candidate] (1.155 s) : 0, 1154665
Total [candidate] (9.224 s) : 0, 9223600
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.148 s) : 0, 1147511
Total [baseline] (9.202 s) : 0, 9201831
Agent [candidate] (1.154 s) : 0, 1154327
Total [candidate] (9.219 s) : 0, 9219171
section iast_TELEMETRY_OFF
Agent [baseline] (1.145 s) : 0, 1144921
Total [baseline] (9.211 s) : 0, 9211225
Agent [candidate] (1.143 s) : 0, 1143439
Total [candidate] (9.214 s) : 0, 9213561
gantt
title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~4e94f29e7f, baseline=1.50.0-SNAPSHOT~9eafda94cf
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (688.519 ms) : 0, 688519
BytebuddyAgent [candidate] (682.686 ms) : 0, 682686
GlobalTracer [baseline] (241.128 ms) : 0, 241128
GlobalTracer [candidate] (240.331 ms) : 0, 240331
AppSec [baseline] (54.891 ms) : 0, 54891
AppSec [candidate] (54.446 ms) : 0, 54446
Debugger [baseline] (6.241 ms) : 0, 6241
Debugger [candidate] (6.913 ms) : 0, 6913
Remote Config [baseline] (727.482 µs) : 0, 727
Remote Config [candidate] (706.424 µs) : 0, 706
Telemetry [baseline] (11.597 ms) : 0, 11597
Telemetry [candidate] (12.248 ms) : 0, 12248
section iast
BytebuddyAgent [baseline] (802.17 ms) : 0, 802170
BytebuddyAgent [candidate] (805.846 ms) : 0, 805846
GlobalTracer [baseline] (230.622 ms) : 0, 230622
GlobalTracer [candidate] (231.621 ms) : 0, 231621
AppSec [baseline] (48.849 ms) : 0, 48849
AppSec [candidate] (49.843 ms) : 0, 49843
Debugger [baseline] (5.917 ms) : 0, 5917
Debugger [candidate] (5.961 ms) : 0, 5961
Remote Config [baseline] (611.115 µs) : 0, 611
Remote Config [candidate] (617.942 µs) : 0, 618
Telemetry [baseline] (7.915 ms) : 0, 7915
Telemetry [candidate] (7.952 ms) : 0, 7952
IAST [baseline] (29.901 ms) : 0, 29901
IAST [candidate] (29.279 ms) : 0, 29279
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (800.576 ms) : 0, 800576
BytebuddyAgent [candidate] (806.366 ms) : 0, 806366
GlobalTracer [baseline] (230.34 ms) : 0, 230340
GlobalTracer [candidate] (231.619 ms) : 0, 231619
AppSec [baseline] (52.041 ms) : 0, 52041
AppSec [candidate] (48.453 ms) : 0, 48453
Debugger [baseline] (5.938 ms) : 0, 5938
Debugger [candidate] (5.846 ms) : 0, 5846
Remote Config [baseline] (606.677 µs) : 0, 607
Remote Config [candidate] (580.149 µs) : 0, 580
Telemetry [baseline] (7.859 ms) : 0, 7859
Telemetry [candidate] (7.865 ms) : 0, 7865
IAST [baseline] (26.684 ms) : 0, 26684
IAST [candidate] (30.045 ms) : 0, 30045
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (798.297 ms) : 0, 798297
BytebuddyAgent [candidate] (797.061 ms) : 0, 797061
GlobalTracer [baseline] (230.595 ms) : 0, 230595
GlobalTracer [candidate] (229.96 ms) : 0, 229960
AppSec [baseline] (55.202 ms) : 0, 55202
AppSec [candidate] (54.534 ms) : 0, 54534
Debugger [baseline] (5.904 ms) : 0, 5904
Debugger [candidate] (5.98 ms) : 0, 5980
Remote Config [baseline] (594.804 µs) : 0, 595
Remote Config [candidate] (613.757 µs) : 0, 614
Telemetry [baseline] (7.715 ms) : 0, 7715
Telemetry [candidate] (7.883 ms) : 0, 7883
IAST [baseline] (23.046 ms) : 0, 23046
IAST [candidate] (23.961 ms) : 0, 23961
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 19 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~4e94f29e7f, baseline=1.50.0-SNAPSHOT~9eafda94cf
dateFormat X
axisFormat %s
section baseline
no_agent (385.885 µs) : 366, 406
. : milestone, 386,
iast (524.037 µs) : 502, 546
. : milestone, 524,
iast_FULL (739.262 µs) : 717, 761
. : milestone, 739,
iast_GLOBAL (559.835 µs) : 538, 581
. : milestone, 560,
iast_HARDCODED_SECRET_DISABLED (521.123 µs) : 498, 544
. : milestone, 521,
iast_INACTIVE (472.739 µs) : 450, 495
. : milestone, 473,
iast_TELEMETRY_OFF (511.422 µs) : 487, 536
. : milestone, 511,
tracing (462.671 µs) : 441, 485
. : milestone, 463,
section candidate
no_agent (399.213 µs) : 379, 419
. : milestone, 399,
iast (522.383 µs) : 501, 544
. : milestone, 522,
iast_FULL (752.777 µs) : 730, 776
. : milestone, 753,
iast_GLOBAL (562.643 µs) : 541, 584
. : milestone, 563,
iast_HARDCODED_SECRET_DISABLED (517.611 µs) : 495, 541
. : milestone, 518,
iast_INACTIVE (473.76 µs) : 450, 497
. : milestone, 474,
iast_TELEMETRY_OFF (505.176 µs) : 482, 528
. : milestone, 505,
tracing (462.139 µs) : 440, 484
. : milestone, 462,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~4e94f29e7f, baseline=1.50.0-SNAPSHOT~9eafda94cf
dateFormat X
axisFormat %s
section baseline
no_agent (1.365 ms) : 1346, 1385
. : milestone, 1365,
appsec (1.723 ms) : 1700, 1747
. : milestone, 1723,
appsec_no_iast (1.739 ms) : 1715, 1762
. : milestone, 1739,
code_origins (1.681 ms) : 1654, 1708
. : milestone, 1681,
iast (1.507 ms) : 1483, 1531
. : milestone, 1507,
profiling (1.515 ms) : 1491, 1539
. : milestone, 1515,
tracing (1.5 ms) : 1475, 1525
. : milestone, 1500,
section candidate
no_agent (1.352 ms) : 1332, 1371
. : milestone, 1352,
appsec (1.761 ms) : 1738, 1785
. : milestone, 1761,
appsec_no_iast (1.728 ms) : 1704, 1752
. : milestone, 1728,
code_origins (1.661 ms) : 1634, 1689
. : milestone, 1661,
iast (1.525 ms) : 1502, 1549
. : milestone, 1525,
profiling (1.558 ms) : 1533, 1584
. : milestone, 1558,
tracing (1.496 ms) : 1473, 1519
. : milestone, 1496,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~4e94f29e7f, baseline=1.50.0-SNAPSHOT~9eafda94cf
dateFormat X
axisFormat %s
section baseline
no_agent (1.476 ms) : 1465, 1488
. : milestone, 1476,
appsec (2.402 ms) : 2353, 2451
. : milestone, 2402,
iast (2.184 ms) : 2122, 2247
. : milestone, 2184,
iast_GLOBAL (2.229 ms) : 2167, 2291
. : milestone, 2229,
profiling (2.05 ms) : 1999, 2101
. : milestone, 2050,
tracing (2.008 ms) : 1960, 2056
. : milestone, 2008,
section candidate
no_agent (1.475 ms) : 1463, 1486
. : milestone, 1475,
appsec (2.407 ms) : 2358, 2456
. : milestone, 2407,
iast (2.179 ms) : 2117, 2240
. : milestone, 2179,
iast_GLOBAL (2.229 ms) : 2166, 2291
. : milestone, 2229,
profiling (2.022 ms) : 1973, 2072
. : milestone, 2022,
tracing (2.012 ms) : 1964, 2060
. : milestone, 2012,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~4e94f29e7f, baseline=1.50.0-SNAPSHOT~9eafda94cf
dateFormat X
axisFormat %s
section baseline
no_agent (15.442 s) : 15442000, 15442000
. : milestone, 15442000,
appsec (14.954 s) : 14954000, 14954000
. : milestone, 14954000,
iast (18.998 s) : 18998000, 18998000
. : milestone, 18998000,
iast_GLOBAL (17.913 s) : 17913000, 17913000
. : milestone, 17913000,
profiling (14.89 s) : 14890000, 14890000
. : milestone, 14890000,
tracing (15.047 s) : 15047000, 15047000
. : milestone, 15047000,
section candidate
no_agent (15.575 s) : 15575000, 15575000
. : milestone, 15575000,
appsec (15.24 s) : 15240000, 15240000
. : milestone, 15240000,
iast (19.067 s) : 19067000, 19067000
. : milestone, 19067000,
iast_GLOBAL (18.078 s) : 18078000, 18078000
. : milestone, 18078000,
profiling (14.93 s) : 14930000, 14930000
. : milestone, 14930000,
tracing (15.078 s) : 15078000, 15078000
. : milestone, 15078000,
|
Context
and ContextScope
Context
and ContextScope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to submit my comment 😅
return extractedSpan == null ? null : (AgentSpanContext.Extracted) extractedSpan.context(); | ||
} | ||
|
||
public AgentSpan onRequestWithContext( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be named onRequest
. It won't conflict as the parameters are different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PerfectSlayer there is actually an issue with onRequest
where they pass in null
as a context, which then leads to the compiler being confused about which which function to use 🤔
2a6d442
to
4e94f29
Compare
What Does This Do
Migrate all Http Server Instrumentations to extract full
Context
. This PR adds functions inHttpServerDecorator.java
to use a fullContext
in all instrumentation decorator calls. Additionally, it replaces the usage ofactivateSpan
andAgentScope
toContext.attach()
andContextScope
to allow thescopeStack
to track full Context rather than just SpanContexts.Once merged, a follow-up PR will be opened to remove all Http Server decorator calls that were based upon Span Contexts. The new Context-based decorator functions will be used instead.
This PR enables full W3C Baggage extraction for all Http Server instrumentations.
Motivation
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]