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

Draft
wants to merge 1 commit 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 1752596399 1752658697
git_commit_sha d9df78f 3e3c914
release_version 1.52.0-SNAPSHOT~d9df78f4c9 1.52.0-SNAPSHOT~3e3c914edf
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752660405 1752660405
ci_job_id 1031034725 1031034725
ci_pipeline_id 70691055 70691055
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-3j1osy9r 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-3j1osy9r 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 44 metrics, 9 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.52.0-SNAPSHOT~3e3c914edf, baseline=1.52.0-SNAPSHOT~d9df78f4c9

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.006 s) : 0, 1006491
Total [baseline] (10.658 s) : 0, 10658461
Agent [candidate] (994.883 ms) : 0, 994883
Total [candidate] (10.523 s) : 0, 10522836
section appsec
Agent [baseline] (1.175 s) : 0, 1175185
Total [baseline] (10.714 s) : 0, 10713930
Agent [candidate] (1.175 s) : 0, 1174876
Total [candidate] (10.748 s) : 0, 10747527
section iast
Agent [baseline] (1.128 s) : 0, 1128488
Total [baseline] (10.798 s) : 0, 10798093
Agent [candidate] (1.133 s) : 0, 1133474
Total [candidate] (10.859 s) : 0, 10858749
section profiling
Agent [baseline] (1.245 s) : 0, 1245091
Total [baseline] (10.898 s) : 0, 10897609
Agent [candidate] (1.244 s) : 0, 1243664
Total [candidate] (10.91 s) : 0, 10909517
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.006 s -
Agent appsec 1.175 s 168.695 ms (16.8%)
Agent iast 1.128 s 121.998 ms (12.1%)
Agent profiling 1.245 s 238.601 ms (23.7%)
Total tracing 10.658 s -
Total appsec 10.714 s 55.469 ms (0.5%)
Total iast 10.798 s 139.632 ms (1.3%)
Total profiling 10.898 s 239.148 ms (2.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 994.883 ms -
Agent appsec 1.175 s 179.993 ms (18.1%)
Agent iast 1.133 s 138.591 ms (13.9%)
Agent profiling 1.244 s 248.781 ms (25.0%)
Total tracing 10.523 s -
Total appsec 10.748 s 224.69 ms (2.1%)
Total iast 10.859 s 335.913 ms (3.2%)
Total profiling 10.91 s 386.681 ms (3.7%)
gantt
    title petclinic - break down per module: candidate=1.52.0-SNAPSHOT~3e3c914edf, baseline=1.52.0-SNAPSHOT~d9df78f4c9

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (692.475 ms) : 0, 692475
BytebuddyAgent [candidate] (686.095 ms) : 0, 686095
GlobalTracer [baseline] (246.738 ms) : 0, 246738
GlobalTracer [candidate] (242.694 ms) : 0, 242694
AppSec [baseline] (31.138 ms) : 0, 31138
AppSec [candidate] (30.307 ms) : 0, 30307
Debugger [baseline] (6.101 ms) : 0, 6101
Debugger [candidate] (5.979 ms) : 0, 5979
Remote Config [baseline] (685.746 µs) : 0, 686
Remote Config [candidate] (685.359 µs) : 0, 685
Telemetry [baseline] (8.311 ms) : 0, 8311
Telemetry [candidate] (8.225 ms) : 0, 8225
section appsec
BytebuddyAgent [baseline] (709.16 ms) : 0, 709160
BytebuddyAgent [candidate] (709.12 ms) : 0, 709120
GlobalTracer [baseline] (236.237 ms) : 0, 236237
GlobalTracer [candidate] (235.527 ms) : 0, 235527
AppSec [baseline] (171.213 ms) : 0, 171213
AppSec [candidate] (171.261 ms) : 0, 171261
Debugger [baseline] (5.707 ms) : 0, 5707
Debugger [candidate] (5.764 ms) : 0, 5764
Remote Config [baseline] (605.39 µs) : 0, 605
Remote Config [candidate] (611.527 µs) : 0, 612
Telemetry [baseline] (7.994 ms) : 0, 7994
Telemetry [candidate] (8.109 ms) : 0, 8109
IAST [baseline] (23.283 ms) : 0, 23283
IAST [candidate] (23.618 ms) : 0, 23618
section iast
BytebuddyAgent [baseline] (802.724 ms) : 0, 802724
BytebuddyAgent [candidate] (806.212 ms) : 0, 806212
GlobalTracer [baseline] (233.286 ms) : 0, 233286
GlobalTracer [candidate] (233.834 ms) : 0, 233834
AppSec [baseline] (28.805 ms) : 0, 28805
AppSec [candidate] (32.527 ms) : 0, 32527
Debugger [baseline] (5.738 ms) : 0, 5738
Debugger [candidate] (5.732 ms) : 0, 5732
Remote Config [baseline] (563.153 µs) : 0, 563
Remote Config [candidate] (589.098 µs) : 0, 589
Telemetry [baseline] (7.865 ms) : 0, 7865
Telemetry [candidate] (7.948 ms) : 0, 7948
IAST [baseline] (28.706 ms) : 0, 28706
IAST [candidate] (25.715 ms) : 0, 25715
section profiling
ProfilingAgent [baseline] (103.176 ms) : 0, 103176
ProfilingAgent [candidate] (103.157 ms) : 0, 103157
BytebuddyAgent [baseline] (676.394 ms) : 0, 676394
BytebuddyAgent [candidate] (677.089 ms) : 0, 677089
GlobalTracer [baseline] (363.389 ms) : 0, 363389
GlobalTracer [candidate] (361.592 ms) : 0, 361592
AppSec [baseline] (31.277 ms) : 0, 31277
AppSec [candidate] (33.77 ms) : 0, 33770
Debugger [baseline] (11.985 ms) : 0, 11985
Debugger [candidate] (10.568 ms) : 0, 10568
Remote Config [baseline] (658.4 µs) : 0, 658
Remote Config [candidate] (660.24 µs) : 0, 660
Telemetry [baseline] (9.513 ms) : 0, 9513
Telemetry [candidate] (8.05 ms) : 0, 8050
Profiling [baseline] (103.201 ms) : 0, 103201
Profiling [candidate] (103.182 ms) : 0, 103182
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.52.0-SNAPSHOT~3e3c914edf, baseline=1.52.0-SNAPSHOT~d9df78f4c9

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (996.382 ms) : 0, 996382
Total [baseline] (8.586 s) : 0, 8585866
Agent [candidate] (993.166 ms) : 0, 993166
Total [candidate] (8.569 s) : 0, 8569177
section iast
Agent [baseline] (1.132 s) : 0, 1131571
Total [baseline] (9.264 s) : 0, 9264374
Agent [candidate] (1.133 s) : 0, 1133193
Total [candidate] (9.242 s) : 0, 9241937
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 996.382 ms -
Agent iast 1.132 s 135.189 ms (13.6%)
Total tracing 8.586 s -
Total iast 9.264 s 678.508 ms (7.9%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 993.166 ms -
Agent iast 1.133 s 140.027 ms (14.1%)
Total tracing 8.569 s -
Total iast 9.242 s 672.76 ms (7.9%)
gantt
    title insecure-bank - break down per module: candidate=1.52.0-SNAPSHOT~3e3c914edf, baseline=1.52.0-SNAPSHOT~d9df78f4c9

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (686.134 ms) : 0, 686134
BytebuddyAgent [candidate] (685.273 ms) : 0, 685273
GlobalTracer [baseline] (243.741 ms) : 0, 243741
GlobalTracer [candidate] (241.885 ms) : 0, 241885
AppSec [baseline] (30.694 ms) : 0, 30694
AppSec [candidate] (30.379 ms) : 0, 30379
Debugger [baseline] (6.065 ms) : 0, 6065
Debugger [candidate] (6.016 ms) : 0, 6016
Remote Config [baseline] (684.09 µs) : 0, 684
Remote Config [candidate] (683.765 µs) : 0, 684
Telemetry [baseline] (8.2 ms) : 0, 8200
Telemetry [candidate] (8.215 ms) : 0, 8215
section iast
BytebuddyAgent [baseline] (804.059 ms) : 0, 804059
BytebuddyAgent [candidate] (806.784 ms) : 0, 806784
GlobalTracer [baseline] (233.848 ms) : 0, 233848
GlobalTracer [candidate] (233.185 ms) : 0, 233185
AppSec [baseline] (33.42 ms) : 0, 33420
AppSec [candidate] (30.572 ms) : 0, 30572
Debugger [baseline] (5.687 ms) : 0, 5687
Debugger [candidate] (6.646 ms) : 0, 6646
Remote Config [baseline] (566.83 µs) : 0, 567
Remote Config [candidate] (585.868 µs) : 0, 586
Telemetry [baseline] (7.886 ms) : 0, 7886
Telemetry [candidate] (7.877 ms) : 0, 7877
IAST [baseline] (25.172 ms) : 0, 25172
IAST [candidate] (26.693 ms) : 0, 26693
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bdu/add-missing-attributes-in-metrics-key
git_commit_date 1752596399 1752658697
git_commit_sha d9df78f 3e3c914
release_version 1.52.0-SNAPSHOT~d9df78f4c9 1.52.0-SNAPSHOT~3e3c914edf
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1752660087 1752660087
ci_job_id 1031034727 1031034727
ci_pipeline_id 70691055 70691055
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-vhvgal5r 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-vhvgal5r 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 1 performance improvements and 2 performance regressions! Performance is the same for 9 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:profiling:high_load worse
[+217.107µs; +543.340µs] or [+2.474%; +6.192%]
unstable
[-92.315op/s; +49.002op/s] or [-17.459%; +9.268%]
9.155ms 507.094op/s 8.774ms 528.750op/s
scenario:load:petclinic:profiling:high_load worse
[+1.685ms; +2.746ms] or [+3.466%; +5.647%]
unstable
[-11.897op/s; +1.134op/s] or [-12.204%; +1.164%]
50.836ms 92.100op/s 48.620ms 97.481op/s
scenario:load:petclinic:tracing:high_load better
[-2.631ms; -1.860ms] or [-5.895%; -4.166%]
unstable
[-2.834op/s; +11.331op/s] or [-2.670%; +10.675%]
42.389ms 110.388op/s 44.634ms 106.139op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~3e3c914edf, baseline=1.52.0-SNAPSHOT~d9df78f4c9
    dateFormat X
    axisFormat %s
section baseline
no_agent (36.031 ms) : 35736, 36326
.   : milestone, 36031,
appsec (47.421 ms) : 46990, 47852
.   : milestone, 47421,
code_origins (45.311 ms) : 44920, 45702
.   : milestone, 45311,
iast (44.822 ms) : 44445, 45199
.   : milestone, 44822,
profiling (48.62 ms) : 48132, 49109
.   : milestone, 48620,
tracing (44.634 ms) : 44269, 45000
.   : milestone, 44634,
section candidate
no_agent (36.663 ms) : 36368, 36958
.   : milestone, 36663,
appsec (48.135 ms) : 47687, 48583
.   : milestone, 48135,
code_origins (45.551 ms) : 45171, 45931
.   : milestone, 45551,
iast (45.408 ms) : 45015, 45801
.   : milestone, 45408,
profiling (50.836 ms) : 50338, 51333
.   : milestone, 50836,
tracing (42.389 ms) : 42037, 42740
.   : milestone, 42389,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 36.031 ms [35.736 ms, 36.326 ms] -
appsec 47.421 ms [46.99 ms, 47.852 ms] 11.39 ms (31.6%)
code_origins 45.311 ms [44.92 ms, 45.702 ms] 9.28 ms (25.8%)
iast 44.822 ms [44.445 ms, 45.199 ms] 8.791 ms (24.4%)
profiling 48.62 ms [48.132 ms, 49.109 ms] 12.589 ms (34.9%)
tracing 44.634 ms [44.269 ms, 45.0 ms] 8.603 ms (23.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 36.663 ms [36.368 ms, 36.958 ms] -
appsec 48.135 ms [47.687 ms, 48.583 ms] 11.472 ms (31.3%)
code_origins 45.551 ms [45.171 ms, 45.931 ms] 8.888 ms (24.2%)
iast 45.408 ms [45.015 ms, 45.801 ms] 8.745 ms (23.9%)
profiling 50.836 ms [50.338 ms, 51.333 ms] 14.173 ms (38.7%)
tracing 42.389 ms [42.037 ms, 42.74 ms] 5.726 ms (15.6%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~3e3c914edf, baseline=1.52.0-SNAPSHOT~d9df78f4c9
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.312 ms) : 4256, 4368
.   : milestone, 4312,
iast (9.364 ms) : 9202, 9527
.   : milestone, 9364,
iast_FULL (13.962 ms) : 13681, 14243
.   : milestone, 13962,
iast_GLOBAL (10.509 ms) : 10324, 10693
.   : milestone, 10509,
profiling (8.774 ms) : 8640, 8908
.   : milestone, 8774,
tracing (7.708 ms) : 7599, 7817
.   : milestone, 7708,
section candidate
no_agent (4.25 ms) : 4196, 4304
.   : milestone, 4250,
iast (9.455 ms) : 9293, 9617
.   : milestone, 9455,
iast_FULL (14.073 ms) : 13791, 14354
.   : milestone, 14073,
iast_GLOBAL (10.236 ms) : 10055, 10417
.   : milestone, 10236,
profiling (9.155 ms) : 8987, 9322
.   : milestone, 9155,
tracing (7.511 ms) : 7401, 7620
.   : milestone, 7511,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.312 ms [4.256 ms, 4.368 ms] -
iast 9.364 ms [9.202 ms, 9.527 ms] 5.053 ms (117.2%)
iast_FULL 13.962 ms [13.681 ms, 14.243 ms] 9.65 ms (223.8%)
iast_GLOBAL 10.509 ms [10.324 ms, 10.693 ms] 6.197 ms (143.7%)
profiling 8.774 ms [8.64 ms, 8.908 ms] 4.463 ms (103.5%)
tracing 7.708 ms [7.599 ms, 7.817 ms] 3.396 ms (78.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.25 ms [4.196 ms, 4.304 ms] -
iast 9.455 ms [9.293 ms, 9.617 ms] 5.205 ms (122.5%)
iast_FULL 14.073 ms [13.791 ms, 14.354 ms] 9.823 ms (231.1%)
iast_GLOBAL 10.236 ms [10.055 ms, 10.417 ms] 5.987 ms (140.9%)
profiling 9.155 ms [8.987 ms, 9.322 ms] 4.905 ms (115.4%)
tracing 7.511 ms [7.401 ms, 7.62 ms] 3.261 ms (76.7%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master bdu/add-missing-attributes-in-metrics-key
git_commit_date 1752596399 1752658697
git_commit_sha d9df78f 3e3c914
release_version 1.52.0-SNAPSHOT~d9df78f4c9 1.52.0-SNAPSHOT~3e3c914edf
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1752660590 1752660590
ci_job_id 1031034729 1031034729
ci_pipeline_id 70691055 70691055
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-61r7vdq1 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-61r7vdq1 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 12 metrics, 0 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~3e3c914edf, baseline=1.52.0-SNAPSHOT~d9df78f4c9
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.482 ms) : 1471, 1494
.   : milestone, 1482,
appsec (2.43 ms) : 2379, 2480
.   : milestone, 2430,
iast (2.215 ms) : 2152, 2278
.   : milestone, 2215,
iast_GLOBAL (2.264 ms) : 2201, 2328
.   : milestone, 2264,
profiling (2.065 ms) : 2014, 2116
.   : milestone, 2065,
tracing (2.023 ms) : 1974, 2071
.   : milestone, 2023,
section candidate
no_agent (1.484 ms) : 1473, 1496
.   : milestone, 1484,
appsec (2.43 ms) : 2379, 2481
.   : milestone, 2430,
iast (2.211 ms) : 2148, 2275
.   : milestone, 2211,
iast_GLOBAL (2.259 ms) : 2195, 2323
.   : milestone, 2259,
profiling (2.073 ms) : 2020, 2126
.   : milestone, 2073,
tracing (2.027 ms) : 1977, 2076
.   : milestone, 2027,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.482 ms [1.471 ms, 1.494 ms] -
appsec 2.43 ms [2.379 ms, 2.48 ms] 947.168 µs (63.9%)
iast 2.215 ms [2.152 ms, 2.278 ms] 732.869 µs (49.4%)
iast_GLOBAL 2.264 ms [2.201 ms, 2.328 ms] 781.9 µs (52.7%)
profiling 2.065 ms [2.014 ms, 2.116 ms] 582.789 µs (39.3%)
tracing 2.023 ms [1.974 ms, 2.071 ms] 540.122 µs (36.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.484 ms [1.473 ms, 1.496 ms] -
appsec 2.43 ms [2.379 ms, 2.481 ms] 946.067 µs (63.7%)
iast 2.211 ms [2.148 ms, 2.275 ms] 727.378 µs (49.0%)
iast_GLOBAL 2.259 ms [2.195 ms, 2.323 ms] 774.848 µs (52.2%)
profiling 2.073 ms [2.02 ms, 2.126 ms] 588.965 µs (39.7%)
tracing 2.027 ms [1.977 ms, 2.076 ms] 542.696 µs (36.6%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~3e3c914edf, baseline=1.52.0-SNAPSHOT~d9df78f4c9
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.528 s) : 15528000, 15528000
.   : milestone, 15528000,
appsec (14.644 s) : 14644000, 14644000
.   : milestone, 14644000,
iast (18.879 s) : 18879000, 18879000
.   : milestone, 18879000,
iast_GLOBAL (17.928 s) : 17928000, 17928000
.   : milestone, 17928000,
profiling (15.769 s) : 15769000, 15769000
.   : milestone, 15769000,
tracing (14.815 s) : 14815000, 14815000
.   : milestone, 14815000,
section candidate
no_agent (15.622 s) : 15622000, 15622000
.   : milestone, 15622000,
appsec (14.866 s) : 14866000, 14866000
.   : milestone, 14866000,
iast (18.376 s) : 18376000, 18376000
.   : milestone, 18376000,
iast_GLOBAL (17.943 s) : 17943000, 17943000
.   : milestone, 17943000,
profiling (15.255 s) : 15255000, 15255000
.   : milestone, 15255000,
tracing (14.721 s) : 14721000, 14721000
.   : milestone, 14721000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.528 s [15.528 s, 15.528 s] -
appsec 14.644 s [14.644 s, 14.644 s] -884.0 ms (-5.7%)
iast 18.879 s [18.879 s, 18.879 s] 3.351 s (21.6%)
iast_GLOBAL 17.928 s [17.928 s, 17.928 s] 2.4 s (15.5%)
profiling 15.769 s [15.769 s, 15.769 s] 241.0 ms (1.6%)
tracing 14.815 s [14.815 s, 14.815 s] -713.0 ms (-4.6%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.622 s [15.622 s, 15.622 s] -
appsec 14.866 s [14.866 s, 14.866 s] -756.0 ms (-4.8%)
iast 18.376 s [18.376 s, 18.376 s] 2.754 s (17.6%)
iast_GLOBAL 17.943 s [17.943 s, 17.943 s] 2.321 s (14.9%)
profiling 15.255 s [15.255 s, 15.255 s] -367.0 ms (-2.3%)
tracing 14.721 s [14.721 s, 14.721 s] -901.0 ms (-5.8%)

@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

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