-
Notifications
You must be signed in to change notification settings - Fork 305
Notify listeners when the scope top changes after switching scope stacks #8797
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
Notify listeners when the scope top changes after switching scope stacks #8797
Conversation
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 13 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~a3a1febb38, baseline=1.50.0-SNAPSHOT~f494c33b01
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.019 s) : 0, 1018539
Total [baseline] (8.656 s) : 0, 8656267
Agent [candidate] (1.022 s) : 0, 1022396
Total [candidate] (8.652 s) : 0, 8651806
section iast
Agent [baseline] (1.146 s) : 0, 1146055
Total [baseline] (9.184 s) : 0, 9184215
Agent [candidate] (1.159 s) : 0, 1158815
Total [candidate] (9.225 s) : 0, 9225101
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.154 s) : 0, 1154240
Total [baseline] (9.205 s) : 0, 9205176
Agent [candidate] (1.147 s) : 0, 1146821
Total [candidate] (9.177 s) : 0, 9177448
section iast_TELEMETRY_OFF
Agent [baseline] (1.162 s) : 0, 1161934
Total [baseline] (9.268 s) : 0, 9267782
Agent [candidate] (1.143 s) : 0, 1142818
Total [candidate] (9.269 s) : 0, 9268649
gantt
title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~a3a1febb38, baseline=1.50.0-SNAPSHOT~f494c33b01
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (680.729 ms) : 0, 680729
BytebuddyAgent [candidate] (683.727 ms) : 0, 683727
GlobalTracer [baseline] (239.416 ms) : 0, 239416
GlobalTracer [candidate] (240.421 ms) : 0, 240421
AppSec [baseline] (55.2 ms) : 0, 55200
AppSec [candidate] (55.015 ms) : 0, 55015
Debugger [baseline] (10.577 ms) : 0, 10577
Debugger [candidate] (9.908 ms) : 0, 9908
Remote Config [baseline] (713.911 µs) : 0, 714
Remote Config [candidate] (693.213 µs) : 0, 693
Telemetry [baseline] (8.269 ms) : 0, 8269
Telemetry [candidate] (8.992 ms) : 0, 8992
section iast
BytebuddyAgent [baseline] (800.246 ms) : 0, 800246
BytebuddyAgent [candidate] (809.338 ms) : 0, 809338
GlobalTracer [baseline] (229.625 ms) : 0, 229625
GlobalTracer [candidate] (232.057 ms) : 0, 232057
AppSec [baseline] (50.131 ms) : 0, 50131
AppSec [candidate] (51.397 ms) : 0, 51397
Debugger [baseline] (5.893 ms) : 0, 5893
Debugger [candidate] (5.933 ms) : 0, 5933
Remote Config [baseline] (590.09 µs) : 0, 590
Remote Config [candidate] (594.788 µs) : 0, 595
Telemetry [baseline] (7.857 ms) : 0, 7857
Telemetry [candidate] (7.967 ms) : 0, 7967
IAST [baseline] (28.232 ms) : 0, 28232
IAST [candidate] (27.833 ms) : 0, 27833
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (803.82 ms) : 0, 803820
BytebuddyAgent [candidate] (799.904 ms) : 0, 799904
GlobalTracer [baseline] (232.602 ms) : 0, 232602
GlobalTracer [candidate] (230.397 ms) : 0, 230397
AppSec [baseline] (51.809 ms) : 0, 51809
AppSec [candidate] (51.033 ms) : 0, 51033
Debugger [baseline] (5.988 ms) : 0, 5988
Debugger [candidate] (5.908 ms) : 0, 5908
Remote Config [baseline] (608.944 µs) : 0, 609
Remote Config [candidate] (594.833 µs) : 0, 595
Telemetry [baseline] (8.021 ms) : 0, 8021
Telemetry [candidate] (7.909 ms) : 0, 7909
IAST [baseline] (27.787 ms) : 0, 27787
IAST [candidate] (27.585 ms) : 0, 27585
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (809.388 ms) : 0, 809388
BytebuddyAgent [candidate] (796.991 ms) : 0, 796991
GlobalTracer [baseline] (234.272 ms) : 0, 234272
GlobalTracer [candidate] (230.096 ms) : 0, 230096
AppSec [baseline] (56.102 ms) : 0, 56102
AppSec [candidate] (55.734 ms) : 0, 55734
Debugger [baseline] (6.147 ms) : 0, 6147
Debugger [candidate] (5.93 ms) : 0, 5930
Remote Config [baseline] (630.76 µs) : 0, 631
Remote Config [candidate] (607.032 µs) : 0, 607
Telemetry [baseline] (7.969 ms) : 0, 7969
Telemetry [candidate] (7.792 ms) : 0, 7792
IAST [baseline] (23.665 ms) : 0, 23665
IAST [candidate] (22.264 ms) : 0, 22264
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~a3a1febb38, baseline=1.50.0-SNAPSHOT~f494c33b01
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.027 s) : 0, 1027102
Total [baseline] (10.487 s) : 0, 10486908
Agent [candidate] (1.023 s) : 0, 1022774
Total [candidate] (10.498 s) : 0, 10497786
section appsec
Agent [baseline] (1.16 s) : 0, 1160093
Total [baseline] (10.697 s) : 0, 10696637
Agent [candidate] (1.167 s) : 0, 1166855
Total [candidate] (10.718 s) : 0, 10718101
section iast
Agent [baseline] (1.147 s) : 0, 1147112
Total [baseline] (10.903 s) : 0, 10903344
Agent [candidate] (1.149 s) : 0, 1149369
Total [candidate] (10.883 s) : 0, 10882745
section profiling
Agent [baseline] (1.283 s) : 0, 1283097
Total [baseline] (10.927 s) : 0, 10926562
Agent [candidate] (1.281 s) : 0, 1280953
Total [candidate] (10.927 s) : 0, 10927310
gantt
title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~a3a1febb38, baseline=1.50.0-SNAPSHOT~f494c33b01
dateFormat X
axisFormat %s
section tracing
BytebuddyAgent [baseline] (689.148 ms) : 0, 689148
BytebuddyAgent [candidate] (686.44 ms) : 0, 686440
GlobalTracer [baseline] (241.979 ms) : 0, 241979
GlobalTracer [candidate] (240.134 ms) : 0, 240134
AppSec [baseline] (55.066 ms) : 0, 55066
AppSec [candidate] (55.074 ms) : 0, 55074
Debugger [baseline] (7.024 ms) : 0, 7024
Debugger [candidate] (7.613 ms) : 0, 7613
Remote Config [baseline] (715.822 µs) : 0, 716
Remote Config [candidate] (685.131 µs) : 0, 685
Telemetry [baseline] (9.429 ms) : 0, 9429
Telemetry [candidate] (9.189 ms) : 0, 9189
section appsec
BytebuddyAgent [baseline] (700.234 ms) : 0, 700234
BytebuddyAgent [candidate] (703.957 ms) : 0, 703957
GlobalTracer [baseline] (236.046 ms) : 0, 236046
GlobalTracer [candidate] (237.816 ms) : 0, 237816
AppSec [baseline] (175.241 ms) : 0, 175241
AppSec [candidate] (175.466 ms) : 0, 175466
Debugger [baseline] (5.914 ms) : 0, 5914
Debugger [candidate] (5.969 ms) : 0, 5969
Remote Config [baseline] (624.472 µs) : 0, 624
Remote Config [candidate] (625.082 µs) : 0, 625
Telemetry [baseline] (7.704 ms) : 0, 7704
Telemetry [candidate] (8.565 ms) : 0, 8565
IAST [baseline] (21.576 ms) : 0, 21576
IAST [candidate] (21.669 ms) : 0, 21669
section iast
BytebuddyAgent [baseline] (800.88 ms) : 0, 800880
BytebuddyAgent [candidate] (802.232 ms) : 0, 802232
GlobalTracer [baseline] (229.992 ms) : 0, 229992
GlobalTracer [candidate] (230.613 ms) : 0, 230613
AppSec [baseline] (48.525 ms) : 0, 48525
AppSec [candidate] (49.487 ms) : 0, 49487
Debugger [baseline] (5.925 ms) : 0, 5925
Debugger [candidate] (5.929 ms) : 0, 5929
Remote Config [baseline] (611.28 µs) : 0, 611
Remote Config [candidate] (601.444 µs) : 0, 601
Telemetry [baseline] (7.929 ms) : 0, 7929
Telemetry [candidate] (7.938 ms) : 0, 7938
IAST [baseline] (28.192 ms) : 0, 28192
IAST [candidate] (28.25 ms) : 0, 28250
section profiling
BytebuddyAgent [baseline] (673.645 ms) : 0, 673645
BytebuddyAgent [candidate] (673.031 ms) : 0, 673031
GlobalTracer [baseline] (379.742 ms) : 0, 379742
GlobalTracer [candidate] (377.731 ms) : 0, 377731
AppSec [baseline] (54.675 ms) : 0, 54675
AppSec [candidate] (53.737 ms) : 0, 53737
Debugger [baseline] (6.143 ms) : 0, 6143
Debugger [candidate] (6.103 ms) : 0, 6103
Remote Config [baseline] (659.878 µs) : 0, 660
Remote Config [candidate] (665.551 µs) : 0, 666
Telemetry [baseline] (8.196 ms) : 0, 8196
Telemetry [candidate] (8.108 ms) : 0, 8108
ProfilingAgent [baseline] (109.439 ms) : 0, 109439
ProfilingAgent [candidate] (110.902 ms) : 0, 110902
Profiling [baseline] (109.464 ms) : 0, 109464
Profiling [candidate] (110.928 ms) : 0, 110928
LoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 18 unstable metrics. Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~a3a1febb38, baseline=1.50.0-SNAPSHOT~f494c33b01
dateFormat X
axisFormat %s
section baseline
no_agent (383.098 µs) : 363, 403
. : milestone, 383,
iast (524.955 µs) : 503, 547
. : milestone, 525,
iast_FULL (742.286 µs) : 720, 764
. : milestone, 742,
iast_GLOBAL (563.689 µs) : 542, 585
. : milestone, 564,
iast_HARDCODED_SECRET_DISABLED (523.282 µs) : 500, 546
. : milestone, 523,
iast_INACTIVE (473.343 µs) : 450, 496
. : milestone, 473,
iast_TELEMETRY_OFF (509.799 µs) : 487, 533
. : milestone, 510,
tracing (464.312 µs) : 442, 486
. : milestone, 464,
section candidate
no_agent (380.687 µs) : 361, 401
. : milestone, 381,
iast (525.778 µs) : 502, 549
. : milestone, 526,
iast_FULL (742.048 µs) : 720, 764
. : milestone, 742,
iast_GLOBAL (566.061 µs) : 545, 588
. : milestone, 566,
iast_HARDCODED_SECRET_DISABLED (528.352 µs) : 506, 551
. : milestone, 528,
iast_INACTIVE (478.608 µs) : 456, 501
. : milestone, 479,
iast_TELEMETRY_OFF (519.474 µs) : 497, 542
. : milestone, 519,
tracing (464.095 µs) : 442, 486
. : milestone, 464,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~a3a1febb38, baseline=1.50.0-SNAPSHOT~f494c33b01
dateFormat X
axisFormat %s
section baseline
no_agent (1.379 ms) : 1359, 1398
. : milestone, 1379,
appsec (1.739 ms) : 1716, 1763
. : milestone, 1739,
appsec_no_iast (1.74 ms) : 1716, 1763
. : milestone, 1740,
code_origins (1.672 ms) : 1645, 1699
. : milestone, 1672,
iast (1.533 ms) : 1509, 1557
. : milestone, 1533,
profiling (1.599 ms) : 1575, 1623
. : milestone, 1599,
tracing (1.51 ms) : 1486, 1534
. : milestone, 1510,
section candidate
no_agent (1.367 ms) : 1348, 1386
. : milestone, 1367,
appsec (1.735 ms) : 1712, 1759
. : milestone, 1735,
appsec_no_iast (1.751 ms) : 1727, 1775
. : milestone, 1751,
code_origins (1.683 ms) : 1655, 1710
. : milestone, 1683,
iast (1.527 ms) : 1503, 1551
. : milestone, 1527,
profiling (1.572 ms) : 1548, 1597
. : milestone, 1572,
tracing (1.507 ms) : 1483, 1531
. : milestone, 1507,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~a3a1febb38, baseline=1.50.0-SNAPSHOT~f494c33b01
dateFormat X
axisFormat %s
section baseline
no_agent (14.93 s) : 14930000, 14930000
. : milestone, 14930000,
appsec (15.299 s) : 15299000, 15299000
. : milestone, 15299000,
iast (19.207 s) : 19207000, 19207000
. : milestone, 19207000,
iast_GLOBAL (18.27 s) : 18270000, 18270000
. : milestone, 18270000,
profiling (14.882 s) : 14882000, 14882000
. : milestone, 14882000,
tracing (15.133 s) : 15133000, 15133000
. : milestone, 15133000,
section candidate
no_agent (15.455 s) : 15455000, 15455000
. : milestone, 15455000,
appsec (14.891 s) : 14891000, 14891000
. : milestone, 14891000,
iast (19.016 s) : 19016000, 19016000
. : milestone, 19016000,
iast_GLOBAL (18.242 s) : 18242000, 18242000
. : milestone, 18242000,
profiling (14.918 s) : 14918000, 14918000
. : milestone, 14918000,
tracing (14.795 s) : 14795000, 14795000
. : milestone, 14795000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~a3a1febb38, baseline=1.50.0-SNAPSHOT~f494c33b01
dateFormat X
axisFormat %s
section baseline
no_agent (1.484 ms) : 1472, 1495
. : milestone, 1484,
appsec (2.416 ms) : 2368, 2465
. : milestone, 2416,
iast (2.206 ms) : 2143, 2268
. : milestone, 2206,
iast_GLOBAL (2.251 ms) : 2188, 2315
. : milestone, 2251,
profiling (2.051 ms) : 2002, 2101
. : milestone, 2051,
tracing (2.043 ms) : 1994, 2092
. : milestone, 2043,
section candidate
no_agent (1.483 ms) : 1471, 1495
. : milestone, 1483,
appsec (2.425 ms) : 2376, 2474
. : milestone, 2425,
iast (2.204 ms) : 2141, 2266
. : milestone, 2204,
iast_GLOBAL (2.247 ms) : 2185, 2310
. : milestone, 2247,
profiling (2.047 ms) : 1997, 2097
. : milestone, 2047,
tracing (2.021 ms) : 1973, 2070
. : milestone, 2021,
|
tlsScopeStack.set(localScopeStack); | ||
ContinuableScope newScope = localScopeStack.top; | ||
if (oldScope != newScope && newScope != null) { | ||
newScope.beforeActivated(); |
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.
we call before and after on a row without doing anything in between. Can this be simplified ?
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.
There's a very subtle difference - beforeActivated
calls the profiling integration, while afterActivated
calls the registered listeners.
In one place in the code beforeActivated
is called before changing the top value:
dd-trace-java/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ScopeStack.java
Lines 69 to 76 in e8a2156
scope.beforeActivated(); | |
if (top != null) { | |
stack.push(top); | |
} else { | |
onBecomeNonEmpty(); | |
} | |
top = scope; | |
scope.afterActivated(); |
but in another part of the code, they are called at the same time after the top has changed:
dd-trace-java/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ScopeStack.java
Lines 58 to 59 in e8a2156
curScope.beforeActivated(); | |
curScope.afterActivated(); |
In terms of actual implementation the profiling integration is just clearing some caches, so there is flexibility here and this could all be done in one method as long as the profiling integration is always called first.
However since the profiling integration will need to be refactored to make it context-first, that's something I will do in a separate 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.
Looking good for now, but as you said, we will need to rework product integration in a second phase. Let me know if you want help with this part 🤝
| 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 ([#​8825](DataDog/dd-trace-java#8825) - [@​jandro996](https://github.com/jandro996)) - 🐛 Adapt standalone ASM to support API Security ([#​8804](DataDog/dd-trace-java#8804) - [@​jandro996](https://github.com/jandro996)) - ✨ Add appsec.waf.input\_truncated metric ([#​8791](DataDog/dd-trace-java#8791) - [@​jandro996](https://github.com/jandro996)) - ✨ Extended appsec request body collection ([#​8748](DataDog/dd-trace-java#8748) - [@​jandro996](https://github.com/jandro996)) - ✨ Extended appsec request/response headers collection ([#​8724](DataDog/dd-trace-java#8724) - [@​jandro996](https://github.com/jandro996)) #### Build & Tooling - ✨ Add artifacts to public s3 bucket ([#​8947](DataDog/dd-trace-java#8947) - [@​randomanderson](https://github.com/randomanderson)) #### Continuous Integration Visibility - ✨ Improve PR information building ([#​8908](DataDog/dd-trace-java#8908) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Truncate span stack traces when Test Optimization is enabled ([#​8903](DataDog/dd-trace-java#8903) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🐛 Ensure auto-detected service name is the same for every process in the same build ([#​8902](DataDog/dd-trace-java#8902) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - 🐛 Use tag as fallback in api requests if no branch is available ([#​8876](DataDog/dd-trace-java#8876) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Add support for JUnit 5.13-RC1 ([#​8865](DataDog/dd-trace-java#8865), [#​8871](DataDog/dd-trace-java#8871) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Implement attempt to fix v3 and v4 and bump capability version ([#​8824](DataDog/dd-trace-java#8824) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - 🧹 Align retry logic for all test framework instrumentations ([#​8803](DataDog/dd-trace-java#8803) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - 🐛 Always build ci workspace without trailing separator ([#​8788](DataDog/dd-trace-java#8788) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Add commit discrepancies telemetry when building repository git information ([#​8763](DataDog/dd-trace-java#8763) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) #### Data Streams Monitoring - 💡 Surface process tags in dsm payloads and use them for base hash calculation ([#​8836](DataDog/dd-trace-java#8836) - [@​amarziali](https://github.com/amarziali)) #### Dynamic Instrumentation - ✨ Optimized allocations for collection filter functions ([#​8896](DataDog/dd-trace-java#8896) - [@​jpbempel](https://github.com/jpbempel)) - 🐛 Fix SymDB upload size check ([#​8887](DataDog/dd-trace-java#8887) - [@​jpbempel](https://github.com/jpbempel)) - 🐛 Add support for Set in filter function ([#​8873](DataDog/dd-trace-java#8873) - [@​jpbempel](https://github.com/jpbempel)) - 🐛 Add support for isDefined in log template ([#​8859](DataDog/dd-trace-java#8859) - [@​jpbempel](https://github.com/jpbempel)) - 🐛 Fix Max captured frames for Exception Replay ([#​8856](DataDog/dd-trace-java#8856) - [@​jpbempel](https://github.com/jpbempel)) - 🐛 Remove static inherited fields collection ([#​8832](DataDog/dd-trace-java#8832) - [@​jpbempel](https://github.com/jpbempel)) - 💡 Add process tags to dynamic instrumentation intake payload ([#​8779](DataDog/dd-trace-java#8779) - [@​amarziali](https://github.com/amarziali)) #### GraalVM native-image - ✨ Add support for GraalVM Native GC metrics ([#​8913](DataDog/dd-trace-java#8913) - [@​ygree](https://github.com/ygree)) - ✨ Add JMXFetch support for GraalVM Native ([#​8569](DataDog/dd-trace-java#8569) - [@​ygree](https://github.com/ygree)) #### JMX fetch - ✨ Add support for GraalVM Native GC metrics ([#​8913](DataDog/dd-trace-java#8913) - [@​ygree](https://github.com/ygree)) #### Library Injection - ✨ Deny oracle db jvm based tools ([#​8909](DataDog/dd-trace-java#8909) - [@​bric3](https://github.com/bric3)) #### OpenTracing - 🐛 Fix OT packaging for exception replay ([#​8912](DataDog/dd-trace-java#8912) - [@​jpbempel](https://github.com/jpbempel)) #### Profiling - ✨ Bump ddprof to 1.27.0 ([#​8893](DataDog/dd-trace-java#8893) - [@​jbachorik](https://github.com/jbachorik)) - Properly handle the adaptive sampling interval overflow by [@​jbachorik](https://github.com/jbachorik) in DataDog/java-profiler#213 - Fix [#​200](DataDog/dd-trace-java#200) Crash related to aligned\_alloc and free in context by [@​yanglong1010](https://github.com/yanglong1010) in DataDog/java-profiler#208 - Explicitly initialize empty context page by [@​jbachorik](https://github.com/jbachorik) in DataDog/java-profiler#210 - Re-connect crash recursion protection with VM stackwalker by [@​jbachorik](https://github.com/jbachorik) in DataDog/java-profiler#214 - ✨ Enable ZSTD compression for profiling ([#​8862](DataDog/dd-trace-java#8862) - [@​MattAlp](https://github.com/MattAlp)) - ✨ Extend JPS re-implementation to J9 family ([#​8813](DataDog/dd-trace-java#8813) - [@​MattAlp](https://github.com/MattAlp)) - 💡 Collect process tags for profiling upload requests ([#​8780](DataDog/dd-trace-java#8780) - [@​amarziali](https://github.com/amarziali)) #### Telemetry - 💡 Surface process tags on telemetry payloads ([#​8837](DataDog/dd-trace-java#8837) - [@​amarziali](https://github.com/amarziali)) #### Trace context propagation - ✨ Migrating all HttpClient Instrumentations to Inject Full Context ([#​8826](DataDog/dd-trace-java#8826) - [@​mhlidd](https://github.com/mhlidd)) - ✨ Migrating all HttpServer Instrumentations to Extract full Context ([#​8820](DataDog/dd-trace-java#8820) - [@​mhlidd](https://github.com/mhlidd)) - ✨ Add context API support OTel propagators ([#​8770](DataDog/dd-trace-java#8770) - [@​PerfectSlayer](https://github.com/PerfectSlayer)) #### Tracer core - ✨⚡ Skip JAXB generated classes classloader ([#​9003](DataDog/dd-trace-java#9003) - [@​bric3](https://github.com/bric3)) - ✨ Add DD\_RUNTIME\_METRICS\_RUNTIME\_ID\_ENABLED alias for runtime id generation ([#​8981](DataDog/dd-trace-java#8981) - [@​amarziali](https://github.com/amarziali)) - 🐛 Use resolved address for peer.hostname when available without hitting the cache ([#​8915](DataDog/dd-trace-java#8915) - [@​amarziali](https://github.com/amarziali)) - 💡 Surface server name process tag for tomcat ([#​8894](DataDog/dd-trace-java#8894) - [@​amarziali](https://github.com/amarziali)) - 💡 Surface websphere cell and server name on process tags ([#​8880](DataDog/dd-trace-java#8880) - [@​amarziali](https://github.com/amarziali)) - ✨ Added special lightweight pre-main class that skips installation on incompatible JVMs. ([#​8855](DataDog/dd-trace-java#8855) - [@​AlexeyKuznetsov-DD](https://github.com/AlexeyKuznetsov-DD)) - 💡 Add entrypoint type to process tags ([#​8839](DataDog/dd-trace-java#8839) - [@​amarziali](https://github.com/amarziali)) - ✨ Extend JPS re-implementation to J9 family ([#​8813](DataDog/dd-trace-java#8813) - [@​MattAlp](https://github.com/MattAlp)) - ✨ Notify listeners when the scope top changes after switching scope stacks ([#​8797](DataDog/dd-trace-java#8797) - [@​mcculls](https://github.com/mcculls)) - ✨ Read hsperfdata for Java PIDs if jvmstat is unavailable ([#​8792](DataDog/dd-trace-java#8792) - [@​MattAlp](https://github.com/MattAlp)) - 🐛 Turn JDK socket support on by default ([#​8752](DataDog/dd-trace-java#8752) - [@​sarahchen6](https://github.com/sarahchen6)) - ✨ Simplify context propagation ([#​8719](DataDog/dd-trace-java#8719) - [@​PerfectSlayer](https://github.com/PerfectSlayer)) - ✨ Add JSON parsing support ([#​8579](DataDog/dd-trace-java#8579) - [@​PerfectSlayer](https://github.com/PerfectSlayer)) #### Tracer internal logging - ✨ Fix printing format of span identifiers ([#​8897](DataDog/dd-trace-java#8897) - [@​vandonr](https://github.com/vandonr)) #### Tracer public API - 💡 Track the source of installation ([#​8956](DataDog/dd-trace-java#8956) - [@​mabdinur](https://github.com/mabdinur)) - ✨ Enforce size limit on application\_monitoring.yaml files ([#​8789](DataDog/dd-trace-java#8789) - [@​mtoffl01](https://github.com/mtoffl01)) - ✨ Enabling baggage cache to support limits and non-ascii characters ([#​8713](DataDog/dd-trace-java#8713) - [@​mhlidd](https://github.com/mhlidd)) ### Instrumentations #### AWS Lambda instrumentation - ✨ Pass Lambda Request ID to Extension ([#​8814](DataDog/dd-trace-java#8814) - [@​nhulston](https://github.com/nhulston)) #### Core Java language instrumentation - ✨ Ensure ClassloadingInstrumentation is always applied even with `DD_TRACE_ENABLED=false` ([#​8863](DataDog/dd-trace-java#8863) - [@​mcculls](https://github.com/mcculls)) #### Eclipse Vert.x instrumentation - 🐛 Do not override route with / in vertx instrumentation ([#​8881](DataDog/dd-trace-java#8881) - [@​vandonr](https://github.com/vandonr)) #### IBM Liberty - 🐛 Fix error mark on http status for IBM liberty ([#​8822](DataDog/dd-trace-java#8822) - [@​amarziali](https://github.com/amarziali)) #### JDBC instrumentation - 🐛 Do not prepend DBM <> APM trace comment in SQLCommenter if there is a pg plan hint ([#​8864](DataDog/dd-trace-java#8864) - [@​edengorevoy](https://github.com/edengorevoy)) #### JMS instrumentation - ✨ Add jms as an extra integration name where there is JMS involved ([#​8933](DataDog/dd-trace-java#8933) - [@​vandonr](https://github.com/vandonr)) #### Kotlin instrumentation - ✨ Enable kotlin\_coroutine integration by default ([#​8848](DataDog/dd-trace-java#8848) - [@​mcculls](https://github.com/mcculls)) - 🧹 Rework Kotlin coroutines instrumentation around coroutine context ([#​8774](DataDog/dd-trace-java#8774) - [@​mcculls](https://github.com/mcculls)) #### OpenTelemetry instrumentation - 🐛 Support WithSpan inheritContext attribute ([#​8858](DataDog/dd-trace-java#8858) - [@​amarziali](https://github.com/amarziali)) - ✨ Add context API support OTel propagators ([#​8770](DataDog/dd-trace-java#8770) - [@​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 ([#​8591](DataDog/dd-trace-java#8591) - [@​ygree](https://github.com/ygree)) #### Quarkus Instrumentation - 🐛 Ignore quarkus jaxrs stubs and cdi wrapper proxies ([#​8891](DataDog/dd-trace-java#8891) - [@​amarziali](https://github.com/amarziali)) #### ServiceTalk - ✨ Improve ServiceTalk Captured Context API Instrumentation for v0.42.56+ ([#​8821](DataDog/dd-trace-java#8821) - [@​ygree](https://github.com/ygree)) #### Spring instrumentation - ✨ Supporting Baggage for Instrumentations used in Weblog Tests ([#​8773](DataDog/dd-trace-java#8773) - [@​mhlidd](https://github.com/mhlidd)) #### WebSocket Instrumentation - 💡 Trace websocket for spring webflux reactive handlers ([#​8831](DataDog/dd-trace-java#8831) - [@​amarziali](https://github.com/amarziali)) - 💡:test\_tube: WebSocket support for Netty ([#​8632](DataDog/dd-trace-java#8632) - [@​ValentinZakharov](https://github.com/ValentinZakharov)) #### Zio Instrumentation - 🧹 Cleanup Zio fiber instrumentation to avoid repeated activation of continuation ([#​8798](DataDog/dd-trace-java#8798) - [@​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
Motivation
We should notify registered listeners when the scope changes after switching the scope stack for coroutines or fibers - previously we switched scope stacks without notifying listeners. (This includes notifying the profiling integration that the context has switched for this thread.)
Note that switching the scope stack doesn't imply the previous scope was closed - the ScopeListener javadoc clearly states that there may be many calls to
afterScopeActivated
as the context flows between parent and child scopes and back again. Switching between coroutines should therefore also triggerafterScopeActivated
.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]