Commit 693449b
Fix Synapse 3.0 instrumentation bugs and harden span propagation (#10892)
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>
fix: delegate peer tagging to BaseDecorator for IPv6 and config support
Use DECORATE.onPeerConnection() and setPeerPort() instead of manually
setting peer tags. This correctly classifies IPv6 addresses as peer.ipv6
(instead of forcing peer.ipv4) and honors the trace.peer.hostname.enabled
config toggle for peer.hostname.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge branch 'master' into brian.marks/fix-synapse-instrumentation-bugs
Co-authored-by: jordan-wong <61242306+jordan-wong@users.noreply.github.com>
Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>1 parent 4666c89 commit 693449b
File tree
3 files changed
+35
-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
+35
-6
lines changedLines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
| |||
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