Skip to content

Conversation

ygree
Copy link
Contributor

@ygree ygree commented Jul 30, 2025

What Does This Do

  • Incorporate containerTagsHash (received from the Agent) in baseHash calculation
  • [DBM] Inject baseHash into SQL
  • [DSM] Use baseHash in DataStreamsTags
flowchart TD
    subgraph communication
        DDAgentFeaturesDiscovery
    end
    subgraph instrumentation/jdbc
        SQLCommenter
    end
    subgraph dd-trace-core
        DataStreamsMonitoring
        PathwayContext
    end
    subgraph internal-api
        DataStreamsTags
        subgraph NEW
            BaseHash
        end
        Config
    end
    subgraph container-utils
        ContainerInfo
    end

    DDAgentFeaturesDiscovery--updates-->ContainerInfo
    DDAgentFeaturesDiscovery--updates-->BaseHash
    SQLCommenter--getBaseHash-->BaseHash

    BaseHash--uses-->Config

    PathwayContext--getHash-->DataStreamsTags
    DataStreamsTags--getBaseHash-->BaseHash

    DataStreamsMonitoring-->PathwayContext
    DataStreamsMonitoring-->DataStreamsTags
Loading

Motivation

Backpropagation of container tags. The agent calculates the hash, which is then injected into DBM queries and the DSM pathway context.

Additional Notes

The agent sends the containerTagsHash in the response header. The Java Tracer stores it in the ContainerInfo.

Contributor Checklist

Jira ticket: OLDAIDM-700

@ygree ygree self-assigned this Jul 30, 2025
@ygree ygree added comp: data streams Data Streams Monitoring comp: database Database Monitoring labels Jul 30, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jul 30, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/container-tags-hash-propagation
git_commit_date 1755621799 1755637040
git_commit_sha 27cd7f4 2fcea15
release_version 1.53.0-SNAPSHOT~27cd7f43d9 1.52.0-SNAPSHOT~2fcea15ec8
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1755638845 1755638845
ci_job_id 1088376100 1088376100
ci_pipeline_id 74180981 74180981
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-kix770dv 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-kix770dv 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 45 metrics, 14 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.52.0-SNAPSHOT~2fcea15ec8, baseline=1.53.0-SNAPSHOT~27cd7f43d9

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1048323
Total [baseline] (10.799 s) : 0, 10799118
Agent [candidate] (1.054 s) : 0, 1053566
Total [candidate] (10.749 s) : 0, 10749440
section appsec
Agent [baseline] (1.228 s) : 0, 1227523
Total [baseline] (10.883 s) : 0, 10882852
Agent [candidate] (1.225 s) : 0, 1225151
Total [candidate] (10.822 s) : 0, 10822447
section iast
Agent [baseline] (1.19 s) : 0, 1189961
Total [baseline] (11.015 s) : 0, 11014952
Agent [candidate] (1.18 s) : 0, 1180203
Total [candidate] (10.89 s) : 0, 10889598
section profiling
Agent [baseline] (1.197 s) : 0, 1196920
Total [baseline] (10.86 s) : 0, 10859708
Agent [candidate] (1.192 s) : 0, 1191958
Total [candidate] (10.894 s) : 0, 10893614
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent appsec 1.228 s 179.2 ms (17.1%)
Agent iast 1.19 s 141.638 ms (13.5%)
Agent profiling 1.197 s 148.597 ms (14.2%)
Total tracing 10.799 s -
Total appsec 10.883 s 83.734 ms (0.8%)
Total iast 11.015 s 215.834 ms (2.0%)
Total profiling 10.86 s 60.589 ms (0.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.054 s -
Agent appsec 1.225 s 171.584 ms (16.3%)
Agent iast 1.18 s 126.636 ms (12.0%)
Agent profiling 1.192 s 138.391 ms (13.1%)
Total tracing 10.749 s -
Total appsec 10.822 s 73.007 ms (0.7%)
Total iast 10.89 s 140.157 ms (1.3%)
Total profiling 10.894 s 144.174 ms (1.3%)
gantt
    title petclinic - break down per module: candidate=1.52.0-SNAPSHOT~2fcea15ec8, baseline=1.53.0-SNAPSHOT~27cd7f43d9

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.472 ms) : 0, 1472
BytebuddyAgent [baseline] (733.26 ms) : 0, 733260
BytebuddyAgent [candidate] (737.492 ms) : 0, 737492
GlobalTracer [baseline] (243.919 ms) : 0, 243919
GlobalTracer [candidate] (242.773 ms) : 0, 242773
AppSec [baseline] (30.182 ms) : 0, 30182
AppSec [candidate] (30.192 ms) : 0, 30192
Debugger [baseline] (6.058 ms) : 0, 6058
Debugger [candidate] (6.121 ms) : 0, 6121
Remote Config [baseline] (671.85 µs) : 0, 672
Remote Config [candidate] (688.474 µs) : 0, 688
Telemetry [baseline] (11.664 ms) : 0, 11664
Telemetry [candidate] (13.556 ms) : 0, 13556
section appsec
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (757.777 ms) : 0, 757777
BytebuddyAgent [candidate] (757.836 ms) : 0, 757836
GlobalTracer [baseline] (236.177 ms) : 0, 236177
GlobalTracer [candidate] (234.901 ms) : 0, 234901
AppSec [baseline] (170.814 ms) : 0, 170814
AppSec [candidate] (169.907 ms) : 0, 169907
Debugger [baseline] (6.536 ms) : 0, 6536
Debugger [candidate] (6.478 ms) : 0, 6478
Remote Config [baseline] (647.88 µs) : 0, 648
Remote Config [candidate] (616.877 µs) : 0, 617
Telemetry [baseline] (9.249 ms) : 0, 9249
Telemetry [candidate] (9.275 ms) : 0, 9275
IAST [baseline] (23.737 ms) : 0, 23737
IAST [candidate] (23.521 ms) : 0, 23521
section iast
crashtracking [baseline] (1.469 ms) : 0, 1469
crashtracking [candidate] (1.446 ms) : 0, 1446
BytebuddyAgent [baseline] (859.882 ms) : 0, 859882
BytebuddyAgent [candidate] (852.678 ms) : 0, 852678
GlobalTracer [baseline] (234.321 ms) : 0, 234321
GlobalTracer [candidate] (232.556 ms) : 0, 232556
AppSec [baseline] (26.124 ms) : 0, 26124
AppSec [candidate] (26.811 ms) : 0, 26811
Debugger [baseline] (6.681 ms) : 0, 6681
Debugger [candidate] (5.744 ms) : 0, 5744
Remote Config [baseline] (611.669 µs) : 0, 612
Remote Config [candidate] (602.478 µs) : 0, 602
Telemetry [baseline] (8.362 ms) : 0, 8362
Telemetry [candidate] (8.243 ms) : 0, 8243
IAST [baseline] (31.236 ms) : 0, 31236
IAST [candidate] (31.012 ms) : 0, 31012
section profiling
ProfilingAgent [baseline] (107.923 ms) : 0, 107923
ProfilingAgent [candidate] (107.756 ms) : 0, 107756
crashtracking [baseline] (1.418 ms) : 0, 1418
crashtracking [candidate] (1.415 ms) : 0, 1415
BytebuddyAgent [baseline] (762.544 ms) : 0, 762544
BytebuddyAgent [candidate] (760.153 ms) : 0, 760153
GlobalTracer [baseline] (222.072 ms) : 0, 222072
GlobalTracer [candidate] (220.361 ms) : 0, 220361
AppSec [baseline] (29.94 ms) : 0, 29940
AppSec [candidate] (30.305 ms) : 0, 30305
Debugger [baseline] (6.272 ms) : 0, 6272
Debugger [candidate] (7.028 ms) : 0, 7028
Remote Config [baseline] (736.398 µs) : 0, 736
Remote Config [candidate] (704.34 µs) : 0, 704
Telemetry [baseline] (16.35 ms) : 0, 16350
Telemetry [candidate] (14.759 ms) : 0, 14759
Profiling [baseline] (108.569 ms) : 0, 108569
Profiling [candidate] (108.413 ms) : 0, 108413
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.52.0-SNAPSHOT~2fcea15ec8, baseline=1.53.0-SNAPSHOT~27cd7f43d9

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.059 s) : 0, 1058780
Total [baseline] (8.658 s) : 0, 8657881
Agent [candidate] (1.053 s) : 0, 1053151
Total [candidate] (8.654 s) : 0, 8653972
section iast
Agent [baseline] (1.198 s) : 0, 1198289
Total [baseline] (9.332 s) : 0, 9331798
Agent [candidate] (1.183 s) : 0, 1183094
Total [candidate] (9.363 s) : 0, 9363359
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.059 s -
Agent iast 1.198 s 139.509 ms (13.2%)
Total tracing 8.658 s -
Total iast 9.332 s 673.917 ms (7.8%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.053 s -
Agent iast 1.183 s 129.943 ms (12.3%)
Total tracing 8.654 s -
Total iast 9.363 s 709.387 ms (8.2%)
gantt
    title insecure-bank - break down per module: candidate=1.52.0-SNAPSHOT~2fcea15ec8, baseline=1.53.0-SNAPSHOT~27cd7f43d9

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.465 ms) : 0, 1465
crashtracking [candidate] (1.464 ms) : 0, 1464
BytebuddyAgent [baseline] (740.084 ms) : 0, 740084
BytebuddyAgent [candidate] (737.691 ms) : 0, 737691
GlobalTracer [baseline] (244.88 ms) : 0, 244880
GlobalTracer [candidate] (242.768 ms) : 0, 242768
AppSec [baseline] (30.636 ms) : 0, 30636
AppSec [candidate] (30.311 ms) : 0, 30311
Debugger [baseline] (6.108 ms) : 0, 6108
Debugger [candidate] (6.116 ms) : 0, 6116
Remote Config [baseline] (678.85 µs) : 0, 679
Remote Config [candidate] (667.994 µs) : 0, 668
Telemetry [baseline] (13.791 ms) : 0, 13791
Telemetry [candidate] (12.972 ms) : 0, 12972
section iast
crashtracking [baseline] (1.48 ms) : 0, 1480
crashtracking [candidate] (1.464 ms) : 0, 1464
BytebuddyAgent [baseline] (865.907 ms) : 0, 865907
BytebuddyAgent [candidate] (856.43 ms) : 0, 856430
GlobalTracer [baseline] (235.696 ms) : 0, 235696
GlobalTracer [candidate] (231.632 ms) : 0, 231632
AppSec [baseline] (28.851 ms) : 0, 28851
AppSec [candidate] (25.099 ms) : 0, 25099
Debugger [baseline] (5.818 ms) : 0, 5818
Debugger [candidate] (5.757 ms) : 0, 5757
Remote Config [baseline] (617.531 µs) : 0, 618
Remote Config [candidate] (611.068 µs) : 0, 611
Telemetry [baseline] (8.486 ms) : 0, 8486
Telemetry [candidate] (8.239 ms) : 0, 8239
IAST [baseline] (30.217 ms) : 0, 30217
IAST [candidate] (32.868 ms) : 0, 32868
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/container-tags-hash-propagation
git_commit_date 1755621799 1755637040
git_commit_sha 27cd7f4 2fcea15
release_version 1.53.0-SNAPSHOT~27cd7f43d9 1.52.0-SNAPSHOT~2fcea15ec8
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1755638590 1755638590
ci_job_id 1088376101 1088376101
ci_pipeline_id 74180981 74180981
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-k5gbjpov 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-k5gbjpov 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 2 performance improvements and 3 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:iast_GLOBAL:high_load worse
[+266.387µs; +627.157µs] or [+2.776%; +6.536%]
unstable
[-78.268op/s; +35.518op/s] or [-16.173%; +7.339%]
10.042ms 462.562op/s 9.595ms 483.938op/s
scenario:load:insecure-bank:tracing:high_load better
[-597.152µs; -337.250µs] or [-7.425%; -4.194%]
unstable
[-39.357op/s; +109.482op/s] or [-6.831%; +19.001%]
7.575ms 611.250op/s 8.042ms 576.188op/s
scenario:load:insecure-bank:iast_FULL:high_load better
[-980.274µs; -390.355µs] or [-6.841%; -2.724%]
unstable
[-20.447op/s; +52.884op/s] or [-6.287%; +16.261%]
13.644ms 341.438op/s 14.329ms 325.219op/s
scenario:load:petclinic:no_agent:high_load worse
[+1.133ms; +1.776ms] or [+3.114%; +4.878%]
unstable
[-13.536op/s; +3.861op/s] or [-10.543%; +3.008%]
37.852ms 123.550op/s 36.398ms 128.387op/s
scenario:load:petclinic:iast:high_load worse
[+1.672ms; +2.512ms] or [+3.873%; +5.820%]
unstable
[-12.434op/s; +2.434op/s] or [-11.476%; +2.247%]
45.259ms 103.350op/s 43.167ms 108.350op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~2fcea15ec8, baseline=1.53.0-SNAPSHOT~27cd7f43d9
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.424 ms) : 4369, 4479
.   : milestone, 4424,
iast (9.013 ms) : 8870, 9157
.   : milestone, 9013,
iast_FULL (14.329 ms) : 14047, 14610
.   : milestone, 14329,
iast_GLOBAL (9.595 ms) : 9431, 9758
.   : milestone, 9595,
profiling (8.759 ms) : 8625, 8894
.   : milestone, 8759,
tracing (8.042 ms) : 7917, 8167
.   : milestone, 8042,
section candidate
no_agent (4.282 ms) : 4233, 4331
.   : milestone, 4282,
iast (9.195 ms) : 9047, 9343
.   : milestone, 9195,
iast_FULL (13.644 ms) : 13377, 13910
.   : milestone, 13644,
iast_GLOBAL (10.042 ms) : 9870, 10213
.   : milestone, 10042,
profiling (8.598 ms) : 8467, 8728
.   : milestone, 8598,
tracing (7.575 ms) : 7458, 7692
.   : milestone, 7575,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.424 ms [4.369 ms, 4.479 ms] -
iast 9.013 ms [8.87 ms, 9.157 ms] 4.59 ms (103.8%)
iast_FULL 14.329 ms [14.047 ms, 14.61 ms] 9.905 ms (223.9%)
iast_GLOBAL 9.595 ms [9.431 ms, 9.758 ms] 5.171 ms (116.9%)
profiling 8.759 ms [8.625 ms, 8.894 ms] 4.336 ms (98.0%)
tracing 8.042 ms [7.917 ms, 8.167 ms] 3.618 ms (81.8%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.282 ms [4.233 ms, 4.331 ms] -
iast 9.195 ms [9.047 ms, 9.343 ms] 4.913 ms (114.7%)
iast_FULL 13.644 ms [13.377 ms, 13.91 ms] 9.362 ms (218.6%)
iast_GLOBAL 10.042 ms [9.87 ms, 10.213 ms] 5.76 ms (134.5%)
profiling 8.598 ms [8.467 ms, 8.728 ms] 4.316 ms (100.8%)
tracing 7.575 ms [7.458 ms, 7.692 ms] 3.293 ms (76.9%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~2fcea15ec8, baseline=1.53.0-SNAPSHOT~27cd7f43d9
    dateFormat X
    axisFormat %s
section baseline
no_agent (36.398 ms) : 36105, 36691
.   : milestone, 36398,
appsec (46.882 ms) : 46474, 47291
.   : milestone, 46882,
code_origins (47.054 ms) : 46655, 47452
.   : milestone, 47054,
iast (43.167 ms) : 42789, 43546
.   : milestone, 43167,
profiling (47.49 ms) : 47043, 47937
.   : milestone, 47490,
tracing (43.637 ms) : 43284, 43990
.   : milestone, 43637,
section candidate
no_agent (37.852 ms) : 37549, 38156
.   : milestone, 37852,
appsec (46.389 ms) : 45968, 46810
.   : milestone, 46389,
code_origins (47.263 ms) : 46843, 47683
.   : milestone, 47263,
iast (45.259 ms) : 44858, 45661
.   : milestone, 45259,
profiling (48.675 ms) : 48223, 49128
.   : milestone, 48675,
tracing (43.228 ms) : 42865, 43592
.   : milestone, 43228,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 36.398 ms [36.105 ms, 36.691 ms] -
appsec 46.882 ms [46.474 ms, 47.291 ms] 10.484 ms (28.8%)
code_origins 47.054 ms [46.655 ms, 47.452 ms] 10.656 ms (29.3%)
iast 43.167 ms [42.789 ms, 43.546 ms] 6.77 ms (18.6%)
profiling 47.49 ms [47.043 ms, 47.937 ms] 11.092 ms (30.5%)
tracing 43.637 ms [43.284 ms, 43.99 ms] 7.239 ms (19.9%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.852 ms [37.549 ms, 38.156 ms] -
appsec 46.389 ms [45.968 ms, 46.81 ms] 8.536 ms (22.6%)
code_origins 47.263 ms [46.843 ms, 47.683 ms] 9.411 ms (24.9%)
iast 45.259 ms [44.858 ms, 45.661 ms] 7.407 ms (19.6%)
profiling 48.675 ms [48.223 ms, 49.128 ms] 10.823 ms (28.6%)
tracing 43.228 ms [42.865 ms, 43.592 ms] 5.376 ms (14.2%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/container-tags-hash-propagation
git_commit_date 1755621799 1755637040
git_commit_sha 27cd7f4 2fcea15
release_version 1.53.0-SNAPSHOT~27cd7f43d9 1.52.0-SNAPSHOT~2fcea15ec8
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1755639118 1755639118
ci_job_id 1088376102 1088376102
ci_pipeline_id 74180981 74180981
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-rzgfqok3 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-rzgfqok3 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 0 performance regressions! Performance is the same for 11 metrics, 0 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:dacapo:tomcat:appsec better
[-1.401ms; -1.061ms] or [-37.811%; -28.633%]
2.474ms 3.705ms
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~2fcea15ec8, baseline=1.53.0-SNAPSHOT~27cd7f43d9
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.223 s) : 15223000, 15223000
.   : milestone, 15223000,
appsec (14.845 s) : 14845000, 14845000
.   : milestone, 14845000,
iast (18.342 s) : 18342000, 18342000
.   : milestone, 18342000,
iast_GLOBAL (18.152 s) : 18152000, 18152000
.   : milestone, 18152000,
profiling (15.786 s) : 15786000, 15786000
.   : milestone, 15786000,
tracing (14.999 s) : 14999000, 14999000
.   : milestone, 14999000,
section candidate
no_agent (15.527 s) : 15527000, 15527000
.   : milestone, 15527000,
appsec (15.018 s) : 15018000, 15018000
.   : milestone, 15018000,
iast (18.303 s) : 18303000, 18303000
.   : milestone, 18303000,
iast_GLOBAL (18.21 s) : 18210000, 18210000
.   : milestone, 18210000,
profiling (15.59 s) : 15590000, 15590000
.   : milestone, 15590000,
tracing (15.056 s) : 15056000, 15056000
.   : milestone, 15056000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.223 s [15.223 s, 15.223 s] -
appsec 14.845 s [14.845 s, 14.845 s] -378.0 ms (-2.5%)
iast 18.342 s [18.342 s, 18.342 s] 3.119 s (20.5%)
iast_GLOBAL 18.152 s [18.152 s, 18.152 s] 2.929 s (19.2%)
profiling 15.786 s [15.786 s, 15.786 s] 563.0 ms (3.7%)
tracing 14.999 s [14.999 s, 14.999 s] -224.0 ms (-1.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.527 s [15.527 s, 15.527 s] -
appsec 15.018 s [15.018 s, 15.018 s] -509.0 ms (-3.3%)
iast 18.303 s [18.303 s, 18.303 s] 2.776 s (17.9%)
iast_GLOBAL 18.21 s [18.21 s, 18.21 s] 2.683 s (17.3%)
profiling 15.59 s [15.59 s, 15.59 s] 63.0 ms (0.4%)
tracing 15.056 s [15.056 s, 15.056 s] -471.0 ms (-3.0%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~2fcea15ec8, baseline=1.53.0-SNAPSHOT~27cd7f43d9
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.482 ms) : 1471, 1494
.   : milestone, 1482,
appsec (3.705 ms) : 3488, 3922
.   : milestone, 3705,
iast (2.213 ms) : 2150, 2275
.   : milestone, 2213,
iast_GLOBAL (2.247 ms) : 2183, 2310
.   : milestone, 2247,
profiling (2.071 ms) : 2018, 2123
.   : milestone, 2071,
tracing (2.024 ms) : 1975, 2073
.   : milestone, 2024,
section candidate
no_agent (1.482 ms) : 1470, 1493
.   : milestone, 1482,
appsec (2.474 ms) : 2421, 2528
.   : milestone, 2474,
iast (2.205 ms) : 2142, 2268
.   : milestone, 2205,
iast_GLOBAL (2.244 ms) : 2181, 2308
.   : milestone, 2244,
profiling (2.062 ms) : 2010, 2113
.   : milestone, 2062,
tracing (2.032 ms) : 1983, 2081
.   : milestone, 2032,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.482 ms [1.471 ms, 1.494 ms] -
appsec 3.705 ms [3.488 ms, 3.922 ms] 2.223 ms (150.0%)
iast 2.213 ms [2.15 ms, 2.275 ms] 730.659 µs (49.3%)
iast_GLOBAL 2.247 ms [2.183 ms, 2.31 ms] 764.526 µs (51.6%)
profiling 2.071 ms [2.018 ms, 2.123 ms] 588.477 µs (39.7%)
tracing 2.024 ms [1.975 ms, 2.073 ms] 541.727 µs (36.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.482 ms [1.47 ms, 1.493 ms] -
appsec 2.474 ms [2.421 ms, 2.528 ms] 992.674 µs (67.0%)
iast 2.205 ms [2.142 ms, 2.268 ms] 723.402 µs (48.8%)
iast_GLOBAL 2.244 ms [2.181 ms, 2.308 ms] 762.964 µs (51.5%)
profiling 2.062 ms [2.01 ms, 2.113 ms] 580.054 µs (39.2%)
tracing 2.032 ms [1.983 ms, 2.081 ms] 550.222 µs (37.1%)

Extract getBaseHash to be available for SQLCommenter

TBD: fix SQLCommenterTest
TBD: add DB_DBM_INJECT_SERVICE_HASH_ENABLED
@ygree ygree removed their assignment Jul 30, 2025
Copy link

datadog-official bot commented Aug 13, 2025

Code coverage: total 57.30%, base diff -0.15%, patch 74.00% (view details)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2fcea15 | Docs | Was this helpful? Give us feedback!

if (sql == null || sql.isEmpty()) {
return sql;
}
if (hasDDComment(sql, appendComment)) {
Copy link
Contributor Author

@ygree ygree Aug 14, 2025

Choose a reason for hiding this comment

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

Move this check to after the appendComment decision is made. Otherwise, it won't work when preferAppend differs from appendComment. This can result in the comment being added twice. Tests were added to ensure this behavior is confirmed.

if (log.isDebugEnabled()) {
log.debug("exception thrown while encoding sql comment %s", e);
}
String encodedValue;
Copy link
Contributor Author

@ygree ygree Aug 14, 2025

Choose a reason for hiding this comment

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

Do the encoding first to handle a possible encoding exception properly; otherwise, in case of an exception, it will inject a key with an unclosed quote.

if (firstWord.equalsIgnoreCase("call")) {
appendComment = true;
}

// Append the comment in the case of a pg_hint_plan extension
if (dbType.startsWith("postgres") && containsPgHint(sql)) {
if (dbType.startsWith("postgres") && sql.contains("/*+")) {
Copy link
Contributor Author

@ygree ygree Aug 14, 2025

Choose a reason for hiding this comment

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

Fix the bug to ensure the hint is detected at the beginning. The original check was sql.indexOf("/*+") > 0. Remove containsPgHint for simplicity. Tests were added to ensure this behavior is confirmed.

if ((!(sql.endsWith(CLOSE_COMMENT)) && appendComment)
|| ((!(sql.startsWith(OPEN_COMMENT))) && !appendComment)) {
return false;
}
// else check to see if it's a DBM trace sql comment
int startIdx = 2;
Copy link
Contributor Author

@ygree ygree Aug 14, 2025

Choose a reason for hiding this comment

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

Replace the magic constant 2.

}
int startComment = appendComment ? startIdx : sql.length();
boolean found = false;
if (startComment > 2) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This condition is useless because it's never true.

@ygree ygree marked this pull request as ready for review August 19, 2025 22:06
@ygree ygree requested review from a team as code owners August 19, 2025 22:06
@ygree ygree requested a review from amarziali August 19, 2025 22:06
Copy link
Contributor

github-actions bot commented Aug 19, 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.

Copy link
Member

@raphaelgavache raphaelgavache left a comment

Choose a reason for hiding this comment

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

nice, lgtm

if (DataStreamsTags.baseHash != 0) {
this.hash = DataStreamsTags.baseHash;
}
this.hash = BaseHash.getBaseHash();
Copy link
Member

Choose a reason for hiding this comment

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

@piochelepiotr I expected baseHash (novice DSM mental model)to be sent twice: pathHash computation and DSM pipeline payload, why is it used only here and this.hash is overwritten? Doesn't it end up with loss of informaiton for DSM backend

String newContainerTagsHash = response.header(DATADOG_CONTAINER_TAGS_HASH);
if (newContainerTagsHash != null) {
ContainerInfo containerInfo = ContainerInfo.get();
if (!newContainerTagsHash.equals(containerInfo.getContainerTagsHash())) {
Copy link

@veerbia veerbia Aug 28, 2025

Choose a reason for hiding this comment

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

The container hash comparison and update are not atomic. Between checking equality and calling recalcBaseHash, I believe that another thread could potentially update the hash.

Maybe we could synchronize the update block by doing something like:

if (newContainerTagsHash != null) {
          ContainerInfo containerInfo = ContainerInfo.get();
          synchronized (containerInfo) {
              String currentHash = containerInfo.getContainerTagsHash();
              if (!newContainerTagsHash.equals(currentHash)) {
                  containerInfo.setContainerTagsHash(newContainerTagsHash);
                  BaseHash.recalcBaseHash(newContainerTagsHash);
              }
          }
      }

if (primaryTag != null) {
builder.append(primaryTag);
}
if (processTags != null) {
Copy link

Choose a reason for hiding this comment

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

When processTags is not null but containerTagsHash is null, we still append to builder, is this intentional? Maybe we could split it up and do a proper null check:

if (processTags != null) {
      builder.append(processTags);
}

if (containerTagsHash != null && !containerTagsHash.isEmpty()) {
      builder.append(containerTagsHash);
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: data streams Data Streams Monitoring comp: database Database Monitoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants