-
Notifications
You must be signed in to change notification settings - Fork 293
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
Refactor agent spans and scopes #8321
base: master
Are you sure you want to change the base?
Conversation
public static final class Context extends NoopSpanContext { | ||
public static final Context INSTANCE = new Context(); | ||
|
||
private Context() {} |
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.
public BlackHoleSpan(final DDTraceId traceId) { | ||
this.traceId = traceId; | ||
} |
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.
class NoopSpan extends ImmutableSpan implements AgentSpan { | ||
static final NoopSpan INSTANCE = new NoopSpan(); | ||
|
||
NoopSpan() {} |
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.
ExtractedSpan(AgentSpanContext spanContext) { | ||
this.spanContext = spanContext; | ||
} |
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.
47a977e
to
9d95fd3
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 50 metrics, 13 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.47.0-SNAPSHOT~9b9e1ac9eb, baseline=1.47.0-SNAPSHOT~2a09977b03
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.042 s) : 0, 1042006
Total [baseline] (10.548 s) : 0, 10547870
Agent [candidate] (1.048 s) : 0, 1048110
Total [candidate] (10.531 s) : 0, 10530820
section appsec
Agent [baseline] (1.182 s) : 0, 1182343
Total [baseline] (10.775 s) : 0, 10775071
Agent [candidate] (1.189 s) : 0, 1188826
Total [candidate] (10.77 s) : 0, 10769946
section iast
Agent [baseline] (1.18 s) : 0, 1180227
Total [baseline] (11.005 s) : 0, 11004776
Agent [candidate] (1.183 s) : 0, 1182656
Total [candidate] (11.109 s) : 0, 11109315
section profiling
Agent [baseline] (1.263 s) : 0, 1263248
Total [baseline] (10.836 s) : 0, 10836049
Agent [candidate] (1.27 s) : 0, 1269688
Total [candidate] (10.965 s) : 0, 10965001
gantt
title petclinic - break down per module: candidate=1.47.0-SNAPSHOT~9b9e1ac9eb, baseline=1.47.0-SNAPSHOT~2a09977b03
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (715.98 ms) : 0, 715980
BytebuddyAgent [candidate] (719.825 ms) : 0, 719825
GlobalTracer [baseline] (243.486 ms) : 0, 243486
GlobalTracer [candidate] (244.336 ms) : 0, 244336
AppSec [baseline] (55.641 ms) : 0, 55641
AppSec [candidate] (55.116 ms) : 0, 55116
Remote Config [baseline] (721.917 µs) : 0, 722
Remote Config [candidate] (725.916 µs) : 0, 726
Telemetry [baseline] (10.952 ms) : 0, 10952
Telemetry [candidate] (12.934 ms) : 0, 12934
section appsec
BytebuddyAgent [baseline] (731.461 ms) : 0, 731461
BytebuddyAgent [candidate] (736.046 ms) : 0, 736046
GlobalTracer [baseline] (240.252 ms) : 0, 240252
GlobalTracer [candidate] (241.054 ms) : 0, 241054
AppSec [baseline] (175.729 ms) : 0, 175729
AppSec [candidate] (176.256 ms) : 0, 176256
Remote Config [baseline] (656.847 µs) : 0, 657
Remote Config [candidate] (658.864 µs) : 0, 659
Telemetry [baseline] (8.256 ms) : 0, 8256
Telemetry [candidate] (8.719 ms) : 0, 8719
IAST [baseline] (21.593 ms) : 0, 21593
IAST [candidate] (21.565 ms) : 0, 21565
section iast
BytebuddyAgent [baseline] (841.498 ms) : 0, 841498
BytebuddyAgent [candidate] (841.305 ms) : 0, 841305
GlobalTracer [baseline] (234.371 ms) : 0, 234371
GlobalTracer [candidate] (235.624 ms) : 0, 235624
AppSec [baseline] (52.375 ms) : 0, 52375
AppSec [candidate] (52.959 ms) : 0, 52959
Remote Config [baseline] (622.082 µs) : 0, 622
Remote Config [candidate] (631.146 µs) : 0, 631
Telemetry [baseline] (8.713 ms) : 0, 8713
Telemetry [candidate] (8.918 ms) : 0, 8918
IAST [baseline] (27.241 ms) : 0, 27241
IAST [candidate] (27.735 ms) : 0, 27735
section profiling
BytebuddyAgent [baseline] (705.983 ms) : 0, 705983
BytebuddyAgent [candidate] (711.39 ms) : 0, 711390
GlobalTracer [baseline] (354.356 ms) : 0, 354356
GlobalTracer [candidate] (355.766 ms) : 0, 355766
AppSec [baseline] (54.894 ms) : 0, 54894
AppSec [candidate] (54.645 ms) : 0, 54645
Remote Config [baseline] (764.076 µs) : 0, 764
Remote Config [candidate] (697.525 µs) : 0, 698
Telemetry [baseline] (8.963 ms) : 0, 8963
Telemetry [candidate] (8.939 ms) : 0, 8939
ProfilingAgent [baseline] (96.025 ms) : 0, 96025
ProfilingAgent [candidate] (95.658 ms) : 0, 95658
Profiling [baseline] (96.049 ms) : 0, 96049
Profiling [candidate] (95.682 ms) : 0, 95682
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.47.0-SNAPSHOT~9b9e1ac9eb, baseline=1.47.0-SNAPSHOT~2a09977b03
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1045094
Total [baseline] (8.669 s) : 0, 8668925
Agent [candidate] (1.041 s) : 0, 1040951
Total [candidate] (8.639 s) : 0, 8639057
section iast
Agent [baseline] (1.171 s) : 0, 1170508
Total [baseline] (9.261 s) : 0, 9261305
Agent [candidate] (1.173 s) : 0, 1173107
Total [candidate] (9.228 s) : 0, 9227604
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.173 s) : 0, 1173500
Total [baseline] (9.229 s) : 0, 9228757
Agent [candidate] (1.179 s) : 0, 1179114
Total [candidate] (9.253 s) : 0, 9253458
section iast_TELEMETRY_OFF
Agent [baseline] (1.176 s) : 0, 1176428
Total [baseline] (9.243 s) : 0, 9242969
Agent [candidate] (1.171 s) : 0, 1171255
Total [candidate] (9.248 s) : 0, 9248482
gantt
title insecure-bank - break down per module: candidate=1.47.0-SNAPSHOT~9b9e1ac9eb, baseline=1.47.0-SNAPSHOT~2a09977b03
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (717.741 ms) : 0, 717741
BytebuddyAgent [candidate] (715.426 ms) : 0, 715426
GlobalTracer [baseline] (243.399 ms) : 0, 243399
GlobalTracer [candidate] (243.663 ms) : 0, 243663
AppSec [baseline] (55.265 ms) : 0, 55265
AppSec [candidate] (55.252 ms) : 0, 55252
Remote Config [baseline] (722.897 µs) : 0, 723
Remote Config [candidate] (725.669 µs) : 0, 726
Telemetry [baseline] (12.751 ms) : 0, 12751
Telemetry [candidate] (10.73 ms) : 0, 10730
section iast
BytebuddyAgent [baseline] (832.809 ms) : 0, 832809
BytebuddyAgent [candidate] (834.261 ms) : 0, 834261
GlobalTracer [baseline] (233.845 ms) : 0, 233845
GlobalTracer [candidate] (234.145 ms) : 0, 234145
AppSec [baseline] (52.12 ms) : 0, 52120
AppSec [candidate] (54.947 ms) : 0, 54947
Remote Config [baseline] (612.984 µs) : 0, 613
Remote Config [candidate] (629.179 µs) : 0, 629
Telemetry [baseline] (8.724 ms) : 0, 8724
Telemetry [candidate] (8.737 ms) : 0, 8737
IAST [baseline] (27.182 ms) : 0, 27182
IAST [candidate] (25.132 ms) : 0, 25132
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (834.805 ms) : 0, 834805
BytebuddyAgent [candidate] (840.762 ms) : 0, 840762
GlobalTracer [baseline] (234.439 ms) : 0, 234439
GlobalTracer [candidate] (234.065 ms) : 0, 234065
AppSec [baseline] (53.231 ms) : 0, 53231
AppSec [candidate] (51.405 ms) : 0, 51405
Remote Config [baseline] (623.461 µs) : 0, 623
Remote Config [candidate] (615.362 µs) : 0, 615
Telemetry [baseline] (8.715 ms) : 0, 8715
Telemetry [candidate] (8.794 ms) : 0, 8794
IAST [baseline] (26.475 ms) : 0, 26475
IAST [candidate] (28.109 ms) : 0, 28109
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (836.701 ms) : 0, 836701
BytebuddyAgent [candidate] (833.121 ms) : 0, 833121
GlobalTracer [baseline] (235.206 ms) : 0, 235206
GlobalTracer [candidate] (234.513 ms) : 0, 234513
AppSec [baseline] (55.91 ms) : 0, 55910
AppSec [candidate] (51.364 ms) : 0, 51364
Remote Config [baseline] (620.903 µs) : 0, 621
Remote Config [candidate] (617.67 µs) : 0, 618
Telemetry [baseline] (8.717 ms) : 0, 8717
Telemetry [candidate] (8.631 ms) : 0, 8631
IAST [baseline] (23.967 ms) : 0, 23967
IAST [candidate] (27.666 ms) : 0, 27666
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.47.0-SNAPSHOT~9b9e1ac9eb, baseline=1.47.0-SNAPSHOT~2a09977b03
dateFormat X
axisFormat %s
section baseline
no_agent (1.358 ms) : 1338, 1378
. : milestone, 1358,
appsec (1.761 ms) : 1735, 1786
. : milestone, 1761,
appsec_no_iast (1.778 ms) : 1754, 1803
. : milestone, 1778,
iast (1.51 ms) : 1486, 1534
. : milestone, 1510,
profiling (1.518 ms) : 1495, 1540
. : milestone, 1518,
tracing (1.496 ms) : 1472, 1520
. : milestone, 1496,
section candidate
no_agent (1.366 ms) : 1346, 1385
. : milestone, 1366,
appsec (1.744 ms) : 1720, 1769
. : milestone, 1744,
appsec_no_iast (1.753 ms) : 1728, 1777
. : milestone, 1753,
iast (1.517 ms) : 1491, 1542
. : milestone, 1517,
profiling (1.523 ms) : 1498, 1548
. : milestone, 1523,
tracing (1.501 ms) : 1476, 1525
. : milestone, 1501,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.47.0-SNAPSHOT~9b9e1ac9eb, baseline=1.47.0-SNAPSHOT~2a09977b03
dateFormat X
axisFormat %s
section baseline
no_agent (383.901 µs) : 364, 404
. : milestone, 384,
iast (515.488 µs) : 493, 538
. : milestone, 515,
iast_FULL (747.234 µs) : 725, 769
. : milestone, 747,
iast_GLOBAL (559.463 µs) : 537, 582
. : milestone, 559,
iast_HARDCODED_SECRET_DISABLED (523.681 µs) : 501, 547
. : milestone, 524,
iast_INACTIVE (471.325 µs) : 449, 493
. : milestone, 471,
iast_TELEMETRY_OFF (505.683 µs) : 482, 529
. : milestone, 506,
tracing (460.237 µs) : 436, 485
. : milestone, 460,
section candidate
no_agent (379.05 µs) : 359, 399
. : milestone, 379,
iast (509.292 µs) : 488, 531
. : milestone, 509,
iast_FULL (741.072 µs) : 719, 763
. : milestone, 741,
iast_GLOBAL (566.663 µs) : 543, 590
. : milestone, 567,
iast_HARDCODED_SECRET_DISABLED (511.952 µs) : 490, 534
. : milestone, 512,
iast_INACTIVE (464.849 µs) : 443, 487
. : milestone, 465,
iast_TELEMETRY_OFF (497.509 µs) : 475, 520
. : milestone, 498,
tracing (458.577 µs) : 437, 480
. : milestone, 459,
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 biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.47.0-SNAPSHOT~9b9e1ac9eb, baseline=1.47.0-SNAPSHOT~2a09977b03
dateFormat X
axisFormat %s
section baseline
no_agent (14.99 s) : 14990000, 14990000
. : milestone, 14990000,
appsec (14.826 s) : 14826000, 14826000
. : milestone, 14826000,
iast (19.081 s) : 19081000, 19081000
. : milestone, 19081000,
iast_GLOBAL (18.286 s) : 18286000, 18286000
. : milestone, 18286000,
profiling (14.926 s) : 14926000, 14926000
. : milestone, 14926000,
tracing (14.993 s) : 14993000, 14993000
. : milestone, 14993000,
section candidate
no_agent (15.316 s) : 15316000, 15316000
. : milestone, 15316000,
appsec (14.824 s) : 14824000, 14824000
. : milestone, 14824000,
iast (18.963 s) : 18963000, 18963000
. : milestone, 18963000,
iast_GLOBAL (17.763 s) : 17763000, 17763000
. : milestone, 17763000,
profiling (15.572 s) : 15572000, 15572000
. : milestone, 15572000,
tracing (15.165 s) : 15165000, 15165000
. : milestone, 15165000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.47.0-SNAPSHOT~9b9e1ac9eb, baseline=1.47.0-SNAPSHOT~2a09977b03
dateFormat X
axisFormat %s
section baseline
no_agent (1.469 ms) : 1458, 1481
. : milestone, 1469,
appsec (2.376 ms) : 2333, 2420
. : milestone, 2376,
iast (2.099 ms) : 2045, 2154
. : milestone, 2099,
iast_GLOBAL (2.15 ms) : 2095, 2205
. : milestone, 2150,
profiling (1.97 ms) : 1926, 2014
. : milestone, 1970,
tracing (1.949 ms) : 1907, 1991
. : milestone, 1949,
section candidate
no_agent (1.468 ms) : 1457, 1480
. : milestone, 1468,
appsec (2.365 ms) : 2321, 2408
. : milestone, 2365,
iast (2.104 ms) : 2050, 2159
. : milestone, 2104,
iast_GLOBAL (2.145 ms) : 2090, 2199
. : milestone, 2145,
profiling (1.97 ms) : 1927, 2014
. : milestone, 1970,
tracing (1.944 ms) : 1902, 1986
. : milestone, 1944,
|
2a4a5ad
to
2bb3c30
Compare
…tracer Introduce Java 8 bytecode bridge Remove unused eligibleForDropping method Improve Javadoc
2bb3c30
to
9b9e1ac
Compare
What Does This Do
This PR extracts and refactors span and scope from tracer.
It introduces the
ImmutableSpan
implementation as a stub implementation for span mutators (AgentSpan
inherits fromMutableSpan
from public API so it can't be changed), and parent abstract class forNoopSpan
(that does nothing),BlackHoleSpan
(that stops propagation), andExtractedSpan
(that represents a remove span).Motivation
Additional Notes
This also contains typo / wording fixes from #8313
I hesitate about introducing an
isValid
method that checks for span validity (tid != 0& sid != 0) to distinguish noop and black hole span implementations.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: LANGPLAT-293