-
Notifications
You must be signed in to change notification settings - Fork 283
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
Add limits on dynamic log message #6167
Conversation
Increase the limit on string length in arg template to 8K each for dynamic log only Put a hard limit on evaluated log message size of 8K. Rename LogTemplateBuilder to StringTemplateBuilder
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 53 cases.
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.23.0-SNAPSHOT~b1ee05067d, baseline=1.23.0-SNAPSHOT~0a613832c1
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.035 s) : 0, 1034740
Total [baseline] (9.286 s) : 0, 9285855
Agent [candidate] (1.034 s) : 0, 1034140
Total [candidate] (9.267 s) : 0, 9266573
section appsec
Agent [baseline] (1.119 s) : 0, 1119026
Total [baseline] (9.372 s) : 0, 9372359
Agent [candidate] (1.128 s) : 0, 1127555
Total [candidate] (9.408 s) : 0, 9407602
section iast
Agent [baseline] (1.157 s) : 0, 1156823
Total [baseline] (9.559 s) : 0, 9559087
Agent [candidate] (1.148 s) : 0, 1147944
Total [candidate] (9.574 s) : 0, 9573769
section profiling
Agent [baseline] (1.227 s) : 0, 1226709
Total [baseline] (9.595 s) : 0, 9595325
Agent [candidate] (1.219 s) : 0, 1219333
Total [candidate] (9.527 s) : 0, 9527148
gantt
title petclinic - break down per module: candidate=1.23.0-SNAPSHOT~b1ee05067d, baseline=1.23.0-SNAPSHOT~0a613832c1
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (645.835 ms) : 0, 645835
BytebuddyAgent [candidate] (644.737 ms) : 0, 644737
GlobalTracer [baseline] (293.546 ms) : 0, 293546
GlobalTracer [candidate] (294.037 ms) : 0, 294037
AppSec [baseline] (48.837 ms) : 0, 48837
AppSec [candidate] (48.868 ms) : 0, 48868
Remote Config [baseline] (700.659 µs) : 0, 701
Remote Config [candidate] (694.353 µs) : 0, 694
Telemetry [baseline] (11.34 ms) : 0, 11340
Telemetry [candidate] (11.391 ms) : 0, 11391
section appsec
BytebuddyAgent [baseline] (645.38 ms) : 0, 645380
BytebuddyAgent [candidate] (650.39 ms) : 0, 650390
GlobalTracer [baseline] (293.597 ms) : 0, 293597
GlobalTracer [candidate] (296.374 ms) : 0, 296374
AppSec [baseline] (138.124 ms) : 0, 138124
AppSec [candidate] (138.579 ms) : 0, 138579
Remote Config [baseline] (648.986 µs) : 0, 649
Remote Config [candidate] (655.817 µs) : 0, 656
Telemetry [baseline] (6.861 ms) : 0, 6861
Telemetry [candidate] (6.938 ms) : 0, 6938
section iast
BytebuddyAgent [baseline] (769.464 ms) : 0, 769464
BytebuddyAgent [candidate] (762.659 ms) : 0, 762659
GlobalTracer [baseline] (274.914 ms) : 0, 274914
GlobalTracer [candidate] (273.432 ms) : 0, 273432
AppSec [baseline] (46.93 ms) : 0, 46930
AppSec [candidate] (46.39 ms) : 0, 46390
IAST [baseline] (17.671 ms) : 0, 17671
IAST [candidate] (20.144 ms) : 0, 20144
Remote Config [baseline] (578.427 µs) : 0, 578
Remote Config [candidate] (584.07 µs) : 0, 584
Telemetry [baseline] (12.563 ms) : 0, 12563
Telemetry [candidate] (10.426 ms) : 0, 10426
section profiling
BytebuddyAgent [baseline] (660.275 ms) : 0, 660275
BytebuddyAgent [candidate] (656.436 ms) : 0, 656436
GlobalTracer [baseline] (361.111 ms) : 0, 361111
GlobalTracer [candidate] (358.805 ms) : 0, 358805
AppSec [baseline] (49.513 ms) : 0, 49513
AppSec [candidate] (49.686 ms) : 0, 49686
Remote Config [baseline] (646.542 µs) : 0, 647
Remote Config [candidate] (644.07 µs) : 0, 644
Telemetry [baseline] (11.363 ms) : 0, 11363
Telemetry [candidate] (11.384 ms) : 0, 11384
ProfilingAgent [baseline] (89.14 ms) : 0, 89140
ProfilingAgent [candidate] (88.077 ms) : 0, 88077
Profiling [baseline] (89.164 ms) : 0, 89164
Profiling [candidate] (88.102 ms) : 0, 88102
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.23.0-SNAPSHOT~b1ee05067d, baseline=1.23.0-SNAPSHOT~0a613832c1
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.034 s) : 0, 1033822
Total [baseline] (8.78 s) : 0, 8779899
Agent [candidate] (1.037 s) : 0, 1036868
Total [candidate] (8.802 s) : 0, 8802249
section iast
Agent [baseline] (1.158 s) : 0, 1158233
Total [baseline] (9.337 s) : 0, 9337489
Agent [candidate] (1.153 s) : 0, 1152606
Total [candidate] (9.387 s) : 0, 9387118
section iast_TELEMETRY_OFF
Agent [baseline] (1.152 s) : 0, 1152343
Total [baseline] (9.314 s) : 0, 9313515
Agent [candidate] (1.146 s) : 0, 1145767
Total [candidate] (9.286 s) : 0, 9285789
gantt
title insecure-bank - break down per module: candidate=1.23.0-SNAPSHOT~b1ee05067d, baseline=1.23.0-SNAPSHOT~0a613832c1
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (645.256 ms) : 0, 645256
BytebuddyAgent [candidate] (646.578 ms) : 0, 646578
GlobalTracer [baseline] (293.598 ms) : 0, 293598
GlobalTracer [candidate] (295.028 ms) : 0, 295028
AppSec [baseline] (48.624 ms) : 0, 48624
AppSec [candidate] (48.872 ms) : 0, 48872
Remote Config [baseline] (700.486 µs) : 0, 700
Remote Config [candidate] (702.256 µs) : 0, 702
Telemetry [baseline] (11.298 ms) : 0, 11298
Telemetry [candidate] (11.183 ms) : 0, 11183
section iast
BytebuddyAgent [baseline] (770.883 ms) : 0, 770883
BytebuddyAgent [candidate] (766.556 ms) : 0, 766556
GlobalTracer [baseline] (275.604 ms) : 0, 275604
GlobalTracer [candidate] (275.119 ms) : 0, 275119
AppSec [baseline] (46.982 ms) : 0, 46982
AppSec [candidate] (46.934 ms) : 0, 46934
IAST [baseline] (16.199 ms) : 0, 16199
IAST [candidate] (16.911 ms) : 0, 16911
Remote Config [baseline] (568.656 µs) : 0, 569
Remote Config [candidate] (570.248 µs) : 0, 570
Telemetry [baseline] (13.326 ms) : 0, 13326
Telemetry [candidate] (11.909 ms) : 0, 11909
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (763.956 ms) : 0, 763956
BytebuddyAgent [candidate] (759.13 ms) : 0, 759130
GlobalTracer [baseline] (275.526 ms) : 0, 275526
GlobalTracer [candidate] (274.952 ms) : 0, 274952
AppSec [baseline] (46.785 ms) : 0, 46785
AppSec [candidate] (46.617 ms) : 0, 46617
IAST [baseline] (18.858 ms) : 0, 18858
IAST [candidate] (15.412 ms) : 0, 15412
Remote Config [baseline] (577.313 µs) : 0, 577
Remote Config [candidate] (560.017 µs) : 0, 560
Telemetry [baseline] (11.967 ms) : 0, 11967
Telemetry [candidate] (14.63 ms) : 0, 14630
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 22 cases. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.23.0-SNAPSHOT~b1ee05067d, baseline=1.23.0-SNAPSHOT~0a613832c1
dateFormat X
axisFormat %s
section baseline
no_agent (1.326 ms) : 1307, 1345
. : milestone, 1326,
appsec (1.703 ms) : 1679, 1728
. : milestone, 1703,
iast (1.48 ms) : 1457, 1504
. : milestone, 1480,
profiling (1.452 ms) : 1427, 1478
. : milestone, 1452,
tracing (1.472 ms) : 1446, 1497
. : milestone, 1472,
section candidate
no_agent (1.331 ms) : 1311, 1350
. : milestone, 1331,
appsec (1.701 ms) : 1676, 1725
. : milestone, 1701,
iast (1.475 ms) : 1450, 1499
. : milestone, 1475,
profiling (1.447 ms) : 1422, 1472
. : milestone, 1447,
tracing (1.472 ms) : 1447, 1496
. : milestone, 1472,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.23.0-SNAPSHOT~b1ee05067d, baseline=1.23.0-SNAPSHOT~0a613832c1
dateFormat X
axisFormat %s
section baseline
no_agent (364.472 µs) : 343, 386
. : milestone, 364,
iast (458.965 µs) : 438, 480
. : milestone, 459,
iast_FULL (519.99 µs) : 499, 541
. : milestone, 520,
iast_INACTIVE (426.276 µs) : 406, 447
. : milestone, 426,
iast_TELEMETRY_OFF (461.417 µs) : 440, 483
. : milestone, 461,
tracing (437.721 µs) : 416, 460
. : milestone, 438,
section candidate
no_agent (356.706 µs) : 336, 377
. : milestone, 357,
iast (452.549 µs) : 432, 473
. : milestone, 453,
iast_FULL (522.287 µs) : 502, 543
. : milestone, 522,
iast_INACTIVE (433.439 µs) : 413, 454
. : milestone, 433,
iast_TELEMETRY_OFF (450.318 µs) : 429, 472
. : milestone, 450,
tracing (436.622 µs) : 415, 458
. : milestone, 437,
|
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.
nice one
StringTemplateBuilder logMessageBuilder = new StringTemplateBuilder(segments, LIMITS); | ||
String msg = logMessageBuilder.evaluate(context, logStatus); | ||
if (msg != null && msg.length() > LOG_MSG_LIMIT) { | ||
StringBuilder sb = new StringBuilder(LOG_MSG_LIMIT + 3); |
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.
wonder if we should copy LOG_MSG_LIMIT - 3 to keep the log message to be under LOG_MSG_LIMIT.
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.
8K is arbitrary there is nothing that prevent us to add those 3 more.
this way we have 8K effective
@@ -37,6 +37,8 @@ public class LogProbesInstrumentationTest { | |||
private static final ProbeId LOG_ID1 = new ProbeId("beae1807-f3b0-4ea8-a74f-826790c5e6f8", 0); | |||
private static final ProbeId LOG_ID2 = new ProbeId("beae1807-f3b0-4ea8-a74f-826790c5e6f9", 0); | |||
private static final String SERVICE_NAME = "service-name"; | |||
private static final String STR_8K = | |||
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; |
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.
🤣
What Does This Do
Increase the limit on string length in arg template to 8K each for dynamic log only
Put a hard limit on evaluated log message size of 8K. Rename LogTemplateBuilder to StringTemplateBuilder
Motivation
Allow larger string argument for dynamic log message but with a max to 8K to not breach the 1MB limit for snapshot
Additional Notes
Jira ticket: DEBUG-1917