Skip to content

Conversation

ygree
Copy link
Contributor

@ygree ygree commented Mar 19, 2025

What Does This Do

Fix the Play Framework's span resource name priority so that the client JAX-RS 404 cannot override it.

Motivation

Additional Notes

To prevent the resource from being set to 404 by JAX-RS instrumentation, use HTTP_FRAMEWORK_ROUTE priority 3 instead of HTTP_PATH_NORMALIZER priority 1, as HTTP_404 has a lower priority of 2.

This problem was observed in version 1.34.0.

It has been confirmed that this resolves the customer's issue.

Contributor Checklist

Jira ticket: APMS-15752

@ygree ygree self-assigned this Mar 19, 2025
@ygree ygree force-pushed the ygree/fix-play-jaxrs-resource-name-priority branch from 162d4fe to 0e7401c Compare March 20, 2025 00:13
@ygree ygree changed the title Experimental change to prevent JAX-RS instrumentation from overriding play framework span resource names. Fix JAX-RS instrumentation from overriding play framework span resource names. Mar 20, 2025
@mcculls mcculls force-pushed the ygree/fix-play-jaxrs-resource-name-priority branch from 0e7401c to 5608d5b Compare May 8, 2025 11:30
@ygree ygree force-pushed the ygree/fix-play-jaxrs-resource-name-priority branch from 5608d5b to e341f62 Compare May 22, 2025 08:38
Copy link
Contributor

Hi! 👋 Looks like you updated a Git Submodule.
If this was not intentional please make sure to:

@ygree ygree force-pushed the ygree/fix-play-jaxrs-resource-name-priority branch from e341f62 to b2eac2f Compare May 22, 2025 08:40
Copy link
Contributor

Hi! 👋 Looks like you updated a Git Submodule.
If this was not intentional please make sure to:

@ygree ygree changed the base branch from release/v1.34.x to master May 22, 2025 08:40
@pr-commenter
Copy link

pr-commenter bot commented May 22, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/fix-play-jaxrs-resource-name-priority
git_commit_date 1749044153 1749575259
git_commit_sha 7787af7 25257d0
release_version 1.50.0-SNAPSHOT~7787af738f 1.50.0-SNAPSHOT~25257d0c64
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1749577698 1749577698
ci_job_id 975616812 975616812
ci_pipeline_id 67387948 67387948
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-63wmvl1-project-304-concurrent-1-q8i7npwl 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-63wmvl1-project-304-concurrent-1-q8i7npwl 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~25257d0c64, baseline=1.50.0-SNAPSHOT~7787af738f

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.025 s) : 0, 1024849
Total [baseline] (8.516 s) : 0, 8516453
Agent [candidate] (1.032 s) : 0, 1031747
Total [candidate] (8.552 s) : 0, 8551936
section iast
Agent [baseline] (1.15 s) : 0, 1149851
Total [baseline] (9.17 s) : 0, 9169557
Agent [candidate] (1.161 s) : 0, 1160533
Total [candidate] (9.276 s) : 0, 9275588
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.163 s) : 0, 1162670
Total [baseline] (9.209 s) : 0, 9208575
Agent [candidate] (1.155 s) : 0, 1155283
Total [candidate] (9.143 s) : 0, 9142871
section iast_TELEMETRY_OFF
Agent [baseline] (1.147 s) : 0, 1147071
Total [baseline] (9.177 s) : 0, 9177430
Agent [candidate] (1.156 s) : 0, 1156412
Total [candidate] (9.253 s) : 0, 9252942
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.025 s -
Agent iast 1.15 s 125.001 ms (12.2%)
Agent iast_HARDCODED_SECRET_DISABLED 1.163 s 137.821 ms (13.4%)
Agent iast_TELEMETRY_OFF 1.147 s 122.221 ms (11.9%)
Total tracing 8.516 s -
Total iast 9.17 s 653.104 ms (7.7%)
Total iast_HARDCODED_SECRET_DISABLED 9.209 s 692.122 ms (8.1%)
Total iast_TELEMETRY_OFF 9.177 s 660.977 ms (7.8%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.032 s -
Agent iast 1.161 s 128.786 ms (12.5%)
Agent iast_HARDCODED_SECRET_DISABLED 1.155 s 123.535 ms (12.0%)
Agent iast_TELEMETRY_OFF 1.156 s 124.665 ms (12.1%)
Total tracing 8.552 s -
Total iast 9.276 s 723.652 ms (8.5%)
Total iast_HARDCODED_SECRET_DISABLED 9.143 s 590.935 ms (6.9%)
Total iast_TELEMETRY_OFF 9.253 s 701.006 ms (8.2%)
gantt
    title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~25257d0c64, baseline=1.50.0-SNAPSHOT~7787af738f

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (683.25 ms) : 0, 683250
BytebuddyAgent [candidate] (689.091 ms) : 0, 689091
GlobalTracer [baseline] (240.298 ms) : 0, 240298
GlobalTracer [candidate] (241.823 ms) : 0, 241823
AppSec [baseline] (56.367 ms) : 0, 56367
AppSec [candidate] (56.473 ms) : 0, 56473
Debugger [baseline] (6.211 ms) : 0, 6211
Debugger [candidate] (6.247 ms) : 0, 6247
Remote Config [baseline] (739.654 µs) : 0, 740
Remote Config [candidate] (743.508 µs) : 0, 744
Telemetry [baseline] (14.341 ms) : 0, 14341
Telemetry [candidate] (13.616 ms) : 0, 13616
section iast
BytebuddyAgent [baseline] (801.731 ms) : 0, 801731
BytebuddyAgent [candidate] (808.684 ms) : 0, 808684
GlobalTracer [baseline] (230.505 ms) : 0, 230505
GlobalTracer [candidate] (232.739 ms) : 0, 232739
IAST [baseline] (25.227 ms) : 0, 25227
IAST [candidate] (26.378 ms) : 0, 26378
AppSec [baseline] (54.452 ms) : 0, 54452
AppSec [candidate] (54.337 ms) : 0, 54337
Debugger [baseline] (5.955 ms) : 0, 5955
Debugger [candidate] (6.098 ms) : 0, 6098
Remote Config [baseline] (589.843 µs) : 0, 590
Remote Config [candidate] (623.934 µs) : 0, 624
Telemetry [baseline] (7.874 ms) : 0, 7874
Telemetry [candidate] (8.079 ms) : 0, 8079
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (810.69 ms) : 0, 810690
BytebuddyAgent [candidate] (806.307 ms) : 0, 806307
GlobalTracer [baseline] (232.947 ms) : 0, 232947
GlobalTracer [candidate] (231.601 ms) : 0, 231601
IAST [baseline] (27.541 ms) : 0, 27541
IAST [candidate] (25.51 ms) : 0, 25510
AppSec [baseline] (53.16 ms) : 0, 53160
AppSec [candidate] (53.149 ms) : 0, 53149
Debugger [baseline] (6.044 ms) : 0, 6044
Debugger [candidate] (5.913 ms) : 0, 5913
Remote Config [baseline] (608.408 µs) : 0, 608
Remote Config [candidate] (603.856 µs) : 0, 604
Telemetry [baseline] (8.016 ms) : 0, 8016
Telemetry [candidate] (7.886 ms) : 0, 7886
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (799.0 ms) : 0, 799000
BytebuddyAgent [candidate] (805.753 ms) : 0, 805753
GlobalTracer [baseline] (230.753 ms) : 0, 230753
GlobalTracer [candidate] (232.559 ms) : 0, 232559
IAST [baseline] (28.145 ms) : 0, 28145
IAST [candidate] (26.647 ms) : 0, 26647
AppSec [baseline] (51.11 ms) : 0, 51110
AppSec [candidate] (53.143 ms) : 0, 53143
Debugger [baseline] (5.996 ms) : 0, 5996
Debugger [candidate] (6.076 ms) : 0, 6076
Remote Config [baseline] (595.386 µs) : 0, 595
Remote Config [candidate] (631.461 µs) : 0, 631
Telemetry [baseline] (7.943 ms) : 0, 7943
Telemetry [candidate] (7.947 ms) : 0, 7947
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~25257d0c64, baseline=1.50.0-SNAPSHOT~7787af738f

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.033 s) : 0, 1032518
Total [baseline] (11.114 s) : 0, 11113638
Agent [candidate] (1.03 s) : 0, 1029897
Total [candidate] (11.142 s) : 0, 11141741
section appsec
Agent [baseline] (1.162 s) : 0, 1162311
Total [baseline] (11.253 s) : 0, 11252643
Agent [candidate] (1.161 s) : 0, 1160797
Total [candidate] (11.268 s) : 0, 11267638
section iast
Agent [baseline] (1.151 s) : 0, 1151148
Total [baseline] (11.39 s) : 0, 11389763
Agent [candidate] (1.152 s) : 0, 1151749
Total [candidate] (11.327 s) : 0, 11326876
section profiling
Agent [baseline] (1.268 s) : 0, 1268373
Total [baseline] (11.503 s) : 0, 11503302
Agent [candidate] (1.275 s) : 0, 1275437
Total [candidate] (11.579 s) : 0, 11579409
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.033 s -
Agent appsec 1.162 s 129.793 ms (12.6%)
Agent iast 1.151 s 118.63 ms (11.5%)
Agent profiling 1.268 s 235.855 ms (22.8%)
Total tracing 11.114 s -
Total appsec 11.253 s 139.004 ms (1.3%)
Total iast 11.39 s 276.125 ms (2.5%)
Total profiling 11.503 s 389.664 ms (3.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.03 s -
Agent appsec 1.161 s 130.9 ms (12.7%)
Agent iast 1.152 s 121.852 ms (11.8%)
Agent profiling 1.275 s 245.54 ms (23.8%)
Total tracing 11.142 s -
Total appsec 11.268 s 125.897 ms (1.1%)
Total iast 11.327 s 185.136 ms (1.7%)
Total profiling 11.579 s 437.668 ms (3.9%)
gantt
    title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~25257d0c64, baseline=1.50.0-SNAPSHOT~7787af738f

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (688.628 ms) : 0, 688628
BytebuddyAgent [candidate] (688.931 ms) : 0, 688931
GlobalTracer [baseline] (242.207 ms) : 0, 242207
GlobalTracer [candidate] (242.167 ms) : 0, 242167
AppSec [baseline] (58.045 ms) : 0, 58045
AppSec [candidate] (57.615 ms) : 0, 57615
Debugger [baseline] (6.216 ms) : 0, 6216
Debugger [candidate] (6.174 ms) : 0, 6174
Remote Config [baseline] (730.198 µs) : 0, 730
Remote Config [candidate] (728.992 µs) : 0, 729
Telemetry [baseline] (12.854 ms) : 0, 12854
Telemetry [candidate] (10.575 ms) : 0, 10575
section appsec
BytebuddyAgent [baseline] (699.705 ms) : 0, 699705
BytebuddyAgent [candidate] (698.781 ms) : 0, 698781
GlobalTracer [baseline] (237.678 ms) : 0, 237678
GlobalTracer [candidate] (237.209 ms) : 0, 237209
IAST [baseline] (21.761 ms) : 0, 21761
IAST [candidate] (21.705 ms) : 0, 21705
AppSec [baseline] (176.08 ms) : 0, 176080
AppSec [candidate] (176.314 ms) : 0, 176314
Debugger [baseline] (6.36 ms) : 0, 6360
Debugger [candidate] (6.016 ms) : 0, 6016
Remote Config [baseline] (636.257 µs) : 0, 636
Remote Config [candidate] (634.117 µs) : 0, 634
Telemetry [baseline] (7.372 ms) : 0, 7372
Telemetry [candidate] (7.397 ms) : 0, 7397
section iast
BytebuddyAgent [baseline] (802.63 ms) : 0, 802630
BytebuddyAgent [candidate] (802.751 ms) : 0, 802751
GlobalTracer [baseline] (230.812 ms) : 0, 230812
GlobalTracer [candidate] (231.25 ms) : 0, 231250
IAST [baseline] (27.716 ms) : 0, 27716
IAST [candidate] (27.751 ms) : 0, 27751
AppSec [baseline] (51.88 ms) : 0, 51880
AppSec [candidate] (51.825 ms) : 0, 51825
Debugger [baseline] (6.019 ms) : 0, 6019
Debugger [candidate] (5.95 ms) : 0, 5950
Remote Config [baseline] (596.574 µs) : 0, 597
Remote Config [candidate] (594.314 µs) : 0, 594
Telemetry [baseline] (7.978 ms) : 0, 7978
Telemetry [candidate] (7.975 ms) : 0, 7975
section profiling
BytebuddyAgent [baseline] (676.746 ms) : 0, 676746
BytebuddyAgent [candidate] (679.9 ms) : 0, 679900
GlobalTracer [baseline] (361.815 ms) : 0, 361815
GlobalTracer [candidate] (362.576 ms) : 0, 362576
AppSec [baseline] (61.482 ms) : 0, 61482
AppSec [candidate] (62.19 ms) : 0, 62190
Debugger [baseline] (6.058 ms) : 0, 6058
Debugger [candidate] (6.147 ms) : 0, 6147
Remote Config [baseline] (645.549 µs) : 0, 646
Remote Config [candidate] (667.215 µs) : 0, 667
Telemetry [baseline] (8.115 ms) : 0, 8115
Telemetry [candidate] (8.32 ms) : 0, 8320
ProfilingAgent [baseline] (102.69 ms) : 0, 102690
ProfilingAgent [candidate] (104.404 ms) : 0, 104404
Profiling [baseline] (102.714 ms) : 0, 102714
Profiling [candidate] (104.428 ms) : 0, 104428
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-06-10T17:28:38 2025-06-10T17:30:59
git_branch master ygree/fix-play-jaxrs-resource-name-priority
git_commit_date 1749044153 1749575259
git_commit_sha 7787af7 25257d0
release_version 1.50.0-SNAPSHOT~7787af738f 1.50.0-SNAPSHOT~25257d0c64
start_time 2025-06-10T17:25:44 2025-06-10T17:30:12
See matching parameters
Baseline Candidate
application petclinic petclinic
ci_job_date 1749576659 1749576659
ci_job_id 975616813 975616813
ci_pipeline_id 67387948 67387948
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-63wmvl1-project-304-concurrent-2-awsx5tbq 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-63wmvl1-project-304-concurrent-2-awsx5tbq 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
thresholds_or_results results results
variant appsec appsec

Summary

Found 0 performance improvements and 2 performance regressions! Performance is the same for 0 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:no_agent unstable
[+75.164ms; +77.866ms] or [+798.241%; +826.939%]
worse
[-486.110op/s; -451.697op/s] or [-92.361%; -85.822%]
85.931ms 57.413op/s 9.416ms 526.316op/s
scenario:load:petclinic:profiling unstable
[+91.104ms; +94.727ms] or [+1110.934%; +1155.114%]
worse
[-564.649op/s; -541.059op/s] or [-93.873%; -89.951%]
101.116ms 48.650op/s 8.201ms 601.504op/s

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master ygree/fix-play-jaxrs-resource-name-priority
git_commit_date 1749044153 1749575259
git_commit_sha 7787af7 25257d0
release_version 1.50.0-SNAPSHOT~7787af738f 1.50.0-SNAPSHOT~25257d0c64
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1749577162 1749577162
ci_job_id 975616814 975616814
ci_pipeline_id 67387948 67387948
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-pz8nwqvr-project-304-concurrent-0-ursto5gd 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-pz8nwqvr-project-304-concurrent-0-ursto5gd 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant appsec appsec

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.50.0-SNAPSHOT~25257d0c64, baseline=1.50.0-SNAPSHOT~7787af738f
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.993 s) : 14993000, 14993000
.   : milestone, 14993000,
appsec (14.787 s) : 14787000, 14787000
.   : milestone, 14787000,
iast (19.043 s) : 19043000, 19043000
.   : milestone, 19043000,
iast_GLOBAL (17.93 s) : 17930000, 17930000
.   : milestone, 17930000,
profiling (15.322 s) : 15322000, 15322000
.   : milestone, 15322000,
tracing (15.054 s) : 15054000, 15054000
.   : milestone, 15054000,
section candidate
no_agent (15.027 s) : 15027000, 15027000
.   : milestone, 15027000,
appsec (14.584 s) : 14584000, 14584000
.   : milestone, 14584000,
iast (18.203 s) : 18203000, 18203000
.   : milestone, 18203000,
iast_GLOBAL (18.105 s) : 18105000, 18105000
.   : milestone, 18105000,
profiling (15.172 s) : 15172000, 15172000
.   : milestone, 15172000,
tracing (15.205 s) : 15205000, 15205000
.   : milestone, 15205000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.993 s [14.993 s, 14.993 s] -
appsec 14.787 s [14.787 s, 14.787 s] -206.0 ms (-1.4%)
iast 19.043 s [19.043 s, 19.043 s] 4.05 s (27.0%)
iast_GLOBAL 17.93 s [17.93 s, 17.93 s] 2.937 s (19.6%)
profiling 15.322 s [15.322 s, 15.322 s] 329.0 ms (2.2%)
tracing 15.054 s [15.054 s, 15.054 s] 61.0 ms (0.4%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.027 s [15.027 s, 15.027 s] -
appsec 14.584 s [14.584 s, 14.584 s] -443.0 ms (-2.9%)
iast 18.203 s [18.203 s, 18.203 s] 3.176 s (21.1%)
iast_GLOBAL 18.105 s [18.105 s, 18.105 s] 3.078 s (20.5%)
profiling 15.172 s [15.172 s, 15.172 s] 145.0 ms (1.0%)
tracing 15.205 s [15.205 s, 15.205 s] 178.0 ms (1.2%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~25257d0c64, baseline=1.50.0-SNAPSHOT~7787af738f
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.479 ms) : 1467, 1490
.   : milestone, 1479,
appsec (2.407 ms) : 2358, 2455
.   : milestone, 2407,
iast (2.186 ms) : 2125, 2248
.   : milestone, 2186,
iast_GLOBAL (2.228 ms) : 2166, 2290
.   : milestone, 2228,
profiling (2.498 ms) : 2325, 2670
.   : milestone, 2498,
tracing (2.003 ms) : 1956, 2050
.   : milestone, 2003,
section candidate
no_agent (1.475 ms) : 1464, 1487
.   : milestone, 1475,
appsec (2.401 ms) : 2353, 2450
.   : milestone, 2401,
iast (2.189 ms) : 2128, 2250
.   : milestone, 2189,
iast_GLOBAL (2.241 ms) : 2179, 2303
.   : milestone, 2241,
profiling (2.033 ms) : 1983, 2083
.   : milestone, 2033,
tracing (1.999 ms) : 1952, 2046
.   : milestone, 1999,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.479 ms [1.467 ms, 1.49 ms] -
appsec 2.407 ms [2.358 ms, 2.455 ms] 928.051 µs (62.8%)
iast 2.186 ms [2.125 ms, 2.248 ms] 707.829 µs (47.9%)
iast_GLOBAL 2.228 ms [2.166 ms, 2.29 ms] 749.518 µs (50.7%)
profiling 2.498 ms [2.325 ms, 2.67 ms] 1.019 ms (68.9%)
tracing 2.003 ms [1.956 ms, 2.05 ms] 524.157 µs (35.5%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.464 ms, 1.487 ms] -
appsec 2.401 ms [2.353 ms, 2.45 ms] 926.051 µs (62.8%)
iast 2.189 ms [2.128 ms, 2.25 ms] 713.374 µs (48.4%)
iast_GLOBAL 2.241 ms [2.179 ms, 2.303 ms] 765.493 µs (51.9%)
profiling 2.033 ms [1.983 ms, 2.083 ms] 557.253 µs (37.8%)
tracing 1.999 ms [1.952 ms, 2.046 ms] 523.584 µs (35.5%)

@ygree ygree added this to the 1.50.0 milestone Jun 2, 2025
@ygree ygree added type: bug Bug report and fix inst: play framework Play Framework instrumentation inst: jax-rs JAX-RS instrumentation labels Jun 2, 2025
@ygree ygree changed the title Fix JAX-RS instrumentation from overriding play framework span resource names. Fix Play Framework span resource name priority. JAX-RS 404 should not override this. Jun 2, 2025
@ygree ygree changed the title Fix Play Framework span resource name priority. JAX-RS 404 should not override this. Fix the Play Framework's span resource name priority so that the JAX-RS 404 cannot override it. Jun 2, 2025
@ygree ygree removed the inst: jax-rs JAX-RS instrumentation label Jun 2, 2025
@ygree ygree changed the title Fix the Play Framework's span resource name priority so that the JAX-RS 404 cannot override it. Fix the Play Framework's span resource name priority so that the client JAX-RS 404 cannot override it. Jun 2, 2025
@@ -84,7 +84,7 @@ public static void stopTraceOnResponse(
// set the resource name on the upstream akka/netty span if there is one
if (rootSpan != null && playControllerSpan.getResourceName() != null) {
rootSpan.setResourceName(
playControllerSpan.getResourceName(), ResourceNamePriorities.HTTP_PATH_NORMALIZER);
playControllerSpan.getResourceName(), ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use a higher priority to prevent the parent span from being accidentally changed by the JAX-RS instrumentation.

@ygree ygree force-pushed the ygree/fix-play-jaxrs-resource-name-priority branch from 38b46af to a4d72e4 Compare June 10, 2025 05:49
DECORATE.onResponse(span, result.get());
DECORATE.onResponse(span, response);
} else {
DECORATE.updateOn404Only(span, response);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Set the name of the non-found resource name to be used at https://github.com/DataDog/dd-trace-java/pull/8591/files#diff-293ad0cf2c613fd3386ed5b93cd54cbe26b6cd352071e86dc849ccae48f0fda0R87.
This is needed since the Akka HTTP-level response handler uses the standard HTTP_404 priority, which is lower than the HTTP_FRAMEWORK_ROUTE priority that we have set.

@ygree ygree marked this pull request as ready for review June 10, 2025 06:13
@ygree ygree requested review from a team as code owners June 10, 2025 06:13
@ygree ygree requested a review from amarziali June 10, 2025 06:13
@@ -307,16 +307,20 @@ def isJavaVersionAllowedForProperty(JavaVersion version, String propertyPrefix =
def definedMin = project.hasProperty(minProp)
def definedMax = project.hasProperty(maxProp)
if (definedMin && project.getProperty(minProp).compareTo(version) > 0) {
logger.info("isJavaVersionAllowedForProperty is false b/o minProp=${minProp} is defined and greater than version=${version}")
Copy link
Contributor

Choose a reason for hiding this comment

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

are those logs intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They aren't related to the change, but I added them to figure out why Gradle didn't run the tests. They still require the --info parameter, but it's better than nothing in my opinion. There are a few conditions, and the build is silent about not running certain tasks, which might be puzzling unless you remember those conditions and check the current Java version and the module requirements.

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'm fine with dropping them, but since they were useful when I worked on the change, they might be useful to someone else or myself in the future. That's the main reason I want to keep them.

@@ -428,6 +428,16 @@ public byte getResourceNamePriority() {
}

public void setResourceName(final CharSequence resourceName, byte priority) {
if (log.isDebugEnabled()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: that's generally not required since the log debug checks it and does not perform toString or concat (because of {})

@ygree ygree merged commit d56d38c into master Jun 16, 2025
516 of 517 checks passed
@ygree ygree deleted the ygree/fix-play-jaxrs-resource-name-priority branch June 16, 2025 16:51
@PerfectSlayer PerfectSlayer changed the title Fix the Play Framework's span resource name priority so that the client JAX-RS 404 cannot override it. Fix the Play Framework's span resource name priority so that the client JAX-RS 404 cannot override it Jun 20, 2025
svc-squareup-copybara pushed a commit to cashapp/misk that referenced this pull request Jun 20, 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.49.0` -> `1.50.0` |

---

### Release Notes

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

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

### Deprecation Notice

> \[!NOTE]
> `DD_RUNTIME_ID_ENABLED` has been deprecated and will be removed in
future releases. Please use `DD_RUNTIME_METRICS_RUNTIME_ID_ENABLED`
instead.

### Components

#### Application Security Management (WAF)

- 🐛 Add String length truncation limit to ObjectIntrospector and
update truncation metrics
([#&#8203;8825](DataDog/dd-trace-java#8825) -
[@&#8203;jandro996](https://github.com/jandro996))
- 🐛 Adapt standalone ASM to support API Security
([#&#8203;8804](DataDog/dd-trace-java#8804) -
[@&#8203;jandro996](https://github.com/jandro996))
- ✨ Add appsec.waf.input\_truncated metric
([#&#8203;8791](DataDog/dd-trace-java#8791) -
[@&#8203;jandro996](https://github.com/jandro996))
- ✨ Extended appsec request body collection
([#&#8203;8748](DataDog/dd-trace-java#8748) -
[@&#8203;jandro996](https://github.com/jandro996))
- ✨ Extended appsec request/response headers collection
([#&#8203;8724](DataDog/dd-trace-java#8724) -
[@&#8203;jandro996](https://github.com/jandro996))

#### Build & Tooling

- ✨ Add artifacts to public s3 bucket
([#&#8203;8947](DataDog/dd-trace-java#8947) -
[@&#8203;randomanderson](https://github.com/randomanderson))

#### Continuous Integration Visibility

- ✨ Improve PR information building
([#&#8203;8908](DataDog/dd-trace-java#8908) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- ✨ Truncate span stack traces when Test Optimization is
enabled
([#&#8203;8903](DataDog/dd-trace-java#8903) -
[@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog))
- 🐛 Ensure auto-detected service name is the same for every process
in the same build
([#&#8203;8902](DataDog/dd-trace-java#8902) -
[@&#8203;nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog))
- 🐛 Use tag as fallback in api requests if no branch is available
([#&#8203;8876](DataDog/dd-trace-java#8876) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- ✨ Add support for JUnit 5.13-RC1
([#&#8203;8865](DataDog/dd-trace-java#8865),
[#&#8203;8871](DataDog/dd-trace-java#8871) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- ✨ Implement attempt to fix v3 and v4 and bump capability
version
([#&#8203;8824](DataDog/dd-trace-java#8824) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- 🧹 Align retry logic for all test framework instrumentations
([#&#8203;8803](DataDog/dd-trace-java#8803) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- 🐛 Always build ci workspace without trailing separator
([#&#8203;8788](DataDog/dd-trace-java#8788) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))
- ✨ Add commit discrepancies telemetry when building repository
git information
([#&#8203;8763](DataDog/dd-trace-java#8763) -
[@&#8203;daniel-mohedano](https://github.com/daniel-mohedano))

#### Data Streams Monitoring

- 💡 Surface process tags in dsm payloads and use them for base hash
calculation
([#&#8203;8836](DataDog/dd-trace-java#8836) -
[@&#8203;amarziali](https://github.com/amarziali))

#### Dynamic Instrumentation

- ✨ Optimized allocations for collection filter functions
([#&#8203;8896](DataDog/dd-trace-java#8896) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- 🐛 Fix SymDB upload size check
([#&#8203;8887](DataDog/dd-trace-java#8887) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- 🐛 Add support for Set in filter function
([#&#8203;8873](DataDog/dd-trace-java#8873) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- 🐛 Add support for isDefined in log template
([#&#8203;8859](DataDog/dd-trace-java#8859) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- 🐛 Fix Max captured frames for Exception Replay
([#&#8203;8856](DataDog/dd-trace-java#8856) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- 🐛 Remove static inherited fields collection
([#&#8203;8832](DataDog/dd-trace-java#8832) -
[@&#8203;jpbempel](https://github.com/jpbempel))
- 💡 Add process tags to dynamic instrumentation intake payload
([#&#8203;8779](DataDog/dd-trace-java#8779) -
[@&#8203;amarziali](https://github.com/amarziali))

#### GraalVM native-image

- ✨ Add support for GraalVM Native GC metrics
([#&#8203;8913](DataDog/dd-trace-java#8913) -
[@&#8203;ygree](https://github.com/ygree))
- ✨ Add JMXFetch support for GraalVM Native
([#&#8203;8569](DataDog/dd-trace-java#8569) -
[@&#8203;ygree](https://github.com/ygree))

#### JMX fetch

- ✨ Add support for GraalVM Native GC metrics
([#&#8203;8913](DataDog/dd-trace-java#8913) -
[@&#8203;ygree](https://github.com/ygree))

#### Library Injection

- ✨ Deny oracle db jvm based tools
([#&#8203;8909](DataDog/dd-trace-java#8909) -
[@&#8203;bric3](https://github.com/bric3))

#### OpenTracing

- 🐛 Fix OT packaging for exception replay
([#&#8203;8912](DataDog/dd-trace-java#8912) -
[@&#8203;jpbempel](https://github.com/jpbempel))

#### Profiling

- ✨ Bump ddprof to 1.27.0
([#&#8203;8893](DataDog/dd-trace-java#8893) -
[@&#8203;jbachorik](https://github.com/jbachorik))
- Properly handle the adaptive sampling interval overflow by
[@&#8203;jbachorik](https://github.com/jbachorik) in
DataDog/java-profiler#213
- Fix [#&#8203;200](DataDog/dd-trace-java#200)
Crash related to aligned\_alloc and free in context by
[@&#8203;yanglong1010](https://github.com/yanglong1010) in
DataDog/java-profiler#208
- Explicitly initialize empty context page by
[@&#8203;jbachorik](https://github.com/jbachorik) in
DataDog/java-profiler#210
- Re-connect crash recursion protection with VM stackwalker by
[@&#8203;jbachorik](https://github.com/jbachorik) in
DataDog/java-profiler#214
- ✨ Enable ZSTD compression for profiling
([#&#8203;8862](DataDog/dd-trace-java#8862) -
[@&#8203;MattAlp](https://github.com/MattAlp))
- ✨ Extend JPS re-implementation to J9 family
([#&#8203;8813](DataDog/dd-trace-java#8813) -
[@&#8203;MattAlp](https://github.com/MattAlp))
- 💡 Collect process tags for profiling upload requests
([#&#8203;8780](DataDog/dd-trace-java#8780) -
[@&#8203;amarziali](https://github.com/amarziali))

#### Telemetry

- 💡 Surface process tags on telemetry payloads
([#&#8203;8837](DataDog/dd-trace-java#8837) -
[@&#8203;amarziali](https://github.com/amarziali))

#### Trace context propagation

- ✨ Migrating all HttpClient Instrumentations to Inject Full
Context
([#&#8203;8826](DataDog/dd-trace-java#8826) -
[@&#8203;mhlidd](https://github.com/mhlidd))
- ✨ Migrating all HttpServer Instrumentations to Extract full
Context
([#&#8203;8820](DataDog/dd-trace-java#8820) -
[@&#8203;mhlidd](https://github.com/mhlidd))
- ✨ Add context API support OTel propagators
([#&#8203;8770](DataDog/dd-trace-java#8770) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))

#### Tracer core

- ✨⚡ Skip JAXB generated classes classloader
([#&#8203;9003](DataDog/dd-trace-java#9003) -
[@&#8203;bric3](https://github.com/bric3))
- ✨ Add DD\_RUNTIME\_METRICS\_RUNTIME\_ID\_ENABLED alias for
runtime id generation
([#&#8203;8981](DataDog/dd-trace-java#8981) -
[@&#8203;amarziali](https://github.com/amarziali))
- 🐛 Use resolved address for peer.hostname when available without
hitting the cache
([#&#8203;8915](DataDog/dd-trace-java#8915) -
[@&#8203;amarziali](https://github.com/amarziali))
- 💡 Surface server name process tag for tomcat
([#&#8203;8894](DataDog/dd-trace-java#8894) -
[@&#8203;amarziali](https://github.com/amarziali))
- 💡 Surface websphere cell and server name on process tags
([#&#8203;8880](DataDog/dd-trace-java#8880) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Added special lightweight pre-main class that skips
installation on incompatible JVMs.
([#&#8203;8855](DataDog/dd-trace-java#8855) -
[@&#8203;AlexeyKuznetsov-DD](https://github.com/AlexeyKuznetsov-DD))
- 💡 Add entrypoint type to process tags
([#&#8203;8839](DataDog/dd-trace-java#8839) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Extend JPS re-implementation to J9 family
([#&#8203;8813](DataDog/dd-trace-java#8813) -
[@&#8203;MattAlp](https://github.com/MattAlp))
- ✨ Notify listeners when the scope top changes after switching
scope stacks
([#&#8203;8797](DataDog/dd-trace-java#8797) -
[@&#8203;mcculls](https://github.com/mcculls))
- ✨ Read hsperfdata for Java PIDs if jvmstat is unavailable
([#&#8203;8792](DataDog/dd-trace-java#8792) -
[@&#8203;MattAlp](https://github.com/MattAlp))
- 🐛 Turn JDK socket support on by default
([#&#8203;8752](DataDog/dd-trace-java#8752) -
[@&#8203;sarahchen6](https://github.com/sarahchen6))
- ✨ Simplify context propagation
([#&#8203;8719](DataDog/dd-trace-java#8719) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))
- ✨ Add JSON parsing support
([#&#8203;8579](DataDog/dd-trace-java#8579) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))

#### Tracer internal logging

- ✨ Fix printing format of span identifiers
([#&#8203;8897](DataDog/dd-trace-java#8897) -
[@&#8203;vandonr](https://github.com/vandonr))

#### Tracer public API

- 💡 Track the source of installation
([#&#8203;8956](DataDog/dd-trace-java#8956) -
[@&#8203;mabdinur](https://github.com/mabdinur))
- ✨ Enforce size limit on application\_monitoring.yaml files
([#&#8203;8789](DataDog/dd-trace-java#8789) -
[@&#8203;mtoffl01](https://github.com/mtoffl01))
- ✨ Enabling baggage cache to support limits and non-ascii
characters
([#&#8203;8713](DataDog/dd-trace-java#8713) -
[@&#8203;mhlidd](https://github.com/mhlidd))

### Instrumentations

#### AWS Lambda instrumentation

- ✨ Pass Lambda Request ID to Extension
([#&#8203;8814](DataDog/dd-trace-java#8814) -
[@&#8203;nhulston](https://github.com/nhulston))

#### Core Java language instrumentation

- ✨ Ensure ClassloadingInstrumentation is always applied even
with `DD_TRACE_ENABLED=false`
([#&#8203;8863](DataDog/dd-trace-java#8863) -
[@&#8203;mcculls](https://github.com/mcculls))

#### Eclipse Vert.x instrumentation

- 🐛 Do not override route with / in vertx instrumentation
([#&#8203;8881](DataDog/dd-trace-java#8881) -
[@&#8203;vandonr](https://github.com/vandonr))

#### IBM Liberty

- 🐛 Fix error mark on http status for IBM liberty
([#&#8203;8822](DataDog/dd-trace-java#8822) -
[@&#8203;amarziali](https://github.com/amarziali))

#### JDBC instrumentation

- 🐛 Do not prepend DBM <> APM trace comment in SQLCommenter if there
is a pg plan hint
([#&#8203;8864](DataDog/dd-trace-java#8864) -
[@&#8203;edengorevoy](https://github.com/edengorevoy))

#### JMS instrumentation

- ✨ Add jms as an extra integration name where there is JMS
involved
([#&#8203;8933](DataDog/dd-trace-java#8933) -
[@&#8203;vandonr](https://github.com/vandonr))

#### Kotlin instrumentation

- ✨ Enable kotlin\_coroutine integration by default
([#&#8203;8848](DataDog/dd-trace-java#8848) -
[@&#8203;mcculls](https://github.com/mcculls))
- 🧹 Rework Kotlin coroutines instrumentation around coroutine
context
([#&#8203;8774](DataDog/dd-trace-java#8774) -
[@&#8203;mcculls](https://github.com/mcculls))

#### OpenTelemetry instrumentation

- 🐛 Support WithSpan inheritContext attribute
([#&#8203;8858](DataDog/dd-trace-java#8858) -
[@&#8203;amarziali](https://github.com/amarziali))
- ✨ Add context API support OTel propagators
([#&#8203;8770](DataDog/dd-trace-java#8770) -
[@&#8203;PerfectSlayer](https://github.com/PerfectSlayer))

#### Play Framework instrumentation

- 🐛 Fix the Play Framework's span resource name priority so that the
client JAX-RS 404 cannot override it
([#&#8203;8591](DataDog/dd-trace-java#8591) -
[@&#8203;ygree](https://github.com/ygree))

#### Quarkus Instrumentation

- 🐛 Ignore quarkus jaxrs stubs and cdi wrapper proxies
([#&#8203;8891](DataDog/dd-trace-java#8891) -
[@&#8203;amarziali](https://github.com/amarziali))

#### ServiceTalk

- ✨ Improve ServiceTalk Captured Context API Instrumentation
for v0.42.56+
([#&#8203;8821](DataDog/dd-trace-java#8821) -
[@&#8203;ygree](https://github.com/ygree))

#### Spring instrumentation

- ✨ Supporting Baggage for Instrumentations used in Weblog
Tests
([#&#8203;8773](DataDog/dd-trace-java#8773) -
[@&#8203;mhlidd](https://github.com/mhlidd))

#### WebSocket Instrumentation

- 💡 Trace websocket for spring webflux reactive handlers
([#&#8203;8831](DataDog/dd-trace-java#8831) -
[@&#8203;amarziali](https://github.com/amarziali))
- 💡:test\_tube: WebSocket support for Netty
([#&#8203;8632](DataDog/dd-trace-java#8632) -
[@&#8203;ValentinZakharov](https://github.com/ValentinZakharov))

#### Zio Instrumentation

- 🧹 Cleanup Zio fiber instrumentation to avoid repeated activation
of continuation
([#&#8203;8798](DataDog/dd-trace-java#8798) -
[@&#8203;mcculls](https://github.com/mcculls))

</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: 9207366cdb6a1bd098082305d354a0a3c4622d7a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inst: play framework Play Framework instrumentation type: bug Bug report and fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants