Skip to content

Conversation

@mcculls
Copy link
Contributor

@mcculls mcculls commented Jun 16, 2024

Motivation

This avoids a ClassNotFoundException when shutting down native images - the native-image won't contain the LogsIntakeSystem class because it wasn't started when the native-image was built, therefore we should avoid trying to shut it down unconditionally.

@mcculls mcculls added the tag: no release notes Changes to exclude from release notes label Jun 16, 2024
@mcculls mcculls requested a review from a team as a code owner June 16, 2024 18:16
@mcculls mcculls requested review from am312 and dougqh June 16, 2024 18:16
@mcculls mcculls added the type: bug Bug report and fix label Jun 16, 2024
@mcculls mcculls force-pushed the mcculls/avoid-logs-intake-exception-on-shutdown branch from 4513b83 to 4679a64 Compare June 16, 2024 18:38
…ntake at startup.

This avoids a ClassNotFoundException when shutting down native images - the native-image won't
contain the LogsIntakeSystem class because it wasn't started when the native-image was built,
therefore we should avoid trying to shut it down unconditionally.
@mcculls mcculls force-pushed the mcculls/avoid-logs-intake-exception-on-shutdown branch from 4679a64 to 91c3601 Compare June 16, 2024 18:44
@mcculls mcculls changed the title Only call shutdownLogsIntake at shutdown if we previously called maybeStartLogsIntake at startup Only call shutdownLogsIntake at shutdown if we called maybeStartLogsIntake at startup Jun 16, 2024
@pr-commenter
Copy link

pr-commenter bot commented Jun 16, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/avoid-logs-intake-exception-on-shutdown
git_commit_date 1718392893 1718563487
git_commit_sha ecd93fb 91c3601
release_version 1.36.0-SNAPSHOT~ecd93fb8b3 1.36.0-SNAPSHOT~91c36014b8
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1718567167 1718567167
ci_job_id 544626139 544626139
ci_pipeline_id 36863740 36863740
cpu_model Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 52 metrics, 11 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.36.0-SNAPSHOT~91c36014b8, baseline=1.36.0-SNAPSHOT~ecd93fb8b3

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.578 s) : 0, 1577931
Total [baseline] (11.922 s) : 0, 11921798
Agent [candidate] (1.579 s) : 0, 1579433
Total [candidate] (11.942 s) : 0, 11942206
section iast
Agent [baseline] (1.708 s) : 0, 1708326
Total [baseline] (12.551 s) : 0, 12550975
Agent [candidate] (1.712 s) : 0, 1712101
Total [candidate] (12.546 s) : 0, 12546311
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.717 s) : 0, 1716607
Total [baseline] (12.525 s) : 0, 12525411
Agent [candidate] (1.711 s) : 0, 1711181
Total [candidate] (12.522 s) : 0, 12521866
section iast_TELEMETRY_OFF
Agent [baseline] (1.704 s) : 0, 1703719
Total [baseline] (12.581 s) : 0, 12581119
Agent [candidate] (1.705 s) : 0, 1704638
Total [candidate] (12.545 s) : 0, 12544996
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.578 s -
Agent iast 1.708 s 130.395 ms (8.3%)
Agent iast_HARDCODED_SECRET_DISABLED 1.717 s 138.676 ms (8.8%)
Agent iast_TELEMETRY_OFF 1.704 s 125.788 ms (8.0%)
Total tracing 11.922 s -
Total iast 12.551 s 629.177 ms (5.3%)
Total iast_HARDCODED_SECRET_DISABLED 12.525 s 603.613 ms (5.1%)
Total iast_TELEMETRY_OFF 12.581 s 659.321 ms (5.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.579 s -
Agent iast 1.712 s 132.668 ms (8.4%)
Agent iast_HARDCODED_SECRET_DISABLED 1.711 s 131.747 ms (8.3%)
Agent iast_TELEMETRY_OFF 1.705 s 125.204 ms (7.9%)
Total tracing 11.942 s -
Total iast 12.546 s 604.105 ms (5.1%)
Total iast_HARDCODED_SECRET_DISABLED 12.522 s 579.66 ms (4.9%)
Total iast_TELEMETRY_OFF 12.545 s 602.79 ms (5.0%)
gantt
    title insecure-bank - break down per module: candidate=1.36.0-SNAPSHOT~91c36014b8, baseline=1.36.0-SNAPSHOT~ecd93fb8b3

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (986.092 ms) : 0, 986092
BytebuddyAgent [candidate] (987.164 ms) : 0, 987164
GlobalTracer [baseline] (449.233 ms) : 0, 449233
GlobalTracer [candidate] (449.976 ms) : 0, 449976
AppSec [baseline] (71.073 ms) : 0, 71073
AppSec [candidate] (71.06 ms) : 0, 71060
Remote Config [baseline] (859.999 µs) : 0, 860
Remote Config [candidate] (946.797 µs) : 0, 947
Telemetry [baseline] (9.689 ms) : 0, 9689
Telemetry [candidate] (9.728 ms) : 0, 9728
Logs Intake [baseline] (505.069 µs) : 0, 505
section iast
BytebuddyAgent [baseline] (1.15 s) : 0, 1149885
BytebuddyAgent [candidate] (1.149 s) : 0, 1149408
GlobalTracer [baseline] (431.445 ms) : 0, 431445
GlobalTracer [candidate] (432.25 ms) : 0, 432250
AppSec [baseline] (67.086 ms) : 0, 67086
AppSec [candidate] (67.236 ms) : 0, 67236
IAST [baseline] (29.701 ms) : 0, 29701
IAST [candidate] (33.321 ms) : 0, 33321
Remote Config [baseline] (777.705 µs) : 0, 778
Remote Config [candidate] (856.712 µs) : 0, 857
Telemetry [baseline] (9.202 ms) : 0, 9202
Telemetry [candidate] (9.182 ms) : 0, 9182
Logs Intake [baseline] (390.893 µs) : 0, 391
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (1.151 s) : 0, 1151287
BytebuddyAgent [candidate] (1.147 s) : 0, 1147189
GlobalTracer [baseline] (434.015 ms) : 0, 434015
GlobalTracer [candidate] (432.517 ms) : 0, 432517
AppSec [baseline] (67.166 ms) : 0, 67166
AppSec [candidate] (67.374 ms) : 0, 67374
IAST [baseline] (30.562 ms) : 0, 30562
IAST [candidate] (32.549 ms) : 0, 32549
Remote Config [baseline] (3.194 ms) : 0, 3194
Remote Config [candidate] (777.204 µs) : 0, 777
Telemetry [baseline] (9.994 ms) : 0, 9994
Telemetry [candidate] (10.804 ms) : 0, 10804
Logs Intake [baseline] (383.723 µs) : 0, 384
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (1.141 s) : 0, 1141103
BytebuddyAgent [candidate] (1.142 s) : 0, 1141578
GlobalTracer [baseline] (430.868 ms) : 0, 430868
GlobalTracer [candidate] (431.517 ms) : 0, 431517
AppSec [baseline] (66.766 ms) : 0, 66766
AppSec [candidate] (66.938 ms) : 0, 66938
IAST [baseline] (35.143 ms) : 0, 35143
IAST [candidate] (34.998 ms) : 0, 34998
Remote Config [baseline] (732.478 µs) : 0, 732
Remote Config [candidate] (760.548 µs) : 0, 761
Telemetry [baseline] (8.864 ms) : 0, 8864
Telemetry [candidate] (8.845 ms) : 0, 8845
Logs Intake [baseline] (394.544 µs) : 0, 395
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.36.0-SNAPSHOT~91c36014b8, baseline=1.36.0-SNAPSHOT~ecd93fb8b3

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.58 s) : 0, 1580122
Total [baseline] (14.446 s) : 0, 14445647
Agent [candidate] (1.586 s) : 0, 1585604
Total [candidate] (14.369 s) : 0, 14368570
section appsec
Agent [baseline] (1.757 s) : 0, 1757464
Total [baseline] (14.495 s) : 0, 14495433
Agent [candidate] (1.76 s) : 0, 1760201
Total [candidate] (14.376 s) : 0, 14375736
section iast
Agent [baseline] (1.704 s) : 0, 1704392
Total [baseline] (14.697 s) : 0, 14696967
Agent [candidate] (1.703 s) : 0, 1703103
Total [candidate] (14.676 s) : 0, 14676443
section profiling
Agent [baseline] (1.888 s) : 0, 1887836
Total [baseline] (14.667 s) : 0, 14666739
Agent [candidate] (1.894 s) : 0, 1893742
Total [candidate] (14.654 s) : 0, 14654092
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.58 s -
Agent appsec 1.757 s 177.342 ms (11.2%)
Agent iast 1.704 s 124.269 ms (7.9%)
Agent profiling 1.888 s 307.714 ms (19.5%)
Total tracing 14.446 s -
Total appsec 14.495 s 49.785 ms (0.3%)
Total iast 14.697 s 251.32 ms (1.7%)
Total profiling 14.667 s 221.092 ms (1.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.586 s -
Agent appsec 1.76 s 174.598 ms (11.0%)
Agent iast 1.703 s 117.5 ms (7.4%)
Agent profiling 1.894 s 308.138 ms (19.4%)
Total tracing 14.369 s -
Total appsec 14.376 s 7.165 ms (0.0%)
Total iast 14.676 s 307.872 ms (2.1%)
Total profiling 14.654 s 285.522 ms (2.0%)
gantt
    title petclinic - break down per module: candidate=1.36.0-SNAPSHOT~91c36014b8, baseline=1.36.0-SNAPSHOT~ecd93fb8b3

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (987.913 ms) : 0, 987913
BytebuddyAgent [candidate] (991.209 ms) : 0, 991209
GlobalTracer [baseline] (449.342 ms) : 0, 449342
GlobalTracer [candidate] (451.437 ms) : 0, 451437
AppSec [baseline] (71.342 ms) : 0, 71342
AppSec [candidate] (71.482 ms) : 0, 71482
Remote Config [baseline] (856.552 µs) : 0, 857
Remote Config [candidate] (949.897 µs) : 0, 950
Telemetry [baseline] (9.674 ms) : 0, 9674
Telemetry [candidate] (9.819 ms) : 0, 9819
Logs Intake [baseline] (506.967 µs) : 0, 507
section appsec
BytebuddyAgent [baseline] (1.001 s) : 0, 1001479
BytebuddyAgent [candidate] (1.003 s) : 0, 1002907
GlobalTracer [baseline] (441.007 ms) : 0, 441007
GlobalTracer [candidate] (441.194 ms) : 0, 441194
AppSec [baseline] (232.043 ms) : 0, 232043
AppSec [candidate] (232.489 ms) : 0, 232489
IAST [baseline] (24.811 ms) : 0, 24811
IAST [candidate] (23.938 ms) : 0, 23938
Remote Config [baseline] (776.774 µs) : 0, 777
Remote Config [candidate] (792.343 µs) : 0, 792
Telemetry [baseline] (8.888 ms) : 0, 8888
Telemetry [candidate] (10.191 ms) : 0, 10191
Logs Intake [baseline] (419.312 µs) : 0, 419
section iast
BytebuddyAgent [baseline] (1.145 s) : 0, 1144618
BytebuddyAgent [candidate] (1.144 s) : 0, 1144139
GlobalTracer [baseline] (430.32 ms) : 0, 430320
GlobalTracer [candidate] (430.428 ms) : 0, 430428
AppSec [baseline] (67.104 ms) : 0, 67104
AppSec [candidate] (67.125 ms) : 0, 67125
IAST [baseline] (29.941 ms) : 0, 29941
IAST [candidate] (30.76 ms) : 0, 30760
Remote Config [baseline] (2.348 ms) : 0, 2348
Remote Config [candidate] (1.617 ms) : 0, 1617
Telemetry [baseline] (9.249 ms) : 0, 9249
Telemetry [candidate] (9.287 ms) : 0, 9287
Logs Intake [baseline] (1.128 ms) : 0, 1128
section profiling
BytebuddyAgent [baseline] (983.887 ms) : 0, 983887
BytebuddyAgent [candidate] (983.093 ms) : 0, 983093
GlobalTracer [baseline] (579.055 ms) : 0, 579055
GlobalTracer [candidate] (579.296 ms) : 0, 579296
AppSec [baseline] (72.525 ms) : 0, 72525
AppSec [candidate] (72.721 ms) : 0, 72721
Remote Config [baseline] (947.664 µs) : 0, 948
Remote Config [candidate] (966.593 µs) : 0, 967
Telemetry [baseline] (9.415 ms) : 0, 9415
Telemetry [candidate] (9.314 ms) : 0, 9314
Logs Intake [baseline] (428.137 µs) : 0, 428
ProfilingAgent [baseline] (147.231 ms) : 0, 147231
ProfilingAgent [candidate] (153.867 ms) : 0, 153867
Profiling [baseline] (147.284 ms) : 0, 147284
Profiling [candidate] (153.932 ms) : 0, 153932
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-06-16T19:01:25 2024-06-16T19:08:14
git_branch master mcculls/avoid-logs-intake-exception-on-shutdown
git_commit_date 1718392893 1718563487
git_commit_sha ecd93fb 91c3601
release_version 1.36.0-SNAPSHOT~ecd93fb8b3 1.36.0-SNAPSHOT~91c36014b8
start_time 2024-06-16T19:01:12 2024-06-16T19:08:01
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1718565239 1718565239
ci_job_id 544626140 544626140
ci_pipeline_id 36863740 36863740
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics.

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~91c36014b8, baseline=1.36.0-SNAPSHOT~ecd93fb8b3
    dateFormat X
    axisFormat %s
section baseline
no_agent (364.876 µs) : 345, 384
.   : milestone, 365,
iast (481.059 µs) : 460, 502
.   : milestone, 481,
iast_FULL (548.94 µs) : 528, 570
.   : milestone, 549,
iast_GLOBAL (508.681 µs) : 486, 531
.   : milestone, 509,
iast_HARDCODED_SECRET_DISABLED (485.372 µs) : 464, 507
.   : milestone, 485,
iast_INACTIVE (456.084 µs) : 434, 478
.   : milestone, 456,
iast_TELEMETRY_OFF (466.091 µs) : 445, 487
.   : milestone, 466,
tracing (439.321 µs) : 418, 460
.   : milestone, 439,
section candidate
no_agent (366.95 µs) : 347, 387
.   : milestone, 367,
iast (478.863 µs) : 457, 500
.   : milestone, 479,
iast_FULL (544.144 µs) : 523, 565
.   : milestone, 544,
iast_GLOBAL (499.455 µs) : 478, 520
.   : milestone, 499,
iast_HARDCODED_SECRET_DISABLED (476.001 µs) : 455, 497
.   : milestone, 476,
iast_INACTIVE (450.019 µs) : 429, 471
.   : milestone, 450,
iast_TELEMETRY_OFF (472.478 µs) : 452, 493
.   : milestone, 472,
tracing (443.758 µs) : 422, 465
.   : milestone, 444,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 364.876 µs [345.431 µs, 384.321 µs] -
iast 481.059 µs [460.16 µs, 501.959 µs] 116.184 µs (31.8%)
iast_FULL 548.94 µs [527.666 µs, 570.214 µs] 184.064 µs (50.4%)
iast_GLOBAL 508.681 µs [486.214 µs, 531.148 µs] 143.805 µs (39.4%)
iast_HARDCODED_SECRET_DISABLED 485.372 µs [464.196 µs, 506.548 µs] 120.496 µs (33.0%)
iast_INACTIVE 456.084 µs [434.204 µs, 477.964 µs] 91.208 µs (25.0%)
iast_TELEMETRY_OFF 466.091 µs [445.197 µs, 486.986 µs] 101.216 µs (27.7%)
tracing 439.321 µs [418.436 µs, 460.207 µs] 74.445 µs (20.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 366.95 µs [347.36 µs, 386.539 µs] -
iast 478.863 µs [457.476 µs, 500.25 µs] 111.913 µs (30.5%)
iast_FULL 544.144 µs [523.075 µs, 565.214 µs] 177.195 µs (48.3%)
iast_GLOBAL 499.455 µs [478.447 µs, 520.463 µs] 132.505 µs (36.1%)
iast_HARDCODED_SECRET_DISABLED 476.001 µs [455.084 µs, 496.918 µs] 109.051 µs (29.7%)
iast_INACTIVE 450.019 µs [428.545 µs, 471.492 µs] 83.069 µs (22.6%)
iast_TELEMETRY_OFF 472.478 µs [451.61 µs, 493.345 µs] 105.528 µs (28.8%)
tracing 443.758 µs [422.442 µs, 465.074 µs] 76.808 µs (20.9%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.36.0-SNAPSHOT~91c36014b8, baseline=1.36.0-SNAPSHOT~ecd93fb8b3
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.351 ms) : 1332, 1370
.   : milestone, 1351,
appsec (1.698 ms) : 1674, 1722
.   : milestone, 1698,
appsec_no_iast (1.723 ms) : 1697, 1748
.   : milestone, 1723,
iast (1.479 ms) : 1455, 1502
.   : milestone, 1479,
profiling (1.496 ms) : 1471, 1520
.   : milestone, 1496,
tracing (1.479 ms) : 1453, 1505
.   : milestone, 1479,
section candidate
no_agent (1.359 ms) : 1339, 1379
.   : milestone, 1359,
appsec (1.722 ms) : 1698, 1746
.   : milestone, 1722,
appsec_no_iast (1.74 ms) : 1716, 1765
.   : milestone, 1740,
iast (1.48 ms) : 1458, 1502
.   : milestone, 1480,
profiling (1.49 ms) : 1466, 1514
.   : milestone, 1490,
tracing (1.474 ms) : 1451, 1497
.   : milestone, 1474,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.351 ms [1.332 ms, 1.37 ms] -
appsec 1.698 ms [1.674 ms, 1.722 ms] 346.705 µs (25.7%)
appsec_no_iast 1.723 ms [1.697 ms, 1.748 ms] 371.814 µs (27.5%)
iast 1.479 ms [1.455 ms, 1.502 ms] 127.638 µs (9.4%)
profiling 1.496 ms [1.471 ms, 1.52 ms] 144.663 µs (10.7%)
tracing 1.479 ms [1.453 ms, 1.505 ms] 128.182 µs (9.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.359 ms [1.339 ms, 1.379 ms] -
appsec 1.722 ms [1.698 ms, 1.746 ms] 363.308 µs (26.7%)
appsec_no_iast 1.74 ms [1.716 ms, 1.765 ms] 381.537 µs (28.1%)
iast 1.48 ms [1.458 ms, 1.502 ms] 121.066 µs (8.9%)
profiling 1.49 ms [1.466 ms, 1.514 ms] 131.481 µs (9.7%)
tracing 1.474 ms [1.451 ms, 1.497 ms] 115.309 µs (8.5%)

Dacapo

@mcculls mcculls added the comp: core Tracer core label Jun 16, 2024
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcculls mcculls merged commit e375af2 into master Jun 17, 2024
@mcculls mcculls deleted the mcculls/avoid-logs-intake-exception-on-shutdown branch June 17, 2024 09:33
@github-actions github-actions bot added this to the 1.35.1 milestone Jun 17, 2024
@PerfectSlayer PerfectSlayer modified the milestones: 1.35.1, 1.36.0 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: no release notes Changes to exclude from release notes type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants