-
Notifications
You must be signed in to change notification settings - Fork 291
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
Dynamically evaluate service name for message consumers #8088
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. |
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
446ee9a
to
7c58298
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 55 metrics, 7 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.45.0-SNAPSHOT~379790dc37, baseline=1.45.0-SNAPSHOT~721af2f5a5
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.094 s) : 0, 1094195
Total [baseline] (8.641 s) : 0, 8641401
Agent [candidate] (1.095 s) : 0, 1095354
Total [candidate] (8.644 s) : 0, 8644459
section iast
Agent [baseline] (1.223 s) : 0, 1222977
Total [baseline] (9.255 s) : 0, 9255440
Agent [candidate] (1.234 s) : 0, 1233583
Total [candidate] (9.207 s) : 0, 9206860
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.223 s) : 0, 1223325
Total [baseline] (9.181 s) : 0, 9180901
Agent [candidate] (1.23 s) : 0, 1230441
Total [candidate] (9.198 s) : 0, 9198142
section iast_TELEMETRY_OFF
Agent [baseline] (1.217 s) : 0, 1216993
Total [baseline] (9.18 s) : 0, 9180298
Agent [candidate] (1.22 s) : 0, 1220357
Total [candidate] (9.183 s) : 0, 9182616
gantt
title insecure-bank - break down per module: candidate=1.45.0-SNAPSHOT~379790dc37, baseline=1.45.0-SNAPSHOT~721af2f5a5
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (696.206 ms) : 0, 696206
BytebuddyAgent [candidate] (697.056 ms) : 0, 697056
GlobalTracer [baseline] (317.702 ms) : 0, 317702
GlobalTracer [candidate] (318.603 ms) : 0, 318603
AppSec [baseline] (54.43 ms) : 0, 54430
AppSec [candidate] (54.577 ms) : 0, 54577
Remote Config [baseline] (682.224 µs) : 0, 682
Remote Config [candidate] (673.672 µs) : 0, 674
Telemetry [baseline] (11.389 ms) : 0, 11389
Telemetry [candidate] (10.738 ms) : 0, 10738
section iast
BytebuddyAgent [baseline] (814.538 ms) : 0, 814538
BytebuddyAgent [candidate] (822.281 ms) : 0, 822281
GlobalTracer [baseline] (306.959 ms) : 0, 306959
GlobalTracer [candidate] (309.461 ms) : 0, 309461
AppSec [baseline] (56.929 ms) : 0, 56929
AppSec [candidate] (56.383 ms) : 0, 56383
IAST [baseline] (22.751 ms) : 0, 22751
IAST [candidate] (23.448 ms) : 0, 23448
Remote Config [baseline] (601.697 µs) : 0, 602
Remote Config [candidate] (604.501 µs) : 0, 605
Telemetry [baseline] (7.399 ms) : 0, 7399
Telemetry [candidate] (7.437 ms) : 0, 7437
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (813.684 ms) : 0, 813684
BytebuddyAgent [candidate] (820.446 ms) : 0, 820446
GlobalTracer [baseline] (307.789 ms) : 0, 307789
GlobalTracer [candidate] (308.983 ms) : 0, 308983
AppSec [baseline] (58.581 ms) : 0, 58581
AppSec [candidate] (57.981 ms) : 0, 57981
IAST [baseline] (21.281 ms) : 0, 21281
IAST [candidate] (21.057 ms) : 0, 21057
Remote Config [baseline] (605.779 µs) : 0, 606
Remote Config [candidate] (615.703 µs) : 0, 616
Telemetry [baseline] (7.608 ms) : 0, 7608
Telemetry [candidate] (7.434 ms) : 0, 7434
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (810.766 ms) : 0, 810766
BytebuddyAgent [candidate] (812.165 ms) : 0, 812165
GlobalTracer [baseline] (305.98 ms) : 0, 305980
GlobalTracer [candidate] (307.614 ms) : 0, 307614
AppSec [baseline] (57.659 ms) : 0, 57659
AppSec [candidate] (58.275 ms) : 0, 58275
IAST [baseline] (20.765 ms) : 0, 20765
IAST [candidate] (20.552 ms) : 0, 20552
Remote Config [baseline] (673.41 µs) : 0, 673
Remote Config [candidate] (614.89 µs) : 0, 615
Telemetry [baseline] (7.408 ms) : 0, 7408
Telemetry [candidate] (7.327 ms) : 0, 7327
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.45.0-SNAPSHOT~379790dc37, baseline=1.45.0-SNAPSHOT~721af2f5a5
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.097 s) : 0, 1097322
Total [baseline] (10.444 s) : 0, 10444235
Agent [candidate] (1.095 s) : 0, 1094958
Total [candidate] (10.431 s) : 0, 10431391
section appsec
Agent [baseline] (1.227 s) : 0, 1226785
Total [baseline] (10.717 s) : 0, 10717426
Agent [candidate] (1.229 s) : 0, 1228501
Total [candidate] (10.712 s) : 0, 10712336
section iast
Agent [baseline] (1.22 s) : 0, 1219503
Total [baseline] (10.975 s) : 0, 10974765
Agent [candidate] (1.229 s) : 0, 1229060
Total [candidate] (11.01 s) : 0, 11009862
section profiling
Agent [baseline] (1.318 s) : 0, 1317618
Total [baseline] (10.822 s) : 0, 10821996
Agent [candidate] (1.32 s) : 0, 1320433
Total [candidate] (10.78 s) : 0, 10779681
gantt
title petclinic - break down per module: candidate=1.45.0-SNAPSHOT~379790dc37, baseline=1.45.0-SNAPSHOT~721af2f5a5
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (699.762 ms) : 0, 699762
BytebuddyAgent [candidate] (696.545 ms) : 0, 696545
GlobalTracer [baseline] (316.855 ms) : 0, 316855
GlobalTracer [candidate] (318.293 ms) : 0, 318293
AppSec [baseline] (54.756 ms) : 0, 54756
AppSec [candidate] (54.299 ms) : 0, 54299
Remote Config [baseline] (686.822 µs) : 0, 687
Remote Config [candidate] (658.747 µs) : 0, 659
Telemetry [baseline] (11.438 ms) : 0, 11438
Telemetry [candidate] (11.379 ms) : 0, 11379
section appsec
BytebuddyAgent [baseline] (712.293 ms) : 0, 712293
BytebuddyAgent [candidate] (713.71 ms) : 0, 713710
GlobalTracer [baseline] (314.99 ms) : 0, 314990
GlobalTracer [candidate] (315.06 ms) : 0, 315060
AppSec [baseline] (167.221 ms) : 0, 167221
AppSec [candidate] (168.446 ms) : 0, 168446
Remote Config [baseline] (639.987 µs) : 0, 640
Remote Config [candidate] (654.508 µs) : 0, 655
Telemetry [baseline] (8.12 ms) : 0, 8120
Telemetry [candidate] (7.406 ms) : 0, 7406
IAST [baseline] (19.607 ms) : 0, 19607
IAST [candidate] (18.909 ms) : 0, 18909
section iast
BytebuddyAgent [baseline] (812.122 ms) : 0, 812122
BytebuddyAgent [candidate] (816.819 ms) : 0, 816819
GlobalTracer [baseline] (306.369 ms) : 0, 306369
GlobalTracer [candidate] (310.642 ms) : 0, 310642
AppSec [baseline] (57.28 ms) : 0, 57280
AppSec [candidate] (57.508 ms) : 0, 57508
Remote Config [baseline] (626.772 µs) : 0, 627
Remote Config [candidate] (635.331 µs) : 0, 635
Telemetry [baseline] (7.393 ms) : 0, 7393
Telemetry [candidate] (7.508 ms) : 0, 7508
IAST [baseline] (21.996 ms) : 0, 21996
IAST [candidate] (22.113 ms) : 0, 22113
section profiling
BytebuddyAgent [baseline] (689.569 ms) : 0, 689569
BytebuddyAgent [candidate] (689.686 ms) : 0, 689686
GlobalTracer [baseline] (433.224 ms) : 0, 433224
GlobalTracer [candidate] (435.946 ms) : 0, 435946
AppSec [baseline] (53.494 ms) : 0, 53494
AppSec [candidate] (53.804 ms) : 0, 53804
Remote Config [baseline] (670.218 µs) : 0, 670
Remote Config [candidate] (661.668 µs) : 0, 662
Telemetry [baseline] (7.69 ms) : 0, 7690
Telemetry [candidate] (7.736 ms) : 0, 7736
ProfilingAgent [baseline] (93.718 ms) : 0, 93718
ProfilingAgent [candidate] (93.341 ms) : 0, 93341
Profiling [baseline] (93.741 ms) : 0, 93741
Profiling [candidate] (93.365 ms) : 0, 93365
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.45.0-SNAPSHOT~379790dc37, baseline=1.45.0-SNAPSHOT~721af2f5a5
dateFormat X
axisFormat %s
section baseline
no_agent (369.679 µs) : 349, 390
. : milestone, 370,
iast (490.189 µs) : 468, 512
. : milestone, 490,
iast_FULL (653.765 µs) : 632, 675
. : milestone, 654,
iast_GLOBAL (526.207 µs) : 503, 549
. : milestone, 526,
iast_HARDCODED_SECRET_DISABLED (489.731 µs) : 468, 511
. : milestone, 490,
iast_INACTIVE (457.002 µs) : 435, 479
. : milestone, 457,
iast_TELEMETRY_OFF (477.09 µs) : 455, 499
. : milestone, 477,
tracing (449.671 µs) : 429, 470
. : milestone, 450,
section candidate
no_agent (375.418 µs) : 355, 395
. : milestone, 375,
iast (488.169 µs) : 467, 509
. : milestone, 488,
iast_FULL (657.58 µs) : 636, 679
. : milestone, 658,
iast_GLOBAL (520.048 µs) : 498, 542
. : milestone, 520,
iast_HARDCODED_SECRET_DISABLED (495.922 µs) : 474, 517
. : milestone, 496,
iast_INACTIVE (459.069 µs) : 438, 480
. : milestone, 459,
iast_TELEMETRY_OFF (477.281 µs) : 456, 499
. : milestone, 477,
tracing (451.583 µs) : 430, 473
. : milestone, 452,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.45.0-SNAPSHOT~379790dc37, baseline=1.45.0-SNAPSHOT~721af2f5a5
dateFormat X
axisFormat %s
section baseline
no_agent (1.363 ms) : 1343, 1383
. : milestone, 1363,
appsec (1.738 ms) : 1714, 1762
. : milestone, 1738,
appsec_no_iast (1.759 ms) : 1734, 1784
. : milestone, 1759,
iast (1.5 ms) : 1477, 1523
. : milestone, 1500,
profiling (1.54 ms) : 1515, 1565
. : milestone, 1540,
tracing (1.492 ms) : 1467, 1516
. : milestone, 1492,
section candidate
no_agent (1.344 ms) : 1324, 1364
. : milestone, 1344,
appsec (1.748 ms) : 1724, 1772
. : milestone, 1748,
appsec_no_iast (1.698 ms) : 1674, 1722
. : milestone, 1698,
iast (1.499 ms) : 1477, 1521
. : milestone, 1499,
profiling (1.525 ms) : 1503, 1548
. : milestone, 1525,
tracing (1.482 ms) : 1458, 1507
. : milestone, 1482,
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.45.0-SNAPSHOT~379790dc37, baseline=1.45.0-SNAPSHOT~721af2f5a5
dateFormat X
axisFormat %s
section baseline
no_agent (1.469 ms) : 1457, 1480
. : milestone, 1469,
appsec (2.341 ms) : 2300, 2382
. : milestone, 2341,
iast (2.081 ms) : 2028, 2134
. : milestone, 2081,
iast_GLOBAL (2.122 ms) : 2069, 2175
. : milestone, 2122,
profiling (1.969 ms) : 1926, 2013
. : milestone, 1969,
tracing (1.929 ms) : 1889, 1969
. : milestone, 1929,
section candidate
no_agent (1.468 ms) : 1456, 1479
. : milestone, 1468,
appsec (2.334 ms) : 2292, 2375
. : milestone, 2334,
iast (2.079 ms) : 2026, 2131
. : milestone, 2079,
iast_GLOBAL (2.12 ms) : 2067, 2173
. : milestone, 2120,
profiling (1.949 ms) : 1907, 1991
. : milestone, 1949,
tracing (1.92 ms) : 1880, 1960
. : milestone, 1920,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.45.0-SNAPSHOT~379790dc37, baseline=1.45.0-SNAPSHOT~721af2f5a5
dateFormat X
axisFormat %s
section baseline
no_agent (15.615 s) : 15615000, 15615000
. : milestone, 15615000,
appsec (15.08 s) : 15080000, 15080000
. : milestone, 15080000,
iast (18.873 s) : 18873000, 18873000
. : milestone, 18873000,
iast_GLOBAL (17.949 s) : 17949000, 17949000
. : milestone, 17949000,
profiling (15.177 s) : 15177000, 15177000
. : milestone, 15177000,
tracing (15.003 s) : 15003000, 15003000
. : milestone, 15003000,
section candidate
no_agent (15.497 s) : 15497000, 15497000
. : milestone, 15497000,
appsec (15.141 s) : 15141000, 15141000
. : milestone, 15141000,
iast (18.734 s) : 18734000, 18734000
. : milestone, 18734000,
iast_GLOBAL (17.868 s) : 17868000, 17868000
. : milestone, 17868000,
profiling (15.008 s) : 15008000, 15008000
. : milestone, 15008000,
tracing (15.299 s) : 15299000, 15299000
. : milestone, 15299000,
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 2 metrics, 0 unstable metrics.
See unchanged results
|
ef7020c
to
52979d5
Compare
52979d5
to
379790d
Compare
public String get() { | ||
final String contextual = ClassloaderServiceNames.maybeGetForCurrentThread(); | ||
if (contextual != null) { | ||
ServiceNameCollector.get().addService(contextual); |
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.
Not directly related to this PR, but ServiceNameCollector
could be made more performant - right now every call to addService
can result in a new string being allocated because it lower-cases the keys on insert in order to provide a unique collection of service names from getServices
, while retaining the original case.
But ServiceNameCollector.getServices
is only called occasionally from the remote-config thread, while addService
may be called a lot. So it would be better for ServiceNameCollector
to do de-duplication in getServices
and keep addService
as simple and quick as possible, ideally using putIfAbsent
to avoid updating the entry if the key already exists.
If we want to keep the de-duplication on insert then the other option would be to use a ConcurrentSkipListMap
with a String.CASE_INSENSITIVE_ORDER
comparator.
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.
Addressed in #8109
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.
+1 left a comment about improving ServiceNameCollector
performance (can be done in a follow-up PR)
Thanks for having suggested next steps. I'm working at that |
What Does This Do
If a split-by-jee-deployment is used and the legacy tracing is disabled, the service name for the message consumers spans will be initialized once with the first value it's obtained.
This is not correct since in this case it has to be evaluated every time. This PR forces using a supplier for the service name and evaluates it every time when the decorator is setting the service name. In the general case, it will always returns a constant so it should not impact any performance.
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]