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 1756932532 1756951453
git_commit_sha 91f4636 23ef6fd
release_version 1.53.0-SNAPSHOT~91f463686c 1.52.0-SNAPSHOT~23ef6fd9d3
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1756953287 1756953287
ci_job_id 1112665572 1112665572
ci_pipeline_id 75497455 75497455
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-wuehms9q 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-wuehms9q 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 48 metrics, 11 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.52.0-SNAPSHOT~23ef6fd9d3, baseline=1.53.0-SNAPSHOT~91f463686c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.048 s) : 0, 1047614
Total [baseline] (8.611 s) : 0, 8610836
Agent [candidate] (1.05 s) : 0, 1049767
Total [candidate] (8.646 s) : 0, 8645925
section iast
Agent [baseline] (1.177 s) : 0, 1177037
Total [baseline] (9.31 s) : 0, 9309742
Agent [candidate] (1.178 s) : 0, 1178284
Total [candidate] (9.379 s) : 0, 9378827
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.048 s -
Agent iast 1.177 s 129.423 ms (12.4%)
Total tracing 8.611 s -
Total iast 9.31 s 698.906 ms (8.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.05 s -
Agent iast 1.178 s 128.517 ms (12.2%)
Total tracing 8.646 s -
Total iast 9.379 s 732.902 ms (8.5%)
gantt
    title insecure-bank - break down per module: candidate=1.52.0-SNAPSHOT~23ef6fd9d3, baseline=1.53.0-SNAPSHOT~91f463686c

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.459 ms) : 0, 1459
crashtracking [candidate] (1.466 ms) : 0, 1466
BytebuddyAgent [baseline] (733.915 ms) : 0, 733915
BytebuddyAgent [candidate] (736.331 ms) : 0, 736331
GlobalTracer [baseline] (242.299 ms) : 0, 242299
GlobalTracer [candidate] (242.582 ms) : 0, 242582
AppSec [baseline] (29.996 ms) : 0, 29996
AppSec [candidate] (30.049 ms) : 0, 30049
Debugger [baseline] (6.047 ms) : 0, 6047
Debugger [candidate] (6.063 ms) : 0, 6063
Remote Config [baseline] (682.636 µs) : 0, 683
Remote Config [candidate] (681.281 µs) : 0, 681
Telemetry [baseline] (12.235 ms) : 0, 12235
Telemetry [candidate] (11.531 ms) : 0, 11531
section iast
crashtracking [baseline] (1.448 ms) : 0, 1448
crashtracking [candidate] (1.449 ms) : 0, 1449
BytebuddyAgent [baseline] (850.111 ms) : 0, 850111
BytebuddyAgent [candidate] (851.66 ms) : 0, 851660
GlobalTracer [baseline] (232.133 ms) : 0, 232133
GlobalTracer [candidate] (231.897 ms) : 0, 231897
IAST [baseline] (29.399 ms) : 0, 29399
IAST [candidate] (31.749 ms) : 0, 31749
AppSec [baseline] (26.711 ms) : 0, 26711
AppSec [candidate] (24.31 ms) : 0, 24310
Debugger [baseline] (7.362 ms) : 0, 7362
Debugger [candidate] (7.518 ms) : 0, 7518
Remote Config [baseline] (612.822 µs) : 0, 613
Remote Config [candidate] (591.997 µs) : 0, 592
Telemetry [baseline] (8.216 ms) : 0, 8216
Telemetry [candidate] (8.158 ms) : 0, 8158
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.52.0-SNAPSHOT~23ef6fd9d3, baseline=1.53.0-SNAPSHOT~91f463686c

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.046 s) : 0, 1045791
Total [baseline] (10.615 s) : 0, 10614667
Agent [candidate] (1.051 s) : 0, 1051305
Total [candidate] (10.835 s) : 0, 10834540
section appsec
Agent [baseline] (1.234 s) : 0, 1233639
Total [baseline] (10.895 s) : 0, 10895496
Agent [candidate] (1.223 s) : 0, 1222987
Total [candidate] (10.8 s) : 0, 10800394
section iast
Agent [baseline] (1.181 s) : 0, 1181140
Total [baseline] (10.944 s) : 0, 10943660
Agent [candidate] (1.178 s) : 0, 1177706
Total [candidate] (10.883 s) : 0, 10882695
section profiling
Agent [baseline] (1.199 s) : 0, 1198536
Total [baseline] (10.852 s) : 0, 10852406
Agent [candidate] (1.21 s) : 0, 1210370
Total [candidate] (10.997 s) : 0, 10996863
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.046 s -
Agent appsec 1.234 s 187.847 ms (18.0%)
Agent iast 1.181 s 135.348 ms (12.9%)
Agent profiling 1.199 s 152.744 ms (14.6%)
Total tracing 10.615 s -
Total appsec 10.895 s 280.829 ms (2.6%)
Total iast 10.944 s 328.993 ms (3.1%)
Total profiling 10.852 s 237.739 ms (2.2%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.051 s -
Agent appsec 1.223 s 171.682 ms (16.3%)
Agent iast 1.178 s 126.401 ms (12.0%)
Agent profiling 1.21 s 159.065 ms (15.1%)
Total tracing 10.835 s -
Total appsec 10.8 s -34.146 ms (-0.3%)
Total iast 10.883 s 48.154 ms (0.4%)
Total profiling 10.997 s 162.323 ms (1.5%)
gantt
    title petclinic - break down per module: candidate=1.52.0-SNAPSHOT~23ef6fd9d3, baseline=1.53.0-SNAPSHOT~91f463686c

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.451 ms) : 0, 1451
crashtracking [candidate] (1.464 ms) : 0, 1464
BytebuddyAgent [baseline] (731.434 ms) : 0, 731434
BytebuddyAgent [candidate] (737.138 ms) : 0, 737138
GlobalTracer [baseline] (242.12 ms) : 0, 242120
GlobalTracer [candidate] (243.175 ms) : 0, 243175
AppSec [baseline] (30.087 ms) : 0, 30087
AppSec [candidate] (30.205 ms) : 0, 30205
Debugger [baseline] (6.065 ms) : 0, 6065
Debugger [candidate] (6.112 ms) : 0, 6112
Remote Config [baseline] (673.091 µs) : 0, 673
Remote Config [candidate] (684.366 µs) : 0, 684
Telemetry [baseline] (12.942 ms) : 0, 12942
Telemetry [candidate] (11.368 ms) : 0, 11368
section appsec
crashtracking [baseline] (1.458 ms) : 0, 1458
crashtracking [candidate] (1.453 ms) : 0, 1453
BytebuddyAgent [baseline] (763.033 ms) : 0, 763033
BytebuddyAgent [candidate] (756.35 ms) : 0, 756350
GlobalTracer [baseline] (236.989 ms) : 0, 236989
GlobalTracer [candidate] (233.917 ms) : 0, 233917
IAST [baseline] (23.868 ms) : 0, 23868
IAST [candidate] (23.51 ms) : 0, 23510
AppSec [baseline] (169.561 ms) : 0, 169561
AppSec [candidate] (167.712 ms) : 0, 167712
Debugger [baseline] (5.828 ms) : 0, 5828
Debugger [candidate] (7.388 ms) : 0, 7388
Remote Config [baseline] (650.005 µs) : 0, 650
Remote Config [candidate] (639.495 µs) : 0, 639
Telemetry [baseline] (10.956 ms) : 0, 10956
Telemetry [candidate] (10.955 ms) : 0, 10955
section iast
crashtracking [baseline] (1.457 ms) : 0, 1457
crashtracking [candidate] (1.455 ms) : 0, 1455
BytebuddyAgent [baseline] (851.772 ms) : 0, 851772
BytebuddyAgent [candidate] (850.683 ms) : 0, 850683
GlobalTracer [baseline] (233.662 ms) : 0, 233662
GlobalTracer [candidate] (231.821 ms) : 0, 231821
IAST [baseline] (27.897 ms) : 0, 27897
IAST [candidate] (28.501 ms) : 0, 28501
AppSec [baseline] (29.552 ms) : 0, 29552
AppSec [candidate] (28.682 ms) : 0, 28682
Debugger [baseline] (6.663 ms) : 0, 6663
Debugger [candidate] (6.678 ms) : 0, 6678
Remote Config [baseline] (613.938 µs) : 0, 614
Remote Config [candidate] (597.933 µs) : 0, 598
Telemetry [baseline] (8.364 ms) : 0, 8364
Telemetry [candidate] (8.264 ms) : 0, 8264
section profiling
crashtracking [baseline] (1.433 ms) : 0, 1433
crashtracking [candidate] (1.442 ms) : 0, 1442
BytebuddyAgent [baseline] (762.343 ms) : 0, 762343
BytebuddyAgent [candidate] (768.305 ms) : 0, 768305
GlobalTracer [baseline] (223.333 ms) : 0, 223333
GlobalTracer [candidate] (224.818 ms) : 0, 224818
AppSec [baseline] (29.973 ms) : 0, 29973
AppSec [candidate] (31.218 ms) : 0, 31218
Debugger [baseline] (6.304 ms) : 0, 6304
Debugger [candidate] (6.397 ms) : 0, 6397
Remote Config [baseline] (712.617 µs) : 0, 713
Remote Config [candidate] (750.726 µs) : 0, 751
Telemetry [baseline] (16.42 ms) : 0, 16420
Telemetry [candidate] (16.696 ms) : 0, 16696
ProfilingAgent [baseline] (107.646 ms) : 0, 107646
ProfilingAgent [candidate] (109.969 ms) : 0, 109969
Profiling [baseline] (108.312 ms) : 0, 108312
Profiling [candidate] (110.636 ms) : 0, 110636
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/container-tags-hash-propagation
git_commit_date 1756932532 1756951453
git_commit_sha 91f4636 23ef6fd
release_version 1.53.0-SNAPSHOT~91f463686c 1.52.0-SNAPSHOT~23ef6fd9d3
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1756952958 1756952958
ci_job_id 1112665573 1112665573
ci_pipeline_id 75497455 75497455
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-xotga1ou 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-xotga1ou 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 1 performance regressions! Performance is the same for 11 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:petclinic:appsec:high_load worse
[+3.225ms; +4.147ms] or [+6.928%; +8.907%]
unstable
[-14.246op/s; -0.529op/s] or [-14.170%; -0.526%]
50.242ms 93.150op/s 46.556ms 100.537op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~23ef6fd9d3, baseline=1.53.0-SNAPSHOT~91f463686c
    dateFormat X
    axisFormat %s
section baseline
no_agent (37.652 ms) : 37342, 37962
.   : milestone, 37652,
appsec (46.556 ms) : 46145, 46967
.   : milestone, 46556,
code_origins (45.745 ms) : 45337, 46152
.   : milestone, 45745,
iast (44.853 ms) : 44474, 45233
.   : milestone, 44853,
profiling (48.525 ms) : 48054, 48996
.   : milestone, 48525,
tracing (42.765 ms) : 42409, 43121
.   : milestone, 42765,
section candidate
no_agent (37.334 ms) : 37031, 37638
.   : milestone, 37334,
appsec (50.242 ms) : 49797, 50686
.   : milestone, 50242,
code_origins (46.8 ms) : 46389, 47210
.   : milestone, 46800,
iast (45.701 ms) : 45319, 46082
.   : milestone, 45701,
profiling (48.383 ms) : 47857, 48908
.   : milestone, 48383,
tracing (43.301 ms) : 42931, 43670
.   : milestone, 43301,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.652 ms [37.342 ms, 37.962 ms] -
appsec 46.556 ms [46.145 ms, 46.967 ms] 8.904 ms (23.6%)
code_origins 45.745 ms [45.337 ms, 46.152 ms] 8.093 ms (21.5%)
iast 44.853 ms [44.474 ms, 45.233 ms] 7.201 ms (19.1%)
profiling 48.525 ms [48.054 ms, 48.996 ms] 10.873 ms (28.9%)
tracing 42.765 ms [42.409 ms, 43.121 ms] 5.113 ms (13.6%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 37.334 ms [37.031 ms, 37.638 ms] -
appsec 50.242 ms [49.797 ms, 50.686 ms] 12.907 ms (34.6%)
code_origins 46.8 ms [46.389 ms, 47.21 ms] 9.465 ms (25.4%)
iast 45.701 ms [45.319 ms, 46.082 ms] 8.366 ms (22.4%)
profiling 48.383 ms [47.857 ms, 48.908 ms] 11.048 ms (29.6%)
tracing 43.301 ms [42.931 ms, 43.67 ms] 5.966 ms (16.0%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.52.0-SNAPSHOT~23ef6fd9d3, baseline=1.53.0-SNAPSHOT~91f463686c
    dateFormat X
    axisFormat %s
section baseline
no_agent (4.171 ms) : 4120, 4222
.   : milestone, 4171,
iast (9.493 ms) : 9334, 9652
.   : milestone, 9493,
iast_FULL (13.525 ms) : 13259, 13791
.   : milestone, 13525,
iast_GLOBAL (10.182 ms) : 9995, 10368
.   : milestone, 10182,
profiling (8.812 ms) : 8676, 8949
.   : milestone, 8812,
tracing (7.703 ms) : 7586, 7821
.   : milestone, 7703,
section candidate
no_agent (4.29 ms) : 4243, 4338
.   : milestone, 4290,
iast (9.4 ms) : 9243, 9557
.   : milestone, 9400,
iast_FULL (13.562 ms) : 13290, 13833
.   : milestone, 13562,
iast_GLOBAL (10.31 ms) : 10129, 10491
.   : milestone, 10310,
profiling (8.687 ms) : 8546, 8828
.   : milestone, 8687,
tracing (7.564 ms) : 7458, 7670
.   : milestone, 7564,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.171 ms [4.12 ms, 4.222 ms] -
iast 9.493 ms [9.334 ms, 9.652 ms] 5.322 ms (127.6%)
iast_FULL 13.525 ms [13.259 ms, 13.791 ms] 9.354 ms (224.3%)
iast_GLOBAL 10.182 ms [9.995 ms, 10.368 ms] 6.011 ms (144.1%)
profiling 8.812 ms [8.676 ms, 8.949 ms] 4.641 ms (111.3%)
tracing 7.703 ms [7.586 ms, 7.821 ms] 3.532 ms (84.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 4.29 ms [4.243 ms, 4.338 ms] -
iast 9.4 ms [9.243 ms, 9.557 ms] 5.11 ms (119.1%)
iast_FULL 13.562 ms [13.29 ms, 13.833 ms] 9.271 ms (216.1%)
iast_GLOBAL 10.31 ms [10.129 ms, 10.491 ms] 6.02 ms (140.3%)
profiling 8.687 ms [8.546 ms, 8.828 ms] 4.397 ms (102.5%)
tracing 7.564 ms [7.458 ms, 7.67 ms] 3.274 ms (76.3%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/container-tags-hash-propagation
git_commit_date 1756932532 1756951453
git_commit_sha 91f4636 23ef6fd
release_version 1.53.0-SNAPSHOT~91f463686c 1.52.0-SNAPSHOT~23ef6fd9d3
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1756953490 1756953490
ci_job_id 1112665574 1112665574
ci_pipeline_id 75497455 75497455
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-lf9n8ts1 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-lf9n8ts1 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 tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~23ef6fd9d3, baseline=1.53.0-SNAPSHOT~91f463686c
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.475 ms) : 1463, 1486
.   : milestone, 1475,
appsec (3.682 ms) : 3466, 3898
.   : milestone, 3682,
iast (2.207 ms) : 2144, 2270
.   : milestone, 2207,
iast_GLOBAL (2.26 ms) : 2196, 2324
.   : milestone, 2260,
profiling (2.048 ms) : 1997, 2098
.   : milestone, 2048,
tracing (2.03 ms) : 1981, 2079
.   : milestone, 2030,
section candidate
no_agent (1.472 ms) : 1461, 1484
.   : milestone, 1472,
appsec (3.672 ms) : 3455, 3889
.   : milestone, 3672,
iast (2.209 ms) : 2146, 2273
.   : milestone, 2209,
iast_GLOBAL (2.25 ms) : 2187, 2313
.   : milestone, 2250,
profiling (2.058 ms) : 2007, 2109
.   : milestone, 2058,
tracing (2.03 ms) : 1981, 2079
.   : milestone, 2030,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.463 ms, 1.486 ms] -
appsec 3.682 ms [3.466 ms, 3.898 ms] 2.207 ms (149.6%)
iast 2.207 ms [2.144 ms, 2.27 ms] 732.263 µs (49.7%)
iast_GLOBAL 2.26 ms [2.196 ms, 2.324 ms] 784.969 µs (53.2%)
profiling 2.048 ms [1.997 ms, 2.098 ms] 573.155 µs (38.9%)
tracing 2.03 ms [1.981 ms, 2.079 ms] 555.292 µs (37.7%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.472 ms [1.461 ms, 1.484 ms] -
appsec 3.672 ms [3.455 ms, 3.889 ms] 2.199 ms (149.4%)
iast 2.209 ms [2.146 ms, 2.273 ms] 736.933 µs (50.0%)
iast_GLOBAL 2.25 ms [2.187 ms, 2.313 ms] 777.726 µs (52.8%)
profiling 2.058 ms [2.007 ms, 2.109 ms] 585.331 µs (39.8%)
tracing 2.03 ms [1.981 ms, 2.079 ms] 557.197 µs (37.8%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.52.0-SNAPSHOT~23ef6fd9d3, baseline=1.53.0-SNAPSHOT~91f463686c
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.599 s) : 15599000, 15599000
.   : milestone, 15599000,
appsec (14.852 s) : 14852000, 14852000
.   : milestone, 14852000,
iast (18.74 s) : 18740000, 18740000
.   : milestone, 18740000,
iast_GLOBAL (18.219 s) : 18219000, 18219000
.   : milestone, 18219000,
profiling (15.366 s) : 15366000, 15366000
.   : milestone, 15366000,
tracing (14.724 s) : 14724000, 14724000
.   : milestone, 14724000,
section candidate
no_agent (15.575 s) : 15575000, 15575000
.   : milestone, 15575000,
appsec (14.689 s) : 14689000, 14689000
.   : milestone, 14689000,
iast (18.157 s) : 18157000, 18157000
.   : milestone, 18157000,
iast_GLOBAL (18.256 s) : 18256000, 18256000
.   : milestone, 18256000,
profiling (15.574 s) : 15574000, 15574000
.   : milestone, 15574000,
tracing (14.927 s) : 14927000, 14927000
.   : milestone, 14927000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.599 s [15.599 s, 15.599 s] -
appsec 14.852 s [14.852 s, 14.852 s] -747.0 ms (-4.8%)
iast 18.74 s [18.74 s, 18.74 s] 3.141 s (20.1%)
iast_GLOBAL 18.219 s [18.219 s, 18.219 s] 2.62 s (16.8%)
profiling 15.366 s [15.366 s, 15.366 s] -233.0 ms (-1.5%)
tracing 14.724 s [14.724 s, 14.724 s] -875.0 ms (-5.6%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.575 s [15.575 s, 15.575 s] -
appsec 14.689 s [14.689 s, 14.689 s] -886.0 ms (-5.7%)
iast 18.157 s [18.157 s, 18.157 s] 2.582 s (16.6%)
iast_GLOBAL 18.256 s [18.256 s, 18.256 s] 2.681 s (17.2%)
profiling 15.574 s [15.574 s, 15.574 s] -1.0 ms (-0.0%)
tracing 14.927 s [14.927 s, 14.927 s] -648.0 ms (-4.2%)

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
Patch Coverage: 75.00%
Total Coverage: 57.60% (-0.03%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 23ef6fd | 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.


// 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.

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

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);
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!
@raphaelgavache @piochelepiotr Should we include containerTagsHash in the baseHash calculation if processTags are missing?

Copy link
Member

Choose a reason for hiding this comment

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

No that's a good point, containerHash should be added when process tags are present, especially to release both together. When the process tags FF is enabled, there are always process tags sent

I'm currently trying to get enough coverage of process tags in our backend to enable it by default soon

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

Choose a reason for hiding this comment

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

I think that the info endpoint cannot be called concurrently so perhaps this might be avoided

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 it needs an eye from DSM to double check. Also the JDBC tests looks failing since dbm related code has been changed

@ygree ygree added the type: enhancement Enhancements and improvements label Sep 2, 2025
@ygree ygree added this to the 1.53.0 milestone Sep 3, 2025
@ygree ygree merged commit 673fcc5 into master Sep 4, 2025
503 checks passed
@ygree ygree deleted the ygree/container-tags-hash-propagation branch September 4, 2025 03:28
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Sep 4, 2025
| Package | Type | Package file | Manager | Update | Change |
|---|---|---|---|---|---|
| [com.datadoghq:dd-trace-api](https://github.com/datadog/dd-trace-java)
| dependencies | misk/gradle/libs.versions.toml | gradle | minor |
`1.52.1` -> `1.53.0` |

---

### Release Notes

<details>
<summary>datadog/dd-trace-java (com.datadoghq:dd-trace-api)</summary>

###
[`v1.53.0`](https://github.com/DataDog/dd-trace-java/releases/tag/v1.53.0):
1.53.0

### Components

#### Application Security Management (WAF)

- 🐛 Fix NullPointerException log in AppSec
([#&#8203;9355](DataDog/dd-trace-java#9355) -
[@&#8203;jandro996](https://github.com/jandro996))
- ✨ Add Forwarded header as a source to client IP resolution
([#&#8203;9310](DataDog/dd-trace-java#9310) -
[@&#8203;jandro996](https://github.com/jandro996))

#### Build & Tooling

- 📖 Update CODEOWNERS
([#&#8203;9294](DataDog/dd-trace-java#9294) -
[@&#8203;mhlidd](https://github.com/mhlidd))
- ✨ Add dependency on Maven Central deployment to OCI publish
jobs
([#&#8203;9204](DataDog/dd-trace-java#9204) -
[@&#8203;sarahchen6](https://github.com/sarahchen6))

#### Continuous Integration Visibility

- ✨ Upload code coverage reports to Datadog
([#&#8203;9425](DataDog/dd-trace-java#9425) -
[@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog))
- ✨⚡ Do not follow symlinks by default when building
repository index
([#&#8203;9318](DataDog/dd-trace-java#9318) -
[@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog))
- ✨ Improve tag propagation between test event levels
([#&#8203;9278](DataDog/dd-trace-java#9278) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))

#### Data Streams Monitoring

- ✨ Create container hash tags propagation
([#&#8203;9282](DataDog/dd-trace-java#9282) -
[@&#8203;ygree](https://github.com/ygree))

#### Database Monitoring

- 🐛 Prevent crash in SQL Server's JDBC when tracing execute methods
with generated keys
([#&#8203;9321](DataDog/dd-trace-java#9321) -
[@&#8203;na-ji](https://github.com/na-ji))
- ✨ Create container hash tags propagation
([#&#8203;9282](DataDog/dd-trace-java#9282) -
[@&#8203;ygree](https://github.com/ygree))

#### GraalVM native-image

- 🐛 Update GraalVM config to reflect TempLocationManager's new
package
([#&#8203;9337](DataDog/dd-trace-java#9337) -
[@&#8203;luneo7](https://github.com/luneo7) - thanks for the
contribution!)

#### Metrics

- 🐛 Add reflect config for CSS and graalvm
([#&#8203;9449](DataDog/dd-trace-java#9449) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Align CSS health metrics
([#&#8203;9444](DataDog/dd-trace-java#9444) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Aggregate peer tags for consumer span kind
([#&#8203;9442](DataDog/dd-trace-java#9442) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Implement health metrics for client stats
([#&#8203;9377](DataDog/dd-trace-java#9377) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Add peer tags, span kind and trace root flag to MetricKey
bucket
([#&#8203;9178](DataDog/dd-trace-java#9178) -
[@&#8203;bric3](https://github.com/bric3))

#### Profiling

- ✨ Create a profile flare reporter (requires tracing or CI vis
to be enabled)
([#&#8203;9433](DataDog/dd-trace-java#9433) -
[@&#8203;MattAlp](https://github.com/MattAlp))
- 🐛 Properly fall-back on UDS profiling URL
([#&#8203;9401](DataDog/dd-trace-java#9401) -
[@&#8203;jbachorik](https://github.com/jbachorik))
- 🐛 Properly handle trace agent IPv6 URL in profiling
([#&#8203;9334](DataDog/dd-trace-java#9334) -
[@&#8203;jbachorik](https://github.com/jbachorik))

#### Realtime User Monitoring

- 🐛 Avoid multiple injections on dispatch on jboss
([#&#8203;9392](DataDog/dd-trace-java#9392) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Support async servlet for RUM injection
([#&#8203;9333](DataDog/dd-trace-java#9333) -
[@&#8203;amarziali](https://github.com/amarziali))
- 🐛 Improve RUM injection matching and avoid truncating responses
([#&#8203;9323](DataDog/dd-trace-java#9323) -
[@&#8203;amarziali](https://github.com/amarziali))
- 💡 Add telemetry for the RUM injector
([#&#8203;9267](DataDog/dd-trace-java#9267) -
[@&#8203;sarahchen6](https://github.com/sarahchen6))
- ✨ Make rum injector stream/writer more resilient to errors
([#&#8203;9184](DataDog/dd-trace-java#9184) -
[@&#8203;amarziali](https://github.com/amarziali))

#### Telemetry

- 🐛 Remediate error logs
([#&#8203;9459](DataDog/dd-trace-java#9459) -
[@&#8203;ygree](https://github.com/ygree))
- ✨ Report config\_id for Hands Off Config files
([#&#8203;9299](DataDog/dd-trace-java#9299) -
[@&#8203;mtoffl01](https://github.com/mtoffl01))
- ✨ Adding Config Inversion Telemetry component
([#&#8203;9244](DataDog/dd-trace-java#9244) -
[@&#8203;mhlidd](https://github.com/mhlidd))

#### Trace context propagation

- 🧹 Migrate instrumentations to Context API
([#&#8203;9384](DataDog/dd-trace-java#9384),
[#&#8203;9378](DataDog/dd-trace-java#9378),
[#&#8203;9358](DataDog/dd-trace-java#9358) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))
- ✨🔍 Add baggage propagation telemetry
([#&#8203;9289](DataDog/dd-trace-java#9289) -
[@&#8203;rachelyangdog](https://github.com/rachelyangdog))
- 🧹 Improve Instrumenter API to use Context instead of Span
([#&#8203;9211](DataDog/dd-trace-java#9211) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))

#### Tracer core

- 💡:test\_tube: Enable process level tags for java 21 applications
([#&#8203;9458](DataDog/dd-trace-java#9458) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Move base and peer service adder before span is published
([#&#8203;9408](DataDog/dd-trace-java#9408) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Add ErrorPriorities level for manual instrumentation
([#&#8203;9387](DataDog/dd-trace-java#9387) -
[@&#8203;cecile75](https://github.com/cecile75))
- ✨ Throw InvalidBooleanValueException in
ConfigConverter.booleanValueOf
([#&#8203;9370](DataDog/dd-trace-java#9370) -
[@&#8203;mtoffl01](https://github.com/mtoffl01))
- 🐛 Avoid NPE on featureDiscovery creation
([#&#8203;9353](DataDog/dd-trace-java#9353) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Stable Config improvements
([#&#8203;9259](DataDog/dd-trace-java#9259) -
[@&#8203;mtoffl01](https://github.com/mtoffl01))

### Instrumentations

#### gRPC instrumentation

- 🐛 Changing GRPC instrumentation codes from `status.code` to
`grpc.status.code`
([#&#8203;9367](DataDog/dd-trace-java#9367) -
[@&#8203;mhlidd](https://github.com/mhlidd))

#### JDBC instrumentation

- 🐛 Prevent crash in SQL Server's JDBC when tracing execute methods
with generated keys
([#&#8203;9321](DataDog/dd-trace-java#9321) -
[@&#8203;na-ji](https://github.com/na-ji))

#### Kotlin instrumentation

- 🐛 Take defensive copy of original scope stack when restoring on
different thread
([#&#8203;9403](DataDog/dd-trace-java#9403) -
[@&#8203;mcculls](https://github.com/mcculls))

#### OpenTelemetry instrumentation

- 🐛 Fix using SpanAttribute annotation on multiple parameters
([#&#8203;9412](DataDog/dd-trace-java#9412) -
[@&#8203;cecile75](https://github.com/cecile75))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am
every weekday" in timezone Australia/Melbourne, Automerge - At any time
(no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

GitOrigin-RevId: e23ec866cef91afc6b5226d5f0dc7da538d947e8
@Benchmark
public void testToComment() {
StringBuilder stringBuilder = new StringBuilder();
SQLCommenter.toComment(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it because it has no value. It only tests the performance of the StringBuilder.

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 type: enhancement Enhancements and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants