- Notifications
You must be signed in to change notification settings - Fork 314
Clean up DSM context injection #8776
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
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 43 metrics, 10 unstable metrics. Startup time reports for insecure-bankgantt title insecure-bank - global startup overhead: candidate=1.51.0-SNAPSHOT~e67e217243, baseline=1.51.0-SNAPSHOT~8e587850a2 dateFormat X axisFormat %s section tracing Agent [baseline] (1.037 s) : 0, 1036825 Total [baseline] (8.59 s) : 0, 8590004 Agent [candidate] (1.038 s) : 0, 1037861 Total [candidate] (8.573 s) : 0, 8573374 section iast Agent [baseline] (1.163 s) : 0, 1162948 Total [baseline] (9.25 s) : 0, 9250024 Agent [candidate] (1.161 s) : 0, 1161408 Total [candidate] (9.247 s) : 0, 9246735
gantt title insecure-bank - break down per module: candidate=1.51.0-SNAPSHOT~e67e217243, baseline=1.51.0-SNAPSHOT~8e587850a2 dateFormat X axisFormat %s section tracing BytebuddyAgent [baseline] (695.41 ms) : 0, 695410 BytebuddyAgent [candidate] (695.866 ms) : 0, 695866 GlobalTracer [baseline] (244.223 ms) : 0, 244223 GlobalTracer [candidate] (243.659 ms) : 0, 243659 AppSec [baseline] (57.663 ms) : 0, 57663 AppSec [candidate] (57.408 ms) : 0, 57408 Debugger [baseline] (6.364 ms) : 0, 6364 Debugger [candidate] (7.628 ms) : 0, 7628 Remote Config [baseline] (691.396 µs) : 0, 691 Remote Config [candidate] (680.678 µs) : 0, 681 Telemetry [baseline] (11.369 ms) : 0, 11369 Telemetry [candidate] (11.486 ms) : 0, 11486 section iast BytebuddyAgent [baseline] (813.04 ms) : 0, 813040 BytebuddyAgent [candidate] (813.087 ms) : 0, 813087 GlobalTracer [baseline] (234.246 ms) : 0, 234246 GlobalTracer [candidate] (233.117 ms) : 0, 233117 AppSec [baseline] (52.047 ms) : 0, 52047 AppSec [candidate] (51.912 ms) : 0, 51912 Debugger [baseline] (5.964 ms) : 0, 5964 Debugger [candidate] (5.965 ms) : 0, 5965 Remote Config [baseline] (618.269 µs) : 0, 618 Remote Config [candidate] (612.015 µs) : 0, 612 Telemetry [baseline] (8.098 ms) : 0, 8098 Telemetry [candidate] (7.968 ms) : 0, 7968 IAST [baseline] (28.038 ms) : 0, 28038 IAST [candidate] (27.727 ms) : 0, 27727 Startup time reports for petclinicgantt title petclinic - global startup overhead: candidate=1.51.0-SNAPSHOT~e67e217243, baseline=1.51.0-SNAPSHOT~8e587850a2 dateFormat X axisFormat %s section tracing Agent [baseline] (1.024 s) : 0, 1024135 Total [baseline] (10.52 s) : 0, 10520274 Agent [candidate] (1.026 s) : 0, 1026105 Total [candidate] (10.498 s) : 0, 10498110 section appsec Agent [baseline] (1.178 s) : 0, 1178074 Total [baseline] (10.703 s) : 0, 10702661 Agent [candidate] (1.186 s) : 0, 1185962 Total [candidate] (10.753 s) : 0, 10752508 section iast Agent [baseline] (1.152 s) : 0, 1152418 Total [baseline] (10.841 s) : 0, 10840617 Agent [candidate] (1.149 s) : 0, 1148615 Total [candidate] (10.881 s) : 0, 10880850 section profiling Agent [baseline] (1.27 s) : 0, 1269935 Total [baseline] (10.927 s) : 0, 10926848 Agent [candidate] (1.268 s) : 0, 1267705 Total [candidate] (10.94 s) : 0, 10940430
gantt title petclinic - break down per module: candidate=1.51.0-SNAPSHOT~e67e217243, baseline=1.51.0-SNAPSHOT~8e587850a2 dateFormat X axisFormat %s section tracing BytebuddyAgent [baseline] (684.514 ms) : 0, 684514 BytebuddyAgent [candidate] (686.394 ms) : 0, 686394 GlobalTracer [baseline] (241.261 ms) : 0, 241261 GlobalTracer [candidate] (242.534 ms) : 0, 242534 AppSec [baseline] (56.361 ms) : 0, 56361 AppSec [candidate] (58.47 ms) : 0, 58470 Debugger [baseline] (7.816 ms) : 0, 7816 Debugger [candidate] (7.591 ms) : 0, 7591 Remote Config [baseline] (680.825 µs) : 0, 681 Remote Config [candidate] (658.81 µs) : 0, 659 Telemetry [baseline] (12.611 ms) : 0, 12611 Telemetry [candidate] (9.605 ms) : 0, 9605 section appsec BytebuddyAgent [baseline] (707.819 ms) : 0, 707819 BytebuddyAgent [candidate] (712.931 ms) : 0, 712931 GlobalTracer [baseline] (234.739 ms) : 0, 234739 GlobalTracer [candidate] (236.2 ms) : 0, 236200 IAST [baseline] (21.956 ms) : 0, 21956 IAST [candidate] (22.038 ms) : 0, 22038 AppSec [baseline] (179.21 ms) : 0, 179210 AppSec [candidate] (180.12 ms) : 0, 180120 Debugger [baseline] (5.772 ms) : 0, 5772 Debugger [candidate] (5.862 ms) : 0, 5862 Remote Config [baseline] (598.677 µs) : 0, 599 Remote Config [candidate] (618.338 µs) : 0, 618 Telemetry [baseline] (7.246 ms) : 0, 7246 Telemetry [candidate] (7.305 ms) : 0, 7305 section iast BytebuddyAgent [baseline] (806.298 ms) : 0, 806298 BytebuddyAgent [candidate] (803.45 ms) : 0, 803450 GlobalTracer [baseline] (232.098 ms) : 0, 232098 GlobalTracer [candidate] (230.963 ms) : 0, 230963 IAST [baseline] (28.219 ms) : 0, 28219 IAST [candidate] (26.044 ms) : 0, 26044 AppSec [baseline] (50.466 ms) : 0, 50466 AppSec [candidate] (52.968 ms) : 0, 52968 Debugger [baseline] (5.897 ms) : 0, 5897 Debugger [candidate] (5.891 ms) : 0, 5891 Remote Config [baseline] (602.339 µs) : 0, 602 Remote Config [candidate] (602.699 µs) : 0, 603 Telemetry [baseline] (7.998 ms) : 0, 7998 Telemetry [candidate] (7.854 ms) : 0, 7854 section profiling BytebuddyAgent [baseline] (676.366 ms) : 0, 676366 BytebuddyAgent [candidate] (676.152 ms) : 0, 676152 GlobalTracer [baseline] (360.899 ms) : 0, 360899 GlobalTracer [candidate] (360.375 ms) : 0, 360375 AppSec [baseline] (62.173 ms) : 0, 62173 AppSec [candidate] (62.286 ms) : 0, 62286 Debugger [baseline] (6.145 ms) : 0, 6145 Debugger [candidate] (6.096 ms) : 0, 6096 Remote Config [baseline] (695.919 µs) : 0, 696 Remote Config [candidate] (686.826 µs) : 0, 687 Telemetry [baseline] (8.063 ms) : 0, 8063 Telemetry [candidate] (8.113 ms) : 0, 8113 ProfilingAgent [baseline] (107.083 ms) : 0, 107083 ProfilingAgent [candidate] (105.424 ms) : 0, 105424 Profiling [baseline] (107.108 ms) : 0, 107108 Profiling [candidate] (105.448 ms) : 0, 105448 LoadParameters
See matching parameters
SummaryFound 1 performance improvements and 2 performance regressions! Performance is the same for 9 metrics, 12 unstable metrics.
Request duration reports for insecure-bankgantt title insecure-bank - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~e67e217243, baseline=1.51.0-SNAPSHOT~8e587850a2 dateFormat X axisFormat %s section baseline no_agent (4.668 ms) : 4613, 4724 . : milestone, 4668, iast (8.86 ms) : 8716, 9003 . : milestone, 8860, iast_FULL (13.768 ms) : 13497, 14039 . : milestone, 13768, iast_GLOBAL (10.007 ms) : 9829, 10184 . : milestone, 10007, profiling (8.684 ms) : 8546, 8822 . : milestone, 8684, tracing (7.498 ms) : 7393, 7604 . : milestone, 7498, section candidate no_agent (4.276 ms) : 4220, 4331 . : milestone, 4276, iast (9.275 ms) : 9124, 9427 . : milestone, 9275, iast_FULL (13.453 ms) : 13190, 13715 . : milestone, 13453, iast_GLOBAL (10.391 ms) : 10201, 10581 . : milestone, 10391, profiling (8.936 ms) : 8796, 9076 . : milestone, 8936, tracing (7.539 ms) : 7425, 7654 . : milestone, 7539,
Request duration reports for petclinicgantt title petclinic - request duration [CI 0.99] : candidate=1.51.0-SNAPSHOT~e67e217243, baseline=1.51.0-SNAPSHOT~8e587850a2 dateFormat X axisFormat %s section baseline no_agent (37.3 ms) : 36996, 37603 . : milestone, 37300, appsec (47.26 ms) : 46848, 47673 . : milestone, 47260, code_origins (44.182 ms) : 43834, 44530 . : milestone, 44182, iast (42.233 ms) : 41863, 42603 . : milestone, 42233, profiling (48.317 ms) : 47889, 48745 . : milestone, 48317, tracing (44.679 ms) : 44316, 45042 . : milestone, 44679, section candidate no_agent (36.995 ms) : 36698, 37292 . : milestone, 36995, appsec (48.398 ms) : 47978, 48819 . : milestone, 48398, code_origins (43.403 ms) : 43049, 43757 . : milestone, 43403, iast (44.681 ms) : 44307, 45056 . : milestone, 44681, profiling (48.644 ms) : 48150, 49139 . : milestone, 48644, tracing (43.757 ms) : 43405, 44110 . : milestone, 43757,
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 tomcatgantt title tomcat - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~e67e217243, baseline=1.51.0-SNAPSHOT~8e587850a2 dateFormat X axisFormat %s section baseline no_agent (1.47 ms) : 1458, 1481 . : milestone, 1470, appsec (2.393 ms) : 2344, 2442 . : milestone, 2393, iast (2.182 ms) : 2121, 2244 . : milestone, 2182, iast_GLOBAL (2.233 ms) : 2170, 2295 . : milestone, 2233, profiling (2.016 ms) : 1967, 2066 . : milestone, 2016, tracing (2.001 ms) : 1953, 2049 . : milestone, 2001, section candidate no_agent (1.472 ms) : 1461, 1484 . : milestone, 1472, appsec (2.393 ms) : 2344, 2442 . : milestone, 2393, iast (2.185 ms) : 2123, 2247 . : milestone, 2185, iast_GLOBAL (2.226 ms) : 2164, 2288 . : milestone, 2226, profiling (2.024 ms) : 1974, 2073 . : milestone, 2024, tracing (1.996 ms) : 1948, 2043 . : milestone, 1996,
Execution time for biojavagantt title biojava - execution time [CI 0.99] : candidate=1.51.0-SNAPSHOT~e67e217243, baseline=1.51.0-SNAPSHOT~8e587850a2 dateFormat X axisFormat %s section baseline no_agent (15.072 s) : 15072000, 15072000 . : milestone, 15072000, appsec (14.948 s) : 14948000, 14948000 . : milestone, 14948000, iast (19.016 s) : 19016000, 19016000 . : milestone, 19016000, iast_GLOBAL (17.835 s) : 17835000, 17835000 . : milestone, 17835000, profiling (15.303 s) : 15303000, 15303000 . : milestone, 15303000, tracing (15.143 s) : 15143000, 15143000 . : milestone, 15143000, section candidate no_agent (15.236 s) : 15236000, 15236000 . : milestone, 15236000, appsec (15.116 s) : 15116000, 15116000 . : milestone, 15116000, iast (18.568 s) : 18568000, 18568000 . : milestone, 18568000, iast_GLOBAL (17.962 s) : 17962000, 17962000 . : milestone, 17962000, profiling (15.083 s) : 15083000, 15083000 . : milestone, 15083000, tracing (15.064 s) : 15064000, 15064000 . : milestone, 15064000,
|
5f1247d
to 3b7384c
Compare private static final ContextKey<DataStreamsContext> CONTEXT_KEY = | ||
ContextKey.named("dsm-context-key"); | ||
private static final LinkedHashMap<String, String> CLIENT_PATHWAY_EDGE_TAGS; | ||
private static final LinkedHashMap<String, String> SERVER_PATHWAY_EDGE_TAGS; |
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.
⚪ Code Quality Violation
private static final LinkedHashMap<String, String> SERVER_PATHWAY_EDGE_TAGS; | |
private static final Map<String, String> SERVER_PATHWAY_EDGE_TAGS; |
Avoid using a specific implementation type; use the more general Map instead (...read more)
Relying on particular implementation types, such as, HashSet
or LinkedList
can limit your adaptability to embrace alternative implementations in the future, particularly as your requirements change and your code needs to undergo changes.
It is recommended to opt for general types such as Set
or List
when declaring variables and parameters.
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.
Yeah... We asked the DSM team to create their own data structure but not much update about it 🤷
public class DataStreamsContext implements ImplicitContextKeyed { | ||
private static final ContextKey<DataStreamsContext> CONTEXT_KEY = | ||
ContextKey.named("dsm-context-key"); | ||
private static final LinkedHashMap<String, String> CLIENT_PATHWAY_EDGE_TAGS; |
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.
⚪ Code Quality Violation
private static final LinkedHashMap<String, String> CLIENT_PATHWAY_EDGE_TAGS; | |
private static final Map<String, String> CLIENT_PATHWAY_EDGE_TAGS; |
Avoid using a specific implementation type; use the more general Map instead (...read more)
Relying on particular implementation types, such as, HashSet
or LinkedList
can limit your adaptability to embrace alternative implementations in the future, particularly as your requirements change and your code needs to undergo changes.
It is recommended to opt for general types such as Set
or List
when declaring variables and parameters.
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.
Yeah... We asked the DSM team to create their own data structure but not much update about it 🤷
08df84e
to 9889997
Compare 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 much cleaner now! Just a few small comments/questions, but otherwise the DSM context specific changes look good. I'll defer the other changes (StatsBucket) to another reviewer.
final TraceConfig tracerConfig; | ||
return (agentSpan = AgentSpan.fromContext(context)) != null | ||
&& (tracerConfig = agentSpan.traceConfig()) != null | ||
&& tracerConfig.isDataStreamsEnabled(); |
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.
Why do we need to fetch the isDataStreamsEnabled()
through tracerConfig
? How is this different from getting it directly from Config.get()
?
Also this seems to be also added in DataStreamsMonitoring.java. Do we need it in both places or can we remove it here?
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.
Why do we need to fetch the isDataStreamsEnabled() through tracerConfig? How is this different from getting it directly from Config.get()?
Not sure but I think it might be related to remove config. I would need more details from the DSM team itself. I will ping it from its channel.
Do we need it in both places or can we remove it here?
There is one in decorator to avoid DSM context allocation and new context creation (the context.with()
call).
While the one in the propagator is here to make sure we don't propagate if the feature is not enabled.
While the later is product related, the former is for performance concern.
If we can simplify the check, I would not mind having him twice. Let's see what the DSM team think about it first.
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.
for the first one, Data Streams can be enabled via remote configuration. I don't know if Config.get()
only returns the initial configuration or not.
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.
for the second one, it makes sense to me. I agree it's annoying to have to get the config from the span though, in other languages, I believe we are able to get the config even when there is no active span.
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 don't know if Config.get() only returns the initial configuration or not.
Yes, it will return the ones from the system properties or environment variables and will have the same value during the whole runtime.
I agree it's annoying to have to get the config from the span though
I end up using dynamic config for the instrumentation then. The tracer as a dynamic config that always has the latest state. You can get it by AgentTracer.traceConfig()
, no span needed. That will decouple DSM from active span.
But I would recommend you would go over the whole code base as there are parts where you use (the static) Config
and where you might want to move to the dynamic config instead. And some part where you get the dynamic config from spans, where you can get the last one from "tracer" (where tracer is basically the main entry point for all things, including dynamic config 🤷 )
...rpc/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcClientDecorator.java Outdated Show resolved Hide resolved
UTF8BytesString.create("java-web-servlet-dispatcher"); | ||
public static final String DD_CONTEXT_PATH_ATTRIBUTE = "datadog.context.path"; | ||
public static final String DD_SERVLET_PATH_ATTRIBUTE = "datadog.servlet.path"; | ||
private static final boolean DATA_STREAMS_ENABLED = Config.get().isDataStreamsEnabled(); |
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.
Same question as above.
|| (dsmContext = DataStreamsContext.fromContext(context)) == null | ||
|| (traceConfig = span.traceConfig()) == null | ||
|| !traceConfig.isDataStreamsEnabled()) { |
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 this check is the same as the one in UriBasedClientDecorator.java. Is there a need to have it in both places? I would understand that having this check in UriBasedClientDecorator
and the 2 GrpcClientDecorator
could be repetitive, so could we remove all checks to traceConfig
except this one?
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 to me, a few notes on context that might impact this work:
- We are looking into enabling Data Streams by default in the tracer (we are doing .NET first)
- We might drop HTTP & Grpc support by default for Data Streams, since most of the time, HTTP & Grpc calls are synchronous, and don't belong in data streams.
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 didn't look into the difference between tracerConfig
and the global Config.get()
, so I don't know if there is a difference.
However, Data Streams can be enabled at runtime via remote configuration. So it's important we don't store is_data_streams_enabled
in a long lived variable.
final TraceConfig tracerConfig; | ||
return (agentSpan = AgentSpan.fromContext(context)) != null | ||
&& (tracerConfig = agentSpan.traceConfig()) != null | ||
&& tracerConfig.isDataStreamsEnabled(); |
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.
for the first one, Data Streams can be enabled via remote configuration. I don't know if Config.get()
only returns the initial configuration or not.
final TraceConfig tracerConfig; | ||
return (agentSpan = AgentSpan.fromContext(context)) != null | ||
&& (tracerConfig = agentSpan.traceConfig()) != null | ||
&& tracerConfig.isDataStreamsEnabled(); |
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.
for the second one, it makes sense to me. I agree it's annoying to have to get the config from the span though, in other languages, I believe we are able to get the config even when there is no active span.
...rpc/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcClientDecorator.java Outdated Show resolved Hide resolved
| ||
private static final Set<String> IGNORED_METHODS = Config.get().getGrpcIgnoredOutboundMethods(); | ||
private static final BitSet CLIENT_ERROR_STATUSES = Config.get().getGrpcClientErrorStatuses(); | ||
private static final boolean DATA_STREAMS_ENABLED = Config.get().isDataStreamsEnabled(); |
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.
same here, not sure if this is compatible with activation via remote configuration
Remove active span coupling and use trace dynamic config instead
9889997
to e67e217
Compare
Nice, it could be the right time to write some benchmarks (cc @bric3 about providing support and doc for) and consider moving the That will help with the incoming modularization effort too (cc @dougqh). |
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
| Package | Type | Package file | Manager | Update | Change | |---|---|---|---|---|---| | [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://github.com/google/error-prone)) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `2.39.0` -> `2.40.0` | | [org.apache.commons:commons-lang3](https://commons.apache.org/proper/commons-lang/) ([source](https://gitbox.apache.org/repos/asf/commons-lang.git)) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `3.17.0` -> `3.18.0` | | [org.jetbrains.kotlinx.binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator) | plugin | misk/gradle/libs.versions.toml | gradle | patch | `0.18.0` -> `0.18.1` | | [com.datadoghq:dd-trace-api](https://github.com/datadog/dd-trace-java) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `1.50.1` -> `1.51.0` | | [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.77` -> `2.31.78` | | [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.77` -> `2.31.78` | | [software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.77` -> `2.31.78` | | [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.77` -> `2.31.78` | | [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.77` -> `2.31.78` | | [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.77` -> `2.31.78` | | [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.77` -> `2.31.78` | --- ### Release Notes <details> <summary>google/error-prone (com.google.errorprone:error_prone_annotations)</summary> ### [`v2.40.0`](https://github.com/google/error-prone/releases/tag/v2.40.0): Error Prone 2.40.0 Changes: - Bug fixes and improvements - Releases (including snapshots) have migrated from [OSSRH to the Central Publisher Portal](https://central.sonatype.org/pages/ossrh-eol/#process-to-migrate) Full changelog: google/error-prone@v2.39.0...v2.40.0 </details> <details> <summary>Kotlin/binary-compatibility-validator (org.jetbrains.kotlinx.binary-compatibility-validator)</summary> ### [`v0.18.1`](https://github.com/Kotlin/binary-compatibility-validator/releases/tag/0.18.1) [Compare Source](Kotlin/binary-compatibility-validator@0.18.0...0.18.1) #### What's Changed - Fixed a bug preventing use of cross-compilation support during KLIB dump validation \[[#​304](https://github.com/Kotlin/binary-compatibility-validator/issues/304)]\[[#​306](https://github.com/Kotlin/binary-compatibility-validator/issues/306)] </details> <details> <summary>datadog/dd-trace-java (com.datadoghq:dd-trace-api)</summary> ### [`v1.51.0`](https://github.com/DataDog/dd-trace-java/releases/tag/v1.51.0): 1.51.0 ### Components #### Application Security Management (IAST) - 🐛 Fix verify error when ctor params are used after a call site ([#​9083](DataDog/dd-trace-java#9083) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - 🐛 Limit the maximum size of the location path in IAST vulnerabilities ([#​9028](DataDog/dd-trace-java#9028) - [@​jandro996](https://github.com/jandro996)) - 🐛 Fix IAST gRPC handler with null superclass ([#​8984](DataDog/dd-trace-java#8984) - [@​smola](https://github.com/smola)) - ✨ Optimize IAST Vulnerability Detection ([#​8885](DataDog/dd-trace-java#8885) - [@​jandro996](https://github.com/jandro996)) #### Application Security Management (WAF) - ✨ Upgrade libddwaf-java to 15.0.0 ([#​9022](DataDog/dd-trace-java#9022) - [@​sezen-datadog](https://github.com/sezen-datadog)) - ✨ Extract RestEasy json body response schemas ([#​9015](DataDog/dd-trace-java#9015) - [@​jandro996](https://github.com/jandro996)) - ✨ Extract Jersey json body response schemas ([#​9014](DataDog/dd-trace-java#9014) - [@​jandro996](https://github.com/jandro996)) - ✨ Extract Ratpack json body response schemas ([#​9013](DataDog/dd-trace-java#9013) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Enable API Security by default and make it lazy loading ([#​9009](DataDog/dd-trace-java#9009) - [@​smola](https://github.com/smola)) - ✨ Extract Vert.x json body response schemas ([#​9001](DataDog/dd-trace-java#9001) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Extract Play json body response schemas ([#​8995](DataDog/dd-trace-java#8995) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - 🐛 Fix Jackson nodes introspection for request/response schema extraction ([#​8980](DataDog/dd-trace-java#8980) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Extract Spring json body response schemas ([#​8938](DataDog/dd-trace-java#8938) - [@​sezen-datadog](https://github.com/sezen-datadog)) - ✨ Default obfuscation regexp update ([#​8937](DataDog/dd-trace-java#8937) - [@​sezen-datadog](https://github.com/sezen-datadog)) #### Build & Tooling - ✨ Cancel GitLab running pipeline on new PR push ([#​9023](DataDog/dd-trace-java#9023) - [@​PerfectSlayer](https://github.com/PerfectSlayer)) - ✨ Migrate publishing to Maven Central Portal ([#​8807](DataDog/dd-trace-java#8807) - [@​sarahchen6](https://github.com/sarahchen6)) #### Continuous Integration Visibility - 🐛 Fix Test Optimization to work with JDK 24 ([#​9114](DataDog/dd-trace-java#9114) - [@​nikita-tkachenko-datadog](https://github.com/nikita-tkachenko-datadog)) - ✨ Add repo root as safe directory on git client creation ([#​9033](DataDog/dd-trace-java#9033) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Add PR number tag and improve PR information building ([#​8990](DataDog/dd-trace-java#8990) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) - ✨ Update impacted tests logic ([#​8923](DataDog/dd-trace-java#8923) - [@​daniel-mohedano](https://github.com/daniel-mohedano)) #### Data Streams Monitoring - 🧹 Clean up DSM context injection ([#​8776](DataDog/dd-trace-java#8776) - [@​PerfectSlayer](https://github.com/PerfectSlayer)) #### Database Monitoring - 🐛 Set trace\_injected in try block ([#​9025](DataDog/dd-trace-java#9025) - [@​natashadada](https://github.com/natashadada)) #### Dynamic Instrumentation - 🐛 Add source file tracking enable option ([#​9115](DataDog/dd-trace-java#9115) - [@​jpbempel](https://github.com/jpbempel)) - ✨ Add java.util.Date support ([#​9111](DataDog/dd-trace-java#9111) - [@​jpbempel](https://github.com/jpbempel)) - ✨ Update file probe format ([#​9047](DataDog/dd-trace-java#9047) - [@​jpbempel](https://github.com/jpbempel)) - ✨ add safe local var hoisting ([#​9034](DataDog/dd-trace-java#9034) - [@​jpbempel](https://github.com/jpbempel)) - 🧹 Add new config for debugger upload interval ([#​8959](DataDog/dd-trace-java#8959) - [@​jpbempel](https://github.com/jpbempel)) - ✨ Enable Code Origin with Dynamic instrumentation ([#​8940](DataDog/dd-trace-java#8940) - [@​jpbempel](https://github.com/jpbempel)) #### ML Observability (LLMObs) - 💡 LLM Observability SDK ([#​8781](DataDog/dd-trace-java#8781) - [@​gary-huang](https://github.com/gary-huang), [@​nayeem-kamal](https://github.com/nayeem-kamal)) #### Metrics - 🐛 Ensure client stat reporter is started when the agent is not available at bootstrap ([#​9082](DataDog/dd-trace-java#9082) - [@​amarziali](https://github.com/amarziali)) - ✨ Create metric: appsec.waf.config\_errors ([#​8394](DataDog/dd-trace-java#8394) - [@​sezen-datadog](https://github.com/sezen-datadog)) #### Platform components - ✨ Introduce environment component ([#​9071](DataDog/dd-trace-java#9071) - [@​PerfectSlayer](https://github.com/PerfectSlayer)) #### Profiling - 🐛 Remove annoying warning for smap event parsing ([#​9119](DataDog/dd-trace-java#9119) - [@​jbachorik](https://github.com/jbachorik)) - 🐛 Fix ByteCountingInputStream when reading past EOF ([#​8988](DataDog/dd-trace-java#8988) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) #### Realtime User Monitoring - ✨ Add RUM SDK injection for servlet based web servers ([#​9110](DataDog/dd-trace-java#9110) - [@​PerfectSlayer](https://github.com/PerfectSlayer) [@​amarziali](https://github.com/amarziali)) #### Telemetry - ✨ Update the config origin metric to match what it's mapping ([#​9045](DataDog/dd-trace-java#9045) - [@​sezen-datadog](https://github.com/sezen-datadog)) #### Testing - ✨ Add testing for latest stable version (JDK 24) ([#​8875](DataDog/dd-trace-java#8875) - [@​sarahchen6](https://github.com/sarahchen6)) #### Trace context propagation - 🐛 Fix bug with dropping baggage when `TracePropagationBehaviorExtract=IGNORE` ([#​9037](DataDog/dd-trace-java#9037) - [@​mhlidd](https://github.com/mhlidd)) - 🐛 Fix ArrayIndexOutOfBoundsException in PercentEscaper ([#​9032](DataDog/dd-trace-java#9032) - [@​mhlidd](https://github.com/mhlidd)) #### Tracer core - 🐛 Fix `Error` handling for trace interceptors ([#​9097](DataDog/dd-trace-java#9097) - [@​AlexeyKuznetsov-DD](https://github.com/AlexeyKuznetsov-DD)) - 💡 Add wildcard feature for `DD_TRACE_HEADER_TAGS` and enabling for Http Response headers ([#​9067](DataDog/dd-trace-java#9067) - [@​mhlidd](https://github.com/mhlidd)) #### Tracer public API - 💡 Add LLM Observability SDK ([#​8781](DataDog/dd-trace-java#8781) - [@​gary-huang](https://github.com/gary-huang)) ### Instrumentations #### Akka instrumentation - 🐛 Fix NPE in akka-http and pekko-http integrations ([#​9019](DataDog/dd-trace-java#9019) - [@​mcculls](https://github.com/mcculls)) #### Eclipse Vert.x instrumentation - ✨ Extract Vert.x json body response schemas ([#​9001](DataDog/dd-trace-java#9001) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) - ✨ Write http.route tag as soon as possible in vert.x ([#​8952](DataDog/dd-trace-java#8952) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) #### JAX-WS instrumentation - 💡⚠️ Enable jax-ws integration by default ([#​9030](DataDog/dd-trace-java#9030) - [@​bm1549](https://github.com/bm1549)) - ✨ Extract Jersey json body response schemas ([#​9014](DataDog/dd-trace-java#9014) - [@​jandro996](https://github.com/jandro996)) #### Mule instrumentation - 🐛 Propagate grizzly http span in filters if nothing is active ([#​9016](DataDog/dd-trace-java#9016) - [@​amarziali](https://github.com/amarziali)) #### Play Framework instrumentation - ✨ Extract Play json body response schemas ([#​8995](DataDog/dd-trace-java#8995) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) #### Ratpack instrumentation - ✨ Extract Ratpack json body response schemas ([#​9013](DataDog/dd-trace-java#9013) - [@​manuel-alvarez-alvarez](https://github.com/manuel-alvarez-alvarez)) #### Spring instrumentation - ✨ Extract Spring json body response schemas ([#​8938](DataDog/dd-trace-java#8938) - [@​sezen-datadog](https://github.com/sezen-datadog)) </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. 👻 **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: 649b690d4c9d7dcb572c457f0802b42b8e3e682e
What Does This Do
This PR introduce context injection helper methods for HTTP client and server decorators.
Those new methods now handle the Data Streams context injection too, simplifying the instrumentation themselves.
DSM was also refactor to own its data / logic into its own classes rather than relying on the generic tracing ones.
Context API usage was simplified too.
Motivation
This will simplify instrumentation logic by removing most of the DSM code, unless DSM actually has interesting data to send.
This will also reduce context allocation by not updating context if DSM is not enabled.
DSM refactoring should help with code ownership.
Context refactoring should help to set examples about how to use it.
Additional Notes
Injection was moved to the
UriBasedClientDecorator
rather than theHttpClientDecorator
as it is needed for theUrlConnectionDecorator
too.I though about reusing
HttpClientDecorator
REQUEST
type for theinjectContext()
method and add an abstractsetter()
method (similar to theHttpServerDecorator.getter()
method) but 1. not all setters are stateless (immutable collection make setters need to update their internal references once a field is set) 2.REQUEST
and carrier are not always the same type.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: LANGPLAT-474