Skip to content

Add peer tags, span kind and trace root flag to MetricKey bucket #9178

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bric3
Copy link
Contributor

@bric3 bric3 commented Jul 15, 2025

What Does This Do

This fills the gap regarding peer tags, by declaring the in the MetricKey.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@bric3 bric3 requested a review from amarziali July 15, 2025 17:07
@pr-commenter
Copy link

pr-commenter bot commented Jul 15, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bdu/add-missing-attributes-in-metrics-key
git_commit_date 1752761628 1752763867
git_commit_sha d1794c1 2d089ec
release_version 1.52.0-SNAPSHOT~d1794c17af 1.52.0-SNAPSHOT~2d089ec9d1
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752765561 1752765561
ci_job_id 1034137492 1034137492
ci_pipeline_id 70871046 70871046
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-gia59amx 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-gia59amx 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

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

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.52.0-SNAPSHOT~2d089ec9d1, baseline=1.52.0-SNAPSHOT~d1794c17af

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.045 s) : 0, 1045271
Total [baseline] (8.608 s) : 0, 8607796
Agent [candidate] (1.048 s) : 0, 1047865
Total [candidate] (8.602 s) : 0, 8601958
section iast
Agent [baseline] (1.173 s) : 0, 1172963
Total [baseline] (9.26 s) : 0, 9260025
Agent [candidate] (1.173 s) : 0, 1172639
Total [candidate] (9.271 s) : 0, 9271492
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.045 s -
Agent iast 1.173 s 127.692 ms (12.2%)
Total tracing 8.608 s -
Total iast 9.26 s 652.229 ms (7.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent iast 1.173 s 124.774 ms (11.9%)
Total tracing 8.602 s -
Total iast 9.271 s 669.534 ms (7.8%)
gantt
    title insecure-bank - break down per module: candidate=1.52.0-SNAPSHOT~2d089ec9d1, baseline=1.52.0-SNAPSHOT~d1794c17af

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.445 ms) : 0, 1445
crashtracking [candidate] (1.45 ms) : 0, 1450
BytebuddyAgent [baseline] (734.65 ms) : 0, 734650
BytebuddyAgent [candidate] (735.916 ms) : 0, 735916
GlobalTracer [baseline] (242.564 ms) : 0, 242564
GlobalTracer [candidate] (242.925 ms) : 0, 242925
AppSec [baseline] (30.656 ms) : 0, 30656
AppSec [candidate] (30.802 ms) : 0, 30802
Debugger [baseline] (6.037 ms) : 0, 6037
Debugger [candidate] (6.061 ms) : 0, 6061
Remote Config [baseline] (663.607 µs) : 0, 664
Remote Config [candidate] (658.535 µs) : 0, 659
Telemetry [baseline] (8.253 ms) : 0, 8253
Telemetry [candidate] (9.019 ms) : 0, 9019
section iast
crashtracking [baseline] (1.428 ms) : 0, 1428
crashtracking [candidate] (1.434 ms) : 0, 1434
BytebuddyAgent [baseline] (847.67 ms) : 0, 847670
BytebuddyAgent [candidate] (846.992 ms) : 0, 846992
GlobalTracer [baseline] (230.979 ms) : 0, 230979
GlobalTracer [candidate] (231.129 ms) : 0, 231129
AppSec [baseline] (26.446 ms) : 0, 26446
AppSec [candidate] (27.335 ms) : 0, 27335
Debugger [baseline] (6.629 ms) : 0, 6629
Debugger [candidate] (6.61 ms) : 0, 6610
Remote Config [baseline] (590.304 µs) : 0, 590
Remote Config [candidate] (577.533 µs) : 0, 578
Telemetry [baseline] (7.915 ms) : 0, 7915
Telemetry [candidate] (7.879 ms) : 0, 7879
IAST [baseline] (30.534 ms) : 0, 30534
IAST [candidate] (29.946 ms) : 0, 29946
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.52.0-SNAPSHOT~2d089ec9d1, baseline=1.52.0-SNAPSHOT~d1794c17af

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.046 s) : 0, 1045516
Total [baseline] (10.636 s) : 0, 10635922
Agent [candidate] (1.044 s) : 0, 1044068
Total [candidate] (10.7 s) : 0, 10700340
section appsec
Agent [baseline] (1.22 s) : 0, 1220054
Total [baseline] (10.778 s) : 0, 10778068
Agent [candidate] (1.217 s) : 0, 1216839
Total [candidate] (10.731 s) : 0, 10730796
section iast
Agent [baseline] (1.181 s) : 0, 1180948
Total [baseline] (10.912 s) : 0, 10912156
Agent [candidate] (1.169 s) : 0, 1169476
Total [candidate] (10.884 s) : 0, 10884291
section profiling
Agent [baseline] (1.188 s) : 0, 1188142
Total [baseline] (10.901 s) : 0, 10900896
Agent [candidate] (1.183 s) : 0, 1182531
Total [candidate] (10.832 s) : 0, 10831588
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.046 s -
Agent appsec 1.22 s 174.537 ms (16.7%)
Agent iast 1.181 s 135.431 ms (13.0%)
Agent profiling 1.188 s 142.625 ms (13.6%)
Total tracing 10.636 s -
Total appsec 10.778 s 142.146 ms (1.3%)
Total iast 10.912 s 276.235 ms (2.6%)
Total profiling 10.901 s 264.975 ms (2.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.044 s -
Agent appsec 1.217 s 172.771 ms (16.5%)
Agent iast 1.169 s 125.408 ms (12.0%)
Agent profiling 1.183 s 138.463 ms (13.3%)
Total tracing 10.7 s -
Total appsec 10.731 s 30.456 ms (0.3%)
Total iast 10.884 s 183.951 ms (1.7%)
Total profiling 10.832 s 131.248 ms (1.2%)
gantt
    title petclinic - break down per module: candidate=1.52.0-SNAPSHOT~2d089ec9d1, baseline=1.52.0-SNAPSHOT~d1794c17af

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.444 ms) : 0, 1444
crashtracking [candidate] (1.443 ms) : 0, 1443
BytebuddyAgent [baseline] (733.676 ms) : 0, 733676
BytebuddyAgent [candidate] (733.868 ms) : 0, 733868
GlobalTracer [baseline] (243.412 ms) : 0, 243412
GlobalTracer [candidate] (242.141 ms) : 0, 242141
AppSec [baseline] (30.857 ms) : 0, 30857
AppSec [candidate] (30.596 ms) : 0, 30596
Debugger [baseline] (6.074 ms) : 0, 6074
Debugger [candidate] (6.046 ms) : 0, 6046
Remote Config [baseline] (664.27 µs) : 0, 664
Remote Config [candidate] (652.84 µs) : 0, 653
Telemetry [baseline] (8.287 ms) : 0, 8287
Telemetry [candidate] (8.237 ms) : 0, 8237
section appsec
crashtracking [baseline] (1.444 ms) : 0, 1444
crashtracking [candidate] (1.425 ms) : 0, 1425
BytebuddyAgent [baseline] (753.78 ms) : 0, 753780
BytebuddyAgent [candidate] (751.208 ms) : 0, 751208
GlobalTracer [baseline] (234.952 ms) : 0, 234952
GlobalTracer [candidate] (233.968 ms) : 0, 233968
IAST [baseline] (23.652 ms) : 0, 23652
IAST [candidate] (23.472 ms) : 0, 23472
AppSec [baseline] (168.232 ms) : 0, 168232
AppSec [candidate] (168.147 ms) : 0, 168147
Debugger [baseline] (7.168 ms) : 0, 7168
Debugger [candidate] (8.638 ms) : 0, 8638
Remote Config [baseline] (610.703 µs) : 0, 611
Remote Config [candidate] (596.103 µs) : 0, 596
Telemetry [baseline] (8.956 ms) : 0, 8956
Telemetry [candidate] (8.096 ms) : 0, 8096
section iast
crashtracking [baseline] (1.444 ms) : 0, 1444
crashtracking [candidate] (1.437 ms) : 0, 1437
BytebuddyAgent [baseline] (853.448 ms) : 0, 853448
BytebuddyAgent [candidate] (844.369 ms) : 0, 844369
GlobalTracer [baseline] (232.22 ms) : 0, 232220
GlobalTracer [candidate] (230.609 ms) : 0, 230609
IAST [baseline] (29.148 ms) : 0, 29148
IAST [candidate] (28.985 ms) : 0, 28985
AppSec [baseline] (25.972 ms) : 0, 25972
AppSec [candidate] (27.128 ms) : 0, 27128
Debugger [baseline] (9.228 ms) : 0, 9228
Debugger [candidate] (7.511 ms) : 0, 7511
Remote Config [baseline] (610.606 µs) : 0, 611
Remote Config [candidate] (584.225 µs) : 0, 584
Telemetry [baseline] (7.926 ms) : 0, 7926
Telemetry [candidate] (7.939 ms) : 0, 7939
section profiling
crashtracking [baseline] (1.403 ms) : 0, 1403
crashtracking [candidate] (1.397 ms) : 0, 1397
BytebuddyAgent [baseline] (762.28 ms) : 0, 762280
BytebuddyAgent [candidate] (757.887 ms) : 0, 757887
GlobalTracer [baseline] (220.822 ms) : 0, 220822
GlobalTracer [candidate] (219.867 ms) : 0, 219867
AppSec [baseline] (30.543 ms) : 0, 30543
AppSec [candidate] (30.282 ms) : 0, 30282
Debugger [baseline] (6.298 ms) : 0, 6298
Debugger [candidate] (6.262 ms) : 0, 6262
Remote Config [baseline] (666.734 µs) : 0, 667
Remote Config [candidate] (681.485 µs) : 0, 681
Telemetry [baseline] (13.231 ms) : 0, 13231
Telemetry [candidate] (12.491 ms) : 0, 12491
ProfilingAgent [baseline] (104.26 ms) : 0, 104260
ProfilingAgent [candidate] (105.365 ms) : 0, 105365
Profiling [baseline] (104.282 ms) : 0, 104282
Profiling [candidate] (105.387 ms) : 0, 105387
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bdu/add-missing-attributes-in-metrics-key
git_commit_date 1752761628 1752763867
git_commit_sha d1794c1 2d089ec
release_version 1.52.0-SNAPSHOT~d1794c17af 1.52.0-SNAPSHOT~2d089ec9d1
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752765249 1752765249
ci_job_id 1034137493 1034137493
ci_pipeline_id 70871046 70871046
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-nqfsagg9 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-nqfsagg9 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 3 performance improvements and 2 performance regressions! Performance is the same for 7 metrics, 12 unstable metrics.

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:insecure-bank:no_agent:high_load better
[-267.950µs; -148.695µs] or [-5.944%; -3.298%]
unstable
[-83.738op/s; +180.676op/s] or [-8.223%; +17.741%]
4.300ms 1066.875op/s 4.508ms 1018.406op/s
scenario:load:insecure-bank:tracing:high_load worse
[+231.354µs; +462.073µs] or [+3.178%; +6.347%]
unstable
[-112.834op/s; +55.834op/s] or [-17.754%; +8.785%]
7.627ms 607.031op/s 7.280ms 635.531op/s
scenario:load:insecure-bank:profiling:high_load worse
[+289.510µs; +587.837µs] or [+3.442%; +6.990%]
unstable
[-103.203op/s; +48.640op/s] or [-18.718%; +8.822%]
8.849ms 524.062op/s 8.410ms 551.344op/s
scenario:load:petclinic:profiling:high_load better
[-2.979ms; -2.010ms] or [-5.994%; -4.046%]
unstable
[-2.478op/s; +12.453op/s] or [-2.631%; +13.223%]
47.200ms 99.162op/s 49.695ms 94.175op/s
scenario:load:petclinic:tracing:high_load better
[-3.007ms; -2.199ms] or [-6.544%; -4.786%]
unstable
[-1.592op/s; +13.792op/s] or [-1.563%; +13.546%]
43.344ms 107.912op/s 45.946ms 101.812op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~2d089ec9d1, baseline=1.52.0-SNAPSHOT~d1794c17af
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.508 ms) : 4450, 4566
.   : milestone, 4508,
iast (9.219 ms) : 9063, 9375
.   : milestone, 9219,
iast_FULL (13.638 ms) : 13365, 13911
.   : milestone, 13638,
iast_GLOBAL (10.465 ms) : 10282, 10648
.   : milestone, 10465,
profiling (8.41 ms) : 8279, 8541
.   : milestone, 8410,
tracing (7.28 ms) : 7172, 7388
.   : milestone, 7280,
section candidate
no_agent (4.3 ms) : 4247, 4352
.   : milestone, 4300,
iast (9.174 ms) : 9017, 9331
.   : milestone, 9174,
iast_FULL (14.148 ms) : 13866, 14429
.   : milestone, 14148,
iast_GLOBAL (10.095 ms) : 9919, 10271
.   : milestone, 10095,
profiling (8.849 ms) : 8703, 8995
.   : milestone, 8849,
tracing (7.627 ms) : 7521, 7733
.   : milestone, 7627,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.508 ms [4.45 ms, 4.566 ms] -
iast 9.219 ms [9.063 ms, 9.375 ms] 4.711 ms (104.5%)
iast_FULL 13.638 ms [13.365 ms, 13.911 ms] 9.13 ms (202.5%)
iast_GLOBAL 10.465 ms [10.282 ms, 10.648 ms] 5.957 ms (132.1%)
profiling 8.41 ms [8.279 ms, 8.541 ms] 3.902 ms (86.6%)
tracing 7.28 ms [7.172 ms, 7.388 ms] 2.772 ms (61.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.3 ms [4.247 ms, 4.352 ms] -
iast 9.174 ms [9.017 ms, 9.331 ms] 4.875 ms (113.4%)
iast_FULL 14.148 ms [13.866 ms, 14.429 ms] 9.848 ms (229.0%)
iast_GLOBAL 10.095 ms [9.919 ms, 10.271 ms] 5.795 ms (134.8%)
profiling 8.849 ms [8.703 ms, 8.995 ms] 4.549 ms (105.8%)
tracing 7.627 ms [7.521 ms, 7.733 ms] 3.327 ms (77.4%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~2d089ec9d1, baseline=1.52.0-SNAPSHOT~d1794c17af
    dateFormat X
    axisFormat %s
section baseline
no_agent (37.136 ms) : 36831, 37441
.   : milestone, 37136,
appsec (48.711 ms) : 48285, 49137
.   : milestone, 48711,
code_origins (44.586 ms) : 44229, 44942
.   : milestone, 44586,
iast (43.295 ms) : 42925, 43666
.   : milestone, 43295,
profiling (49.695 ms) : 49219, 50170
.   : milestone, 49695,
tracing (45.946 ms) : 45556, 46337
.   : milestone, 45946,
section candidate
no_agent (36.885 ms) : 36596, 37173
.   : milestone, 36885,
appsec (48.347 ms) : 47914, 48780
.   : milestone, 48347,
code_origins (45.515 ms) : 45115, 45914
.   : milestone, 45515,
iast (44.128 ms) : 43753, 44503
.   : milestone, 44128,
profiling (47.2 ms) : 46778, 47623
.   : milestone, 47200,
tracing (43.344 ms) : 42984, 43704
.   : milestone, 43344,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.136 ms [36.831 ms, 37.441 ms] -
appsec 48.711 ms [48.285 ms, 49.137 ms] 11.576 ms (31.2%)
code_origins 44.586 ms [44.229 ms, 44.942 ms] 7.45 ms (20.1%)
iast 43.295 ms [42.925 ms, 43.666 ms] 6.16 ms (16.6%)
profiling 49.695 ms [49.219 ms, 50.17 ms] 12.559 ms (33.8%)
tracing 45.946 ms [45.556 ms, 46.337 ms] 8.811 ms (23.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 36.885 ms [36.596 ms, 37.173 ms] -
appsec 48.347 ms [47.914 ms, 48.78 ms] 11.462 ms (31.1%)
code_origins 45.515 ms [45.115 ms, 45.914 ms] 8.63 ms (23.4%)
iast 44.128 ms [43.753 ms, 44.503 ms] 7.243 ms (19.6%)
profiling 47.2 ms [46.778 ms, 47.623 ms] 10.315 ms (28.0%)
tracing 43.344 ms [42.984 ms, 43.704 ms] 6.459 ms (17.5%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bdu/add-missing-attributes-in-metrics-key
git_commit_date 1752761628 1752763867
git_commit_sha d1794c1 2d089ec
release_version 1.52.0-SNAPSHOT~d1794c17af 1.52.0-SNAPSHOT~2d089ec9d1
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1752765786 1752765786
ci_job_id 1034137495 1034137495
ci_pipeline_id 70871046 70871046
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-e5ppsjpp 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-e5ppsjpp 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

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

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~2d089ec9d1, baseline=1.52.0-SNAPSHOT~d1794c17af
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.177 s) : 15177000, 15177000
.   : milestone, 15177000,
appsec (14.955 s) : 14955000, 14955000
.   : milestone, 14955000,
iast (18.413 s) : 18413000, 18413000
.   : milestone, 18413000,
iast_GLOBAL (18.336 s) : 18336000, 18336000
.   : milestone, 18336000,
profiling (15.307 s) : 15307000, 15307000
.   : milestone, 15307000,
tracing (14.824 s) : 14824000, 14824000
.   : milestone, 14824000,
section candidate
no_agent (15.115 s) : 15115000, 15115000
.   : milestone, 15115000,
appsec (14.665 s) : 14665000, 14665000
.   : milestone, 14665000,
iast (18.261 s) : 18261000, 18261000
.   : milestone, 18261000,
iast_GLOBAL (18.372 s) : 18372000, 18372000
.   : milestone, 18372000,
profiling (15.32 s) : 15320000, 15320000
.   : milestone, 15320000,
tracing (14.975 s) : 14975000, 14975000
.   : milestone, 14975000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.177 s [15.177 s, 15.177 s] -
appsec 14.955 s [14.955 s, 14.955 s] -222.0 ms (-1.5%)
iast 18.413 s [18.413 s, 18.413 s] 3.236 s (21.3%)
iast_GLOBAL 18.336 s [18.336 s, 18.336 s] 3.159 s (20.8%)
profiling 15.307 s [15.307 s, 15.307 s] 130.0 ms (0.9%)
tracing 14.824 s [14.824 s, 14.824 s] -353.0 ms (-2.3%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.115 s [15.115 s, 15.115 s] -
appsec 14.665 s [14.665 s, 14.665 s] -450.0 ms (-3.0%)
iast 18.261 s [18.261 s, 18.261 s] 3.146 s (20.8%)
iast_GLOBAL 18.372 s [18.372 s, 18.372 s] 3.257 s (21.5%)
profiling 15.32 s [15.32 s, 15.32 s] 205.0 ms (1.4%)
tracing 14.975 s [14.975 s, 14.975 s] -140.0 ms (-0.9%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~2d089ec9d1, baseline=1.52.0-SNAPSHOT~d1794c17af
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.475 ms) : 1464, 1486
.   : milestone, 1475,
appsec (3.629 ms) : 3413, 3845
.   : milestone, 3629,
iast (2.204 ms) : 2142, 2267
.   : milestone, 2204,
iast_GLOBAL (2.243 ms) : 2180, 2306
.   : milestone, 2243,
profiling (2.064 ms) : 2012, 2115
.   : milestone, 2064,
tracing (2.018 ms) : 1970, 2066
.   : milestone, 2018,
section candidate
no_agent (1.48 ms) : 1469, 1492
.   : milestone, 1480,
appsec (3.6 ms) : 3388, 3813
.   : milestone, 3600,
iast (2.202 ms) : 2140, 2265
.   : milestone, 2202,
iast_GLOBAL (2.247 ms) : 2184, 2310
.   : milestone, 2247,
profiling (2.064 ms) : 2012, 2115
.   : milestone, 2064,
tracing (2.027 ms) : 1978, 2075
.   : milestone, 2027,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.464 ms, 1.486 ms] -
appsec 3.629 ms [3.413 ms, 3.845 ms] 2.154 ms (146.0%)
iast 2.204 ms [2.142 ms, 2.267 ms] 729.131 µs (49.4%)
iast_GLOBAL 2.243 ms [2.18 ms, 2.306 ms] 768.315 µs (52.1%)
profiling 2.064 ms [2.012 ms, 2.115 ms] 588.816 µs (39.9%)
tracing 2.018 ms [1.97 ms, 2.066 ms] 543.097 µs (36.8%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.48 ms [1.469 ms, 1.492 ms] -
appsec 3.6 ms [3.388 ms, 3.813 ms] 2.12 ms (143.2%)
iast 2.202 ms [2.14 ms, 2.265 ms] 721.923 µs (48.8%)
iast_GLOBAL 2.247 ms [2.184 ms, 2.31 ms] 766.721 µs (51.8%)
profiling 2.064 ms [2.012 ms, 2.115 ms] 583.739 µs (39.4%)
tracing 2.027 ms [1.978 ms, 2.075 ms] 546.365 µs (36.9%)

@bric3 bric3 force-pushed the bdu/add-missing-attributes-in-metrics-key branch from 8c4a17b to 3e3c914 Compare July 16, 2025 09:38
Comment on lines -115 to -117
1 * writer.add(new MetricKey("resource", "service", "operation", "type", HTTP_OK, false), _) >> { MetricKey key, AggregateMetric value ->
value.getHitCount() == 1 && value.getTopLevelCount() == 1 && value.getDuration() == 100
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

1 * writer.add(…, _) >> { MetricKey key, AggregateMetric value -> some assertions }

FYI, these spock code are incorrect, it tries to verify the AggregateMetric, but actually nothing is properly verified, because >> indicates a stub, which is incorrect since it appears in the then section with a verification.

Instead, the verification code should be written this way, with an argument constraint :

1 * writer.add(…, { AggregateMetric value -> some assertions })

for (String peerTag : features.peerTags()) {
Object value = span.getTag(peerTag);
if (value != null) {
peerTags.add(peerTag + ":" + TraceUtils.normalizeTag(value.toString()));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would avoid creating a lot of new strings here. Instead we can return a map view of the tracer tags (a view returning only entries whose key is in peerTags) and write directly key then : then normalize(value) on the messagepack writer. It will avoid create a string here.

Copy link
Contributor

Choose a reason for hiding this comment

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

A simplified version is just to hold key, value here (so that we can use them for the hashtag) but not concat the key:value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, we're thinking alike!
I had the same thought about String creation. I tried a StringBuilder approach, but without notable benefit in the end on the serialization side, especially since UTF8BytesString actually creates a full String anyway.

The issue with keeping a map view, is it requires to create UTF8BytesString each time this key is serialized. I'll try to come up with a solution that balances both.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes as an idea that can split in a couple of things.
First the need not to concatenate strings. For this you can just store the key in a list of UTF8ByteString (since they peerTags are quite stable they can be converted once anyway) and value in of List<String> and in SerializingMetricWriter just write first the key then : than the normalised value.
I don't think that the values can be efficiently cached since we don't know the cardinality in advance. Converting in UTF8 each time should be fine for now

@bric3 bric3 force-pushed the bdu/add-missing-attributes-in-metrics-key branch from 3e3c914 to 48a0722 Compare July 17, 2025 14:27
StringBuilder peerTagBuilder = new StringBuilder();
for (Map.Entry<String, String> peerTag : peerTags.entrySet()) {
peerTagBuilder.setLength(0);
String toWrite = peerTagBuilder
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we can do something to cache them with a DDCache (like 1024 entries assuming that it will be enough for peer tags)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, that's something on my mind, but there some challenges there that I'd rather work in another smaller PR.

Copy link
Contributor

@amarziali amarziali left a comment

Choose a reason for hiding this comment

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

Looks good. I think we should try adding a cache to the peer tags to avoid creating lots of string

@bric3 bric3 marked this pull request as ready for review July 17, 2025 14:41
@bric3 bric3 requested a review from a team as a code owner July 17, 2025 14:41
@bric3 bric3 requested a review from smola July 17, 2025 14:41
Copy link
Contributor

github-actions bot commented Jul 17, 2025

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

Also delays the creation of the Utf8ByteString at serialization time.
Note that `writer.writeUTF8` emits a header corresponding to the length
of the value being written, calling this method again will count as an
entry in the array.
A possible idea was to use a cache to store the computation of the
peerTags, however `Utf8ByteString` is not concatenable / appendable,
which is necessary to have the proper encoding. Creating a
new "temporary" `Utf8ByteString`, was replaced by a direct call to
`String: :getBytes`.
@bric3 bric3 force-pushed the bdu/add-missing-attributes-in-metrics-key branch from 48a0722 to 2d089ec Compare July 17, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants