Releases: GoodNotes/dd-trace-java
Releases · GoodNotes/dd-trace-java
Goodnotes fix: Netty streaming span lifecycle (v1.60.0)
Goodnotes patch on top of dd-java-agent 1.60.0
Fixes DataDog APM instrumentation for Ktor/Netty streaming endpoints (respondOutputStream):
Problem: HttpServerResponseTracingHandler closes the root span when HTTP headers are written, not when the stream completes. This causes near-zero latency and always-200 status codes in DD APM for streaming responses.
Three fixes in dd-java-agent/instrumentation/netty/netty-4.1:
- Correct
instanceofcheck order —FullHttpResponsebeforeHttpResponsebeforeLastHttpContent - Span lifecycle tied to stream end — span finishes on
LastHttpContent, not on header write STREAMING_CONTEXT_KEY— separate channel attribute for streaming spans, immune to keep-alive race condition
Validated with 5-min load test (110 threads, 46k requests, 0 failures):
- Streaming fast (5×10ms chunks): p50 54ms ✅ (was ~0ms)
- Streaming slow (5×1s chunks): p50 5002ms ✅ (was ~0ms)
Upstream PR: DataDog#10656
Branch: gsc-577-fix-ktor-streaming-instrumentation