-
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
Introduce tracing propagator #8313
base: master
Are you sure you want to change the base?
Conversation
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 11 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.46.0-SNAPSHOT~522049f59c, baseline=1.46.0-SNAPSHOT~e455ca77d9
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.036 s) : 0, 1036194
Total [baseline] (8.624 s) : 0, 8624006
Agent [candidate] (1.048 s) : 0, 1048196
Total [candidate] (8.69 s) : 0, 8689516
section iast
Agent [baseline] (1.169 s) : 0, 1168769
Total [baseline] (9.239 s) : 0, 9238834
Agent [candidate] (1.179 s) : 0, 1179141
Total [candidate] (9.282 s) : 0, 9282474
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.169 s) : 0, 1168858
Total [baseline] (9.196 s) : 0, 9195539
Agent [candidate] (1.173 s) : 0, 1173246
Total [candidate] (9.219 s) : 0, 9219462
section iast_TELEMETRY_OFF
Agent [baseline] (1.167 s) : 0, 1166650
Total [baseline] (9.231 s) : 0, 9231122
Agent [candidate] (1.174 s) : 0, 1174014
Total [candidate] (9.232 s) : 0, 9232044
gantt
title insecure-bank - break down per module: candidate=1.46.0-SNAPSHOT~522049f59c, baseline=1.46.0-SNAPSHOT~e455ca77d9
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (714.015 ms) : 0, 714015
BytebuddyAgent [candidate] (720.575 ms) : 0, 720575
GlobalTracer [baseline] (239.752 ms) : 0, 239752
GlobalTracer [candidate] (244.721 ms) : 0, 244721
AppSec [baseline] (55.659 ms) : 0, 55659
AppSec [candidate] (55.867 ms) : 0, 55867
Remote Config [baseline] (729.41 µs) : 0, 729
Remote Config [candidate] (735.755 µs) : 0, 736
Telemetry [baseline] (10.821 ms) : 0, 10821
Telemetry [candidate] (10.929 ms) : 0, 10929
section iast
BytebuddyAgent [baseline] (833.556 ms) : 0, 833556
BytebuddyAgent [candidate] (839.569 ms) : 0, 839569
GlobalTracer [baseline] (230.932 ms) : 0, 230932
GlobalTracer [candidate] (234.65 ms) : 0, 234650
IAST [baseline] (24.859 ms) : 0, 24859
IAST [candidate] (23.514 ms) : 0, 23514
AppSec [baseline] (54.747 ms) : 0, 54747
AppSec [candidate] (56.55 ms) : 0, 56550
Remote Config [baseline] (613.012 µs) : 0, 613
Remote Config [candidate] (621.945 µs) : 0, 622
Telemetry [baseline] (8.704 ms) : 0, 8704
Telemetry [candidate] (8.74 ms) : 0, 8740
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (833.642 ms) : 0, 833642
BytebuddyAgent [candidate] (834.193 ms) : 0, 834193
GlobalTracer [baseline] (230.963 ms) : 0, 230963
GlobalTracer [candidate] (234.027 ms) : 0, 234027
IAST [baseline] (26.311 ms) : 0, 26311
IAST [candidate] (25.91 ms) : 0, 25910
AppSec [baseline] (53.153 ms) : 0, 53153
AppSec [candidate] (54.348 ms) : 0, 54348
Remote Config [baseline] (615.259 µs) : 0, 615
Remote Config [candidate] (625.265 µs) : 0, 625
Telemetry [baseline] (8.8 ms) : 0, 8800
Telemetry [candidate] (8.775 ms) : 0, 8775
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (831.933 ms) : 0, 831933
BytebuddyAgent [candidate] (835.567 ms) : 0, 835567
GlobalTracer [baseline] (231.078 ms) : 0, 231078
GlobalTracer [candidate] (234.34 ms) : 0, 234340
IAST [baseline] (25.129 ms) : 0, 25129
IAST [candidate] (26.302 ms) : 0, 26302
AppSec [baseline] (53.99 ms) : 0, 53990
AppSec [candidate] (53.03 ms) : 0, 53030
Remote Config [baseline] (623.655 µs) : 0, 624
Remote Config [candidate] (627.983 µs) : 0, 628
Telemetry [baseline] (8.56 ms) : 0, 8560
Telemetry [candidate] (8.685 ms) : 0, 8685
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.46.0-SNAPSHOT~522049f59c, baseline=1.46.0-SNAPSHOT~e455ca77d9
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.037 s) : 0, 1037254
Total [baseline] (10.543 s) : 0, 10542637
Agent [candidate] (1.043 s) : 0, 1042748
Total [candidate] (10.529 s) : 0, 10529400
section appsec
Agent [baseline] (1.181 s) : 0, 1180530
Total [baseline] (10.722 s) : 0, 10721612
Agent [candidate] (1.184 s) : 0, 1184296
Total [candidate] (10.746 s) : 0, 10746252
section iast
Agent [baseline] (1.17 s) : 0, 1169940
Total [baseline] (11.02 s) : 0, 11019936
Agent [candidate] (1.192 s) : 0, 1191931
Total [candidate] (11.065 s) : 0, 11064941
section profiling
Agent [baseline] (1.267 s) : 0, 1266506
Total [baseline] (10.95 s) : 0, 10950185
Agent [candidate] (1.265 s) : 0, 1265006
Total [candidate] (10.913 s) : 0, 10913076
gantt
title petclinic - break down per module: candidate=1.46.0-SNAPSHOT~522049f59c, baseline=1.46.0-SNAPSHOT~e455ca77d9
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (714.971 ms) : 0, 714971
BytebuddyAgent [candidate] (715.461 ms) : 0, 715461
GlobalTracer [baseline] (239.596 ms) : 0, 239596
GlobalTracer [candidate] (242.989 ms) : 0, 242989
AppSec [baseline] (55.097 ms) : 0, 55097
AppSec [candidate] (56.05 ms) : 0, 56050
Remote Config [baseline] (720.888 µs) : 0, 721
Remote Config [candidate] (713.312 µs) : 0, 713
Telemetry [baseline] (11.593 ms) : 0, 11593
Telemetry [candidate] (12.302 ms) : 0, 12302
section appsec
BytebuddyAgent [baseline] (731.747 ms) : 0, 731747
BytebuddyAgent [candidate] (732.679 ms) : 0, 732679
GlobalTracer [baseline] (237.328 ms) : 0, 237328
GlobalTracer [candidate] (240.417 ms) : 0, 240417
IAST [baseline] (21.559 ms) : 0, 21559
IAST [candidate] (21.603 ms) : 0, 21603
AppSec [baseline] (176.407 ms) : 0, 176407
AppSec [candidate] (175.816 ms) : 0, 175816
Remote Config [baseline] (655.64 µs) : 0, 656
Remote Config [candidate] (655.636 µs) : 0, 656
Telemetry [baseline] (8.336 ms) : 0, 8336
Telemetry [candidate] (8.662 ms) : 0, 8662
section iast
BytebuddyAgent [baseline] (834.548 ms) : 0, 834548
BytebuddyAgent [candidate] (848.648 ms) : 0, 848648
GlobalTracer [baseline] (231.294 ms) : 0, 231294
GlobalTracer [candidate] (237.246 ms) : 0, 237246
IAST [baseline] (25.555 ms) : 0, 25555
IAST [candidate] (29.615 ms) : 0, 29615
AppSec [baseline] (53.965 ms) : 0, 53965
AppSec [candidate] (51.339 ms) : 0, 51339
Remote Config [baseline] (616.209 µs) : 0, 616
Remote Config [candidate] (619.898 µs) : 0, 620
Telemetry [baseline] (8.673 ms) : 0, 8673
Telemetry [candidate] (8.899 ms) : 0, 8899
section profiling
BytebuddyAgent [baseline] (708.904 ms) : 0, 708904
BytebuddyAgent [candidate] (707.441 ms) : 0, 707441
GlobalTracer [baseline] (353.843 ms) : 0, 353843
GlobalTracer [candidate] (354.84 ms) : 0, 354840
AppSec [baseline] (55.285 ms) : 0, 55285
AppSec [candidate] (54.438 ms) : 0, 54438
Remote Config [baseline] (711.647 µs) : 0, 712
Remote Config [candidate] (712.972 µs) : 0, 713
Telemetry [baseline] (8.884 ms) : 0, 8884
Telemetry [candidate] (8.896 ms) : 0, 8896
ProfilingAgent [baseline] (96.501 ms) : 0, 96501
ProfilingAgent [candidate] (96.314 ms) : 0, 96314
Profiling [baseline] (96.528 ms) : 0, 96528
Profiling [candidate] (96.342 ms) : 0, 96342
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~522049f59c, baseline=1.46.0-SNAPSHOT~e455ca77d9
dateFormat X
axisFormat %s
section baseline
no_agent (375.41 µs) : 356, 395
. : milestone, 375,
iast (512.995 µs) : 489, 537
. : milestone, 513,
iast_FULL (741.975 µs) : 720, 764
. : milestone, 742,
iast_GLOBAL (552.979 µs) : 530, 576
. : milestone, 553,
iast_HARDCODED_SECRET_DISABLED (513.534 µs) : 490, 537
. : milestone, 514,
iast_INACTIVE (460.776 µs) : 439, 483
. : milestone, 461,
iast_TELEMETRY_OFF (493.453 µs) : 471, 516
. : milestone, 493,
tracing (453.377 µs) : 432, 475
. : milestone, 453,
section candidate
no_agent (384.979 µs) : 365, 405
. : milestone, 385,
iast (508.875 µs) : 487, 530
. : milestone, 509,
iast_FULL (745.17 µs) : 723, 767
. : milestone, 745,
iast_GLOBAL (566.92 µs) : 545, 589
. : milestone, 567,
iast_HARDCODED_SECRET_DISABLED (504.679 µs) : 483, 526
. : milestone, 505,
iast_INACTIVE (455.07 µs) : 434, 476
. : milestone, 455,
iast_TELEMETRY_OFF (498.613 µs) : 476, 522
. : milestone, 499,
tracing (454.708 µs) : 431, 478
. : milestone, 455,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.46.0-SNAPSHOT~522049f59c, baseline=1.46.0-SNAPSHOT~e455ca77d9
dateFormat X
axisFormat %s
section baseline
no_agent (1.368 ms) : 1348, 1389
. : milestone, 1368,
appsec (1.771 ms) : 1748, 1794
. : milestone, 1771,
appsec_no_iast (1.754 ms) : 1729, 1779
. : milestone, 1754,
iast (1.493 ms) : 1468, 1518
. : milestone, 1493,
profiling (1.51 ms) : 1487, 1533
. : milestone, 1510,
tracing (1.5 ms) : 1474, 1526
. : milestone, 1500,
section candidate
no_agent (1.345 ms) : 1326, 1365
. : milestone, 1345,
appsec (1.739 ms) : 1715, 1762
. : milestone, 1739,
appsec_no_iast (1.75 ms) : 1727, 1773
. : milestone, 1750,
iast (1.525 ms) : 1500, 1550
. : milestone, 1525,
profiling (1.525 ms) : 1502, 1548
. : milestone, 1525,
tracing (1.494 ms) : 1470, 1519
. : milestone, 1494,
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.46.0-SNAPSHOT~522049f59c, baseline=1.46.0-SNAPSHOT~e455ca77d9
dateFormat X
axisFormat %s
section baseline
no_agent (1.464 ms) : 1453, 1476
. : milestone, 1464,
appsec (2.354 ms) : 2311, 2397
. : milestone, 2354,
iast (2.103 ms) : 2048, 2158
. : milestone, 2103,
iast_GLOBAL (2.14 ms) : 2086, 2195
. : milestone, 2140,
profiling (1.969 ms) : 1924, 2013
. : milestone, 1969,
tracing (1.931 ms) : 1889, 1973
. : milestone, 1931,
section candidate
no_agent (1.465 ms) : 1454, 1477
. : milestone, 1465,
appsec (2.344 ms) : 2300, 2387
. : milestone, 2344,
iast (2.1 ms) : 2045, 2154
. : milestone, 2100,
iast_GLOBAL (2.143 ms) : 2088, 2198
. : milestone, 2143,
profiling (1.945 ms) : 1902, 1988
. : milestone, 1945,
tracing (1.944 ms) : 1901, 1986
. : milestone, 1944,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.46.0-SNAPSHOT~522049f59c, baseline=1.46.0-SNAPSHOT~e455ca77d9
dateFormat X
axisFormat %s
section baseline
no_agent (15.302 s) : 15302000, 15302000
. : milestone, 15302000,
appsec (15.081 s) : 15081000, 15081000
. : milestone, 15081000,
iast (18.313 s) : 18313000, 18313000
. : milestone, 18313000,
iast_GLOBAL (17.894 s) : 17894000, 17894000
. : milestone, 17894000,
profiling (15.163 s) : 15163000, 15163000
. : milestone, 15163000,
tracing (14.906 s) : 14906000, 14906000
. : milestone, 14906000,
section candidate
no_agent (15.419 s) : 15419000, 15419000
. : milestone, 15419000,
appsec (15.012 s) : 15012000, 15012000
. : milestone, 15012000,
iast (18.375 s) : 18375000, 18375000
. : milestone, 18375000,
iast_GLOBAL (18.173 s) : 18173000, 18173000
. : milestone, 18173000,
profiling (14.93 s) : 14930000, 14930000
. : milestone, 14930000,
tracing (15.084 s) : 15084000, 15084000
. : milestone, 15084000,
|
bfd54a0
to
522049f
Compare
|
||
@Override | ||
public String getBaggageItem(final String key) { | ||
Iterable<Map.Entry<String, String>> baggage = this.spanContext.baggageItems(); |
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.
Just out of curiosity, why aren't we exposing something from the context that allows for better querying?
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.
heh - looks this was introduced very early on in PR #2 !
I would also be interested if it's possible to switch to a map-like API here for the intervening call or if this is something we can only really rip out once we complete the migration to the new context API.
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.
LGTM (but a more informed review is in order 😄)
* <p>Tags and baggage access are inefficient and only supported as remediation for products | ||
* storing propagated information into span context, until they migrate to the new context API. | ||
*/ | ||
static final class ExtractedSpan extends AgentTracer.NoopAgentSpan { |
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.
There are a few places in instrumentation that check span instanceof AgentTracer.NoopAgentSpan
and use that to suppress tracing (the other sub-class is BlackholeAgentSpan
)
Is there a reason to extend NoopAgentSpan
other than to re-use methods? Maybe it would be better to introduce a new base class such as ImmutableSpan
which both ExtractedSpan
and NoopAgentSpan
can extend?
/** | ||
* Creates a span wrapper from a span context. | ||
* | ||
* <p>Creating a such span will not create a tracing span to complete a local root trace. It gives |
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.
* <p>Creating a such span will not create a tracing span to complete a local root trace. It gives | |
* <p>Creating such span will not create a tracing span to complete a local root trace. It gives |
* | ||
* <p>Creating a such span will not create a tracing span to complete a local root trace. It gives | ||
* a span instance based on a span context for span-based API. It is usually used with an | ||
* extracted span context as parameter to represent a remove span. |
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.
* extracted span context as parameter to represent a remove span. | |
* extracted span context as parameter to represent a remote span. |
* extracted span context as parameter to represent a remove span. | ||
* | ||
* @param spanContext the span context to get a full-fledged span. | ||
* @return a span wrapped based on a span 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.
* @return a span wrapped based on a span context. | |
* @return a span wrapper based on a span 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.
LGTM - just a question if ExtractedSpan
should really extend NoopAgentSpan
or whether we should introduce a common base class ImmutableSpan
which both can extend separately.
What Does This Do
This PR introduce the Tracing propagator. It is register and available from the new propagator API but not used yet in instrumentation (next PR to come).
The PR also introduces the
ExtractedSpan
implementation, a wrapper of a span context to provide a span instance without the cost of creating aDDSpan
, to be able to use span-based API without requiring a full-fledge span. It will be mainly used from extracted span context.Motivation
The existing
HttpCodec.Extractor
is based on span context while the new context API can store span, hence the introduction of theExtractedSpan
.Note the behavior is similar and will be compatible with OTel.
Additional Notes
I plan to get rid of the original getter / setter for
HttpCodec
in favor of the ones introduced in the context component.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