-
Notifications
You must be signed in to change notification settings - Fork 306
Instrument Jetty websocket pojo #8562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
184045b
to
617189f
Compare
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/AdviceShader.java
Outdated
Show resolved
Hide resolved
88e09fb
to
7d49987
Compare
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 7 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.48.0-SNAPSHOT~03a01afa7b, baseline=1.48.0-SNAPSHOT~fe9f968edb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.042 s) : 0, 1042171
Total [baseline] (10.492 s) : 0, 10492314
Agent [candidate] (1.044 s) : 0, 1044070
Total [candidate] (10.473 s) : 0, 10473342
section appsec
Agent [baseline] (1.184 s) : 0, 1184453
Total [baseline] (10.759 s) : 0, 10758562
Agent [candidate] (1.186 s) : 0, 1185624
Total [candidate] (10.715 s) : 0, 10715116
section iast
Agent [baseline] (1.174 s) : 0, 1174434
Total [baseline] (11.001 s) : 0, 11000740
Agent [candidate] (1.175 s) : 0, 1174957
Total [candidate] (11.032 s) : 0, 11032173
section profiling
Agent [baseline] (1.265 s) : 0, 1264886
Total [baseline] (10.875 s) : 0, 10875110
Agent [candidate] (1.262 s) : 0, 1261993
Total [candidate] (10.801 s) : 0, 10801491
gantt
title petclinic - break down per module: candidate=1.48.0-SNAPSHOT~03a01afa7b, baseline=1.48.0-SNAPSHOT~fe9f968edb
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (717.565 ms) : 0, 717565
BytebuddyAgent [candidate] (719.178 ms) : 0, 719178
GlobalTracer [baseline] (239.38 ms) : 0, 239380
GlobalTracer [candidate] (240.125 ms) : 0, 240125
AppSec [baseline] (54.958 ms) : 0, 54958
AppSec [candidate] (54.686 ms) : 0, 54686
Remote Config [baseline] (699.415 µs) : 0, 699
Remote Config [candidate] (683.643 µs) : 0, 684
Telemetry [baseline] (13.58 ms) : 0, 13580
Telemetry [candidate] (13.484 ms) : 0, 13484
section appsec
BytebuddyAgent [baseline] (736.316 ms) : 0, 736316
BytebuddyAgent [candidate] (737.445 ms) : 0, 737445
GlobalTracer [baseline] (236.267 ms) : 0, 236267
GlobalTracer [candidate] (236.311 ms) : 0, 236311
IAST [baseline] (21.435 ms) : 0, 21435
IAST [candidate] (21.508 ms) : 0, 21508
AppSec [baseline] (176.261 ms) : 0, 176261
AppSec [candidate] (175.458 ms) : 0, 175458
Remote Config [baseline] (664.381 µs) : 0, 664
Remote Config [candidate] (668.878 µs) : 0, 669
Telemetry [baseline] (8.311 ms) : 0, 8311
Telemetry [candidate] (9.05 ms) : 0, 9050
section iast
BytebuddyAgent [baseline] (840.19 ms) : 0, 840190
BytebuddyAgent [candidate] (840.396 ms) : 0, 840396
GlobalTracer [baseline] (230.343 ms) : 0, 230343
GlobalTracer [candidate] (230.533 ms) : 0, 230533
IAST [baseline] (23.577 ms) : 0, 23577
IAST [candidate] (22.78 ms) : 0, 22780
AppSec [baseline] (55.147 ms) : 0, 55147
AppSec [candidate] (55.985 ms) : 0, 55985
Remote Config [baseline] (608.489 µs) : 0, 608
Remote Config [candidate] (603.537 µs) : 0, 604
Telemetry [baseline] (8.701 ms) : 0, 8701
Telemetry [candidate] (8.693 ms) : 0, 8693
section profiling
BytebuddyAgent [baseline] (712.718 ms) : 0, 712718
BytebuddyAgent [candidate] (710.718 ms) : 0, 710718
GlobalTracer [baseline] (349.868 ms) : 0, 349868
GlobalTracer [candidate] (350.747 ms) : 0, 350747
AppSec [baseline] (54.232 ms) : 0, 54232
AppSec [candidate] (53.553 ms) : 0, 53553
Remote Config [baseline] (705.34 µs) : 0, 705
Remote Config [candidate] (698.157 µs) : 0, 698
Telemetry [baseline] (8.873 ms) : 0, 8873
Telemetry [candidate] (8.989 ms) : 0, 8989
ProfilingAgent [baseline] (96.828 ms) : 0, 96828
ProfilingAgent [candidate] (95.786 ms) : 0, 95786
Profiling [baseline] (96.854 ms) : 0, 96854
Profiling [candidate] (95.81 ms) : 0, 95810
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.48.0-SNAPSHOT~03a01afa7b, baseline=1.48.0-SNAPSHOT~fe9f968edb
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.05 s) : 0, 1050359
Total [baseline] (8.731 s) : 0, 8730819
Agent [candidate] (1.044 s) : 0, 1043903
Total [candidate] (8.649 s) : 0, 8649038
section iast
Agent [baseline] (1.171 s) : 0, 1170651
Total [baseline] (9.24 s) : 0, 9240231
Agent [candidate] (1.175 s) : 0, 1174926
Total [candidate] (9.254 s) : 0, 9253624
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.173 s) : 0, 1173360
Total [baseline] (9.202 s) : 0, 9201574
Agent [candidate] (1.189 s) : 0, 1189239
Total [candidate] (9.225 s) : 0, 9225055
section iast_TELEMETRY_OFF
Agent [baseline] (1.179 s) : 0, 1178853
Total [baseline] (9.252 s) : 0, 9251528
Agent [candidate] (1.189 s) : 0, 1189317
Total [candidate] (9.309 s) : 0, 9308735
gantt
title insecure-bank - break down per module: candidate=1.48.0-SNAPSHOT~03a01afa7b, baseline=1.48.0-SNAPSHOT~fe9f968edb
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (723.587 ms) : 0, 723587
BytebuddyAgent [candidate] (720.05 ms) : 0, 720050
GlobalTracer [baseline] (241.461 ms) : 0, 241461
GlobalTracer [candidate] (239.637 ms) : 0, 239637
AppSec [baseline] (55.337 ms) : 0, 55337
AppSec [candidate] (54.8 ms) : 0, 54800
Remote Config [baseline] (708.755 µs) : 0, 709
Remote Config [candidate] (672.947 µs) : 0, 673
Telemetry [baseline] (13.184 ms) : 0, 13184
Telemetry [candidate] (12.817 ms) : 0, 12817
section iast
BytebuddyAgent [baseline] (836.733 ms) : 0, 836733
BytebuddyAgent [candidate] (840.314 ms) : 0, 840314
GlobalTracer [baseline] (229.595 ms) : 0, 229595
GlobalTracer [candidate] (230.522 ms) : 0, 230522
IAST [baseline] (22.986 ms) : 0, 22986
IAST [candidate] (22.953 ms) : 0, 22953
AppSec [baseline] (56.045 ms) : 0, 56045
AppSec [candidate] (55.899 ms) : 0, 55899
Remote Config [baseline] (611.623 µs) : 0, 612
Remote Config [candidate] (663.206 µs) : 0, 663
Telemetry [baseline] (8.733 ms) : 0, 8733
Telemetry [candidate] (8.714 ms) : 0, 8714
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (837.346 ms) : 0, 837346
BytebuddyAgent [candidate] (851.336 ms) : 0, 851336
GlobalTracer [baseline] (230.686 ms) : 0, 230686
GlobalTracer [candidate] (232.577 ms) : 0, 232577
IAST [baseline] (23.919 ms) : 0, 23919
IAST [candidate] (23.474 ms) : 0, 23474
AppSec [baseline] (56.001 ms) : 0, 56001
AppSec [candidate] (56.287 ms) : 0, 56287
Remote Config [baseline] (617.134 µs) : 0, 617
Remote Config [candidate] (613.384 µs) : 0, 613
Telemetry [baseline] (8.835 ms) : 0, 8835
Telemetry [candidate] (8.83 ms) : 0, 8830
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (842.666 ms) : 0, 842666
BytebuddyAgent [candidate] (851.242 ms) : 0, 851242
GlobalTracer [baseline] (231.29 ms) : 0, 231290
GlobalTracer [candidate] (232.885 ms) : 0, 232885
IAST [baseline] (22.721 ms) : 0, 22721
IAST [candidate] (22.832 ms) : 0, 22832
AppSec [baseline] (56.736 ms) : 0, 56736
AppSec [candidate] (56.795 ms) : 0, 56795
Remote Config [baseline] (623.089 µs) : 0, 623
Remote Config [candidate] (632.614 µs) : 0, 633
Telemetry [baseline] (8.697 ms) : 0, 8697
Telemetry [candidate] (8.798 ms) : 0, 8798
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 16 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~03a01afa7b, baseline=1.48.0-SNAPSHOT~fe9f968edb
dateFormat X
axisFormat %s
section baseline
no_agent (382.098 µs) : 362, 402
. : milestone, 382,
iast (513.834 µs) : 492, 536
. : milestone, 514,
iast_FULL (738.722 µs) : 716, 761
. : milestone, 739,
iast_GLOBAL (560.27 µs) : 538, 582
. : milestone, 560,
iast_HARDCODED_SECRET_DISABLED (524.252 µs) : 502, 547
. : milestone, 524,
iast_INACTIVE (470.198 µs) : 449, 492
. : milestone, 470,
iast_TELEMETRY_OFF (503.18 µs) : 481, 525
. : milestone, 503,
tracing (458.546 µs) : 438, 479
. : milestone, 459,
section candidate
no_agent (388.508 µs) : 369, 408
. : milestone, 389,
iast (520.596 µs) : 499, 543
. : milestone, 521,
iast_FULL (735.614 µs) : 713, 758
. : milestone, 736,
iast_GLOBAL (570.884 µs) :
8000
549, 593
. : milestone, 571,
iast_HARDCODED_SECRET_DISABLED (521.17 µs) : 499, 543
. : milestone, 521,
iast_INACTIVE (474.265 µs) : 453, 496
. : milestone, 474,
iast_TELEMETRY_OFF (499.14 µs) : 478, 521
. : milestone, 499,
tracing (477.192 µs) : 456, 499
. : milestone, 477,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.48.0-SNAPSHOT~03a01afa7b, baseline=1.48.0-SNAPSHOT~fe9f968edb
dateFormat X
axisFormat %s
section baseline
no_agent (1.364 ms) : 1344, 1384
. : milestone, 1364,
appsec (1.738 ms) : 1714, 1762
. : milestone, 1738,
appsec_no_iast (1.757 ms) : 1733, 1781
. : milestone, 1757,
code_origins (1.698 ms) : 1671, 1725
. : milestone, 1698,
iast (1.522 ms) : 1497, 1547
. : milestone, 1522,
profiling (1.566 ms) : 1540, 1591
. : milestone, 1566,
tracing (1.52 ms) : 1496, 1544
. : milestone, 1520,
section candidate
no_agent (1.359 ms) : 1339, 1378
. : milestone, 1359,
appsec (1.731 ms) : 1708, 1755
. : milestone, 1731,
appsec_no_iast (1.75 ms) : 1725, 1774
. : milestone, 1750,
code_origins (1.702 ms) : 1675, 1728
. : milestone, 1702,
iast (1.518 ms) : 1493, 1542
. : milestone, 1518,
profiling (1.533 ms) : 1509, 1556
. : milestone, 1533,
tracing (1.498 ms) : 1473, 1524
. : milestone, 1498,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~03a01afa7b, baseline=1.48.0-SNAPSHOT~fe9f968edb
dateFormat X
axisFormat %s
section baseline
no_agent (1.478 ms) : 1467, 1489
. : milestone, 1478,
appsec (2.359 ms) : 2315, 2403
. : milestone, 2359,
iast (2.132 ms) : 2076, 2188
. : milestone, 2132,
iast_GLOBAL (2.169 ms) : 2113, 2225
. : milestone, 2169,
profiling (2.46 ms) : 2278, 2643
. : milestone, 2460,
tracing (1.97 ms) : 1927, 2013
. : milestone, 1970,
section candidate
no_agent (1.478 ms) : 1467, 1490
. : milestone, 1478,
appsec (2.359 ms) : 2315, 2403
. : milestone, 2359,
iast (2.128 ms) : 2072, 2183
. : milestone, 2128,
iast_GLOBAL (2.171 ms) : 2115, 2227
. : milestone, 2171,
profiling (1.973 ms) : 1929, 2017
. : milestone, 1973,
tracing (1.958 ms) : 1916, 2001
. : milestone, 1958,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.48.0-SNAPSHOT~03a01afa7b, baseline=1.48.0-SNAPSHOT~fe9f968edb
dateFormat X
axisFormat %s
section baseline
no_agent (15.031 s) : 15031000, 15031000
. : milestone, 15031000,
appsec (14.955 s) : 14955000, 14955000
. : milestone, 14955000,
iast (18.938 s) : 18938000, 18938000
. : milestone, 18938000,
iast_GLOBAL (17.878 s) : 17878000, 17878000
. : milestone, 17878000,
profiling (14.847 s) : 14847000, 14847000
. : milestone, 14847000,
tracing (15.231 s) : 15231000, 15231000
. : milestone, 15231000,
section candidate
no_agent (15.3 s) : 15300000, 15300000
. : milestone, 15300000,
appsec (14.849 s) : 14849000, 14849000
. : milestone, 14849000,
iast (18.508 s) : 18508000, 18508000
. : milestone, 18508000,
iast_GLOBAL (17.667 s) : 17667000, 17667000
. : milestone, 17667000,
profiling (15.042 s) : 15042000, 15042000
. : milestone, 15042000,
tracing (15.275 s) : 15275000, 15275000
. : milestone, 15275000,
|
a83c33a
to
49a2bec
Compare
cb50a9f
to
049b1b0
Compare
DECORATE.onFrameEnd(closeContext); | ||
} | ||
} else { | ||
delegate.invoke(session, closeReason); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to know if we are missing handlerContext assuming these handlers are successfully installed? I mean, could the fact that handlerContext is null highlight a problem that we would like to know about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered add a logging here however the fact that the context is not there is just before we failed capturing the handshake span (or because the feature is just disabled). So adding a log here did not add valuable information in my opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thank you for the explanation.
...et-10/src/main/java11/datadog/trace/instrumentation/websocket/jetty10/SyntheticEndpoint.java
Outdated
Show resolved
Hide resolved
...ket-10/src/main/java11/datadog/trace/instrumentation/websocket/jetty10/WebSocketAdvices.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it looks good to me, with small suggestions on how to improve clarity for the reader.
MethodHandleWrappers.OPEN_METHOD_HANDLE, | ||
0, | ||
openHandle, | ||
InstrumentationContext.get(Session.class, HandlerContext.Sender.class), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a pity that we don't rewrite helpers so we could leverage contexts in cases like this 😢
} | ||
|
||
@Override | ||
public Map<String, String> adviceShading() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know about this guy, nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a gift from @mcculls ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although a more informed review is needed.
P.S. Great job with the java.lang.invoke
work in the PR! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! It was also interesting to see some new instrumentation approaches you used in the PR. Congratulations on completing another WS instrumentation!
| Package | Type | Package file | Manager | Update | Change | |---|---|---|---|---|---| | org.flywaydb.flyway | plugin | misk/gradle/libs.versions.toml | gradle | minor | `11.6.0` -> `11.7.0` | | [com.squareup.okio:okio-fakefilesystem](https://github.com/square/okio) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `3.10.2` -> `3.11.0` | | [com.squareup.okio:okio](https://github.com/square/okio) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `3.10.2` -> `3.11.0` | | [com.autonomousapps.dependency-analysis](https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin) | plugin | misk/gradle/libs.versions.toml | gradle | minor | `2.15.0` -> `2.16.0` | | [com.datadoghq:dd-trace-api](https://github.com/datadog/dd-trace-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.47.3` -> `1.48.1` | | [com.datadoghq:dd-trace-ot](https://github.com/datadog/dd-trace-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.47.3` -> `1.48.1` | | [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.18` -> `2.31.20` | | [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.18` -> `2.31.20` | | [software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.18` -> `2.31.20` | | [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.18` -> `2.31.20` | | [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.18` -> `2.31.20` | | [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.18` -> `2.31.20` | | [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.18` -> `2.31.20` | --- ### Release Notes <details> <summary>square/okio (com.squareup.okio:okio-fakefilesystem)</summary> ### [`v3.11.0`](https://github.com/square/okio/blob/HEAD/CHANGELOG.md#Version-3110) *2025-04-09* - Fix: Clear the deflater's byte array reference - New: Faster implementation of `String.decodeHex()` on Kotlin/JS. - New: Declare `EXACTLY_ONCE` execution for blocks like `Closeable.use {}` and `FileSystem.read {}`. - Upgrade: \[Kotlin 2.1.20]\[kotlin\_2\_1\_20]. </details> <details> <summary>autonomousapps/dependency-analysis-android-gradle-plugin (com.autonomousapps.dependency-analysis)</summary> ### [`v2.16.0`](https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/blob/HEAD/CHANGELOG.md#Version-2160) - \[Feat]: support `com.android.test` projects. - \[Feat]: support typesafe project accessors with opt-in. ```kotlin dependencyAnalysis { useTypesafeProjectAccessors(true) // false by default } ``` </details> <details> <summary>datadog/dd-trace-java (com.datadoghq:dd-trace-api)</summary> ### [`v1.48.1`](https://github.com/DataDog/dd-trace-java/releases/tag/v1.48.1): 1.48.1 ### Components #### Tracer internal logging - 🐛 Remove print line causing unnecessary logs ([#​8687](DataDog/dd-trace-java#8687) - [@​sarahchen6](https://github.com/sarahchen6)) ### [`v1.48.0`](https://github.com/DataDog/dd-trace-java/releases/tag/v1.48.0): 1.48.0 ### Known Bugs > \[!NOTE] > If you are experiencing issues with spamming timeout logs, please update to the [latest version](https://github.com/DataDog/dd-trace-java/releases/latest) or set [JDK_SOCKET_ENABLED](https://github.com/DataDog/dd-trace-java/blob/33fc3c9a9b7cda3beda88b8b3e5224ae2b10764a/dd-trace-api/src/main/java/datadog/trace/api/config/GeneralConfig.java#L98) to false. ### Components #### Application Security Management (IAST) - ✨ Fix vulnerability location org.jose4j.lang.HashUtil ([#​8610](DataDog/dd-trace-java#8610) - [@​jandro996](https://github.com/jandro996)) - ✨ Fix weak randomness in oracle.ucp.util.OpaqueString ([#​8609](DataDog/dd-trace-java#8609) - [@​jandro996](https://github.com/jandro996)) - ✨ Fix weak hash false positive in oracle.security.o5logon.O5Logon ([#​8608](DataDog/dd-trace-java#8608) - [@​jandro996](https://github.com/jandro996)) - 🐛 Prevent before callsites targeting constructors in super calls ([#​8549](DataDog/dd-trace-java#8549) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) #### Application Security Management (WAF) - ✨ Update login events public SDK to V2 ([#​8620](DataDog/dd-trace-java#8620) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - 🐛 Send RASP LFI capability only when AppSec is statically enabled ([#​8573](DataDog/dd-trace-java#8573) - [@​jandro996](https://github.com/jandro996)) - ✨ Improve detection of missing request end events ([#​8510](DataDog/dd-trace-java#8510) - [@​smola](https://github.com/smola)) - 🧹 Remove remote configuration for API Security sampling rate ([#​8486](DataDog/dd-trace-java#8486) - [@​smola](https://github.com/smola)) - ✨ Add setUser to user monitoring SDK ([#​8482](DataDog/dd-trace-java#8482) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Add missing address for signup event ([#​8469](DataDog/dd-trace-java#8469) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Allow login events SDK to be used with appsec disabled ([#​8464](DataDog/dd-trace-java#8464) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Add support for endpoint discovery in spring mvc ([#​8352](DataDog/dd-trace-java#8352) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ New API Security sampling algorithm ([#​8178](DataDog/dd-trace-java#8178) - [@​ValentinZakharov](https://github.com/ValentinZakharov)) #### Build & Tooling - ✨ Add buffer size customizability to JDK UDS support ([#​8629](DataDog/dd-trace-java#8629) - [@​sarahchen6](https://github.com/sarahchen6)) - ✨ Add JDK built-in support for UDS on Java 16+ ([#​8314](DataDog/dd-trace-java#8314) - [@​sarahchen6](https://github.com/sarahchen6)) #### Configuration at Runtime - 🐛 Send RASP LFI capability only when AppSec is statically enabled ([#​8573](DataDog/dd-trace-java#8573) - [@​jandro996](https://github.com/jandro996)) #### Continuous Integration Visibility - 🐛 Prevent double reporting of Scalatest events when using SBT with test forking ([#​8682](DataDog/dd-trace-java#8682) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🐛 Shutdown CI Visibility test event handlers before tracer ([#​8677](DataDog/dd-trace-java#8677) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🐛 Do not apply JUnit 4 instrumentation to MUnit runners ([#​8675](DataDog/dd-trace-java#8675), [#​8683](DataDog/dd-trace-java#8683) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - ✨ Remove error log when source path resolution fails on isModified check ([#​8663](DataDog/dd-trace-java#8663) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Implement tests reordering for JUnit 4 ([#​8650](DataDog/dd-trace-java#8650) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - 🐛 Set default Attempt to Fix retries if none provided from the backend ([#​8615](DataDog/dd-trace-java#8615) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Allow to manually set PR info ([#​8566](DataDog/dd-trace-java#8566) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🐛 Fix Test Optimization init when repo root cannot be determined ([#​8533](DataDog/dd-trace-java#8533) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - ✨ Add capabilities tagging ([#​8499](DataDog/dd-trace-java#8499), [#​8540](DataDog/dd-trace-java#8540) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) #### Crash tracking - 🐛 Remove dependency on bash from crash/oome uploder scripts ([#​8652](DataDog/dd-trace-java#8652) - [@​jbachorik](https://github.com/jbachorik)) #### Data Streams Monitoring - ✨ e2e pipeline configuration when data jobs is enabled ([#​8553](DataDog/dd-trace-java#8553) - [@​kr-igor](https://github.com/kr-igor)) #### Dynamic Instrumentation - 🐛 Fix In-Product when config is empty ([#​8679](DataDog/dd-trace-java#8679) - [@​jpbempel](https://github.com/jpbempel)) - ✨ Add support for filtering shaded third-party libs ([#​8612](DataDog/dd-trace-java#8612) - [@​jpbempel](https://github.com/jpbempel)) - ✨ Add In-Product Enablement ([#​8587](DataDog/dd-trace-java#8587) - [@​jpbempel](https://github.com/jpbempel)) - ✨⚡ Reduce footprint of SourceFile tracking ([#​8524](DataDog/dd-trace-java#8524) - [@​jpbempel](https://github.com/jpbempel)) - ✨⚡ Optimize the SourceFile tracking ([#​8520](DataDog/dd-trace-java#8520) - [@​jpbempel](https://github.com/jpbempel)) #### OpenTracing - 🧹 Remove activeScope() use in OpenTracing shim ([#​8478](DataDog/dd-trace-java#8478) - [@​mcculls](https://github.com/mcculls)) #### Profiling - ✨ Add profiler env check command to AgentCLI ([#​8671](DataDog/dd-trace-java#8671) - [@​jbachorik](https://github.com/jbachorik)) - ✨ Bump ddprof to 1.23.0 ([#​8668](DataDog/dd-trace-java#8668) - [@​jbachorik](https://github.com/jbachorik)) - Fix a crash related to ElfParser::loadSymbolTable ([#​191](DataDog/dd-trace-java#191)) by [@​yanglong1010](https://github.com/yanglong1010) in DataDog/java-profiler#192 - Unwind String.indexOf intrinsic on AArch64 by [@​MattAlp](https://github.com/MattAlp) in DataDog/java-profiler#193 - Fix Java 24 support by [@​jbachorik](https://github.com/jbachorik) in DataDog/java-profiler#194 - A set of fixes related to clang, aarch64 and musl pecularities of vmstructs stack unwinder by [@​jbachorik](https://github.com/jbachorik) in DataDog/java-profiler#199 - 🐛 Remove process information from JFR recording ([#​8661](DataDog/dd-trace-java#8661) - [@​r1viollet](https://github.com/r1viollet)) - 🐛 Make TempLocationManager USER aware ([#​8605](DataDog/dd-trace-java#8605) - [@​jbachorik](https://github.com/jbachorik)) - ✨ Extract git tags from embedded git.properties and datadog_git.properties ([#​8561](DataDog/dd-trace-java#8561) - [@​wmouchere](https://github.com/wmouchere)) #### Telemetry - 🐛 Fix appsec.rasp.error and appsec.waf.error telemetry metrics ([#​8624](DataDog/dd-trace-java#8624) - [@​jandro996](https://github.com/jandro996)) - ✨ Create metric: appsec.rasp.rule.skipped ([#​8618](DataDog/dd-trace-java#8618) - [@​jandro996](https://github.com/jandro996)) - ✨ Extract git tags from embedded git.properties and datadog_git.properties ([#​8561](DataDog/dd-trace-java#8561) - [@​wmouchere](https://github.com/wmouchere)) #### Testing - 🧹 Simplify ssi tests one-pipeline ([#​8558](DataDog/dd-trace-java#8558) - [@​robertomonteromiguel](https://github.com/robertomonteromiguel)) - ✨ Add smoke tests for java's concurrent API ([#​8438](DataDog/dd-trace-java#8438) - [@​sarahchen6](https://github.com/sarahchen6)) #### Trace context propagation - ✨ Adding Support for `TRACE_PROPAGATION_BEHAVIOR_EXTRACT` ([#​8535](DataDog/dd-trace-java#8535) - [@​mhlidd](https://github.com/mhlidd)) #### Tracer core - 🐛 Ensure shaded helpers have unique names ([#​8559](DataDog/dd-trace-java#8559) - [@​amarziali](https://github.com/amarziali)) - ✨ Support common config sources for user-provided git info ([#​8547](DataDog/dd-trace-java#8547) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - ✨ Make the default config sources more robust when a security manager is installed ([#​8544](DataDog/dd-trace-java#8544) - [@​mcculls](https://github.com/mcculls)) - ✨ Support targeting services with configurations in stable configuration file ([#​8526](DataDog/dd-trace-java#8526) - [@​mtoffl01](https://github.com/mtoffl01)) - ✨ Add new parser for `DD_TAGS` and prioritizing `DD_SERVICE` ([#​8296](DataDog/dd-trace-java#8296) - [@​mhlidd](https://github.com/mhlidd)) #### Tracer internal logging - 🐛 Add missing debug log for the cloudPayloadTaggingServices config ([#​8600](DataDog/dd-trace-java#8600) - [@​ygree](https://github.com/ygree)) - ✨ Add the possibility to output the logs of the Java tracer in JSON ([#​8083](DataDog/dd-trace-java#8083) - [@​cecile75](https://github.com/cecile75)) #### Tracer public API - ✨ Introducing `DD_TRACE_EXPERIMENTAL_FEATURES_ENABLED` Config ([#​8536](DataDog/dd-trace-java#8536) - [@​mhlidd](https://github.com/mhlidd)) - ✨ Config Consistency Round 2 ([#​8489](DataDog/dd-trace-java#8489) - [@​mhlidd](https://github.com/mhlidd)) ### Instrumentations #### - 🐛 Fix NPE in getMdcCopy of LoggingEventInstrumentation ([#​8599](DataDog/dd-trace-java#8599) - [@​ygree](https://github.com/ygree)) #### Apache Spark instrumentation - ✨ Instrument Runtime.exit() to finish spark application spans ([#​8572](DataDog/dd-trace-java#8572) - [@​paul-laffon-dd](https://github.com/paul-laffon-dd)) - ✨ Configure OpenLineage if present in Spark instrumentation ([#​8541](DataDog/dd-trace-java#8541) - [@​mobuchowski](https://github.com/mobuchowski)) #### Armeria Instrumentation - ✨ Support armeria grpc 1.32.3 ([#​8606](DataDog/dd-trace-java#8606) - [@​github-actions](https://github.com/github-actions)\[bot]) #### AWS DynamoDB Instrumentation - ✨ Create DynamoDB instrumentation + add span pointers for `updateItem` and `deleteItem` ([#​8490](DataDog/dd-trace-java#8490 9D9C a>) - [@​nhulston](https://github.com/nhulston)) #### AWS SDK instrumentation - ✨ Add DynamoDB in DEFAULT_TRACE_CLOUD_PAYLOAD_TAGGING_SERVICES ([#​8595](DataDog/dd-trace-java#8595) - [@​joeyzhao2018](https://github.com/joeyzhao2018)) #### Azure Functions instrumentation - ✨ Enable tracer computed trace metrics by default for Azure Functions ([#​8518](DataDog/dd-trace-java#8518) - [@​duncanpharvey](https://github.com/duncanpharvey)) - 💡 Add azure-functions instrumentation ([#​8432](DataDog/dd-trace-java#8432) - [@​duncanpharvey](https://github.com/duncanpharvey)) #### Core Java language instrumentation - 🐛 Fix ForkJoinPool.execute() instrumentation on Java 21+ ([#​8560](DataDog/dd-trace-java#8560) - [@​PerfectSlayer](https://github.com/PerfectSlayer)) #### Eclipse Vert.x instrumentation - ✨ Add vertx postgresql client instrumentation ([#​8471](DataDog/dd-trace-java#8471) - [@​vandonr](https://github.com/vandonr) - thanks for the contribution!) #### Kafka instrumentation - ✨ Support and test kafka-clients 4 ([#​8581](DataDog/dd-trace-java#8581) - [@​amarziali](https://github.com/amarziali)) #### Kotlin instrumentation - ✨ Avoid disconnected traces when using Kotlin flowOn ([#​8651](DataDog/dd-trace-java#8651) - [@​mcculls](https://github.com/mcculls)) #### OpenTelemetry instrumentation - 🧹 Migrate OtelContext wrapper to new internal Context API ([#​8645](DataDog/dd-trace-java#8645) - [@​mcculls](https://github.com/mcculls)) #### Spring instrumentation - 🐛 Support CompletableFuture on spring webmvc controllers ([#​8659](DataDog/dd-trace-java#8659) - [@​amarziali](https://github.com/amarziali)) - ✨ Add support for endpoint discovery in spring mvc ([#​8352](DataDog/dd-trace-java#8352) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) #### WebSocket Instrumentation - ✨ Instrument Jetty websocket pojo ([#​8562](DataDog/dd-trace-java#8562) - [@​amarziali](https://github.com/amarziali)) - 💡 Instrument Java Websocket API (JSR356) ([#​8440](DataDog/dd-trace-java#8440) - [@​amarziali](https://github.com/amarziali)) #### All other instrumentations - ✨ Introduce cache for peer.hostname lookup ([#​8601](DataDog/dd-trace-java#8601) - [@​mcculls](https://github.com/mcculls)) - ✨ Support pekko http 1.1 ([#​8532](DataDog/dd-trace-java#8532) - [@​amarziali](https://github.com/amarziali)) </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**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- 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: 331314f71acaced3adc75ea5d7e855c248d593fc
What Does This Do
This PR completes the JSR356 chapter by adding instrumentations for jetty pojo that were excluded.
In fact Jetty did not implement POJO websocket support like other servers (i.e. tomcat) by wrapping the POJO into a class extending
Endpoint
but uses a complex metadata parsing and deal with MethodHandle direct call.That made difficult the instrumentation. Now this PR addresses that by swapping the method handle jetty uses for opening, closing , and onMessage. Using instrumentation intercepting the jsr annotations (like
@OnOpen
,@OnMessage
) would not have worked since the spec states that parameter likeSession
are optional hence it's not guaranteed they are there and they are vital to lookup the context store.Hopefully jetty seems to do a couple of thing that limits the risk of swapping method handles and ensure that the needed parameters are always there:
I tried to put particular care in securing the datadog code in a try-catch-throwable blocks and reporting errors to the instrumentation telemetry.
Also, I added extensive testing trying several combination of arguments annotated pojo might have
Motivation
Additional Notes
Supports from 10 included to 12.1 excluded. 12.1 introduced a refactoring that needs to be covered but it's still in alpha
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]