Commit acc4558
fix: fix Synapse 3.0 instrumentation bugs and harden span propagation
Three deterministic bugs fixed:
1. Key mismatch in PassthruInstrumentation: PR #9422 renamed the context
key constant but forgot to update the hardcoded string literal in
SynapsePassthruInstrumentation, breaking parent span propagation
across the passthru mechanism.
2. http.url test assertion: QueryObfuscator recombines http.url with the
query string after obfuscation. The test expected path-only but the
actual value correctly includes the query string.
3. Missing peer.service in V1 client spans: SynapseClientDecorator
returns relative URIs (no host), so peer.hostname was never set.
Added peer hostname/IP/port extraction from NHttpClientConnection.
Additionally, hardened the passthru span propagation to read the server
span directly from the source connection context rather than relying
solely on activeSpan(). SourceHandler.requestReceived() dispatches to a
worker thread pool, and while java-concurrent instrumentation normally
handles context propagation across ThreadPoolExecutor, the connection-
based lookup is more robust.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f4fa29a commit acc4558
File tree
3 files changed
+42
-6
lines changed- dd-java-agent/instrumentation/synapse-3.0/src
- main/java/datadog/trace/instrumentation/synapse3
- test/groovy/datadog/trace/instrumentation/synapse3
3 files changed
+42
-6
lines changedLines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
110 | 125 | | |
111 | 126 | | |
112 | 127 | | |
| |||
Lines changed: 23 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
56 | | - | |
57 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
58 | 78 | | |
59 | | - | |
| 79 | + | |
60 | 80 | | |
61 | 81 | | |
62 | 82 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
| |||
311 | 314 | | |
312 | 315 | | |
313 | 316 | | |
314 | | - | |
315 | 317 | | |
316 | 318 | | |
317 | 319 | | |
| |||
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
324 | | - | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| |||
0 commit comments