AsperforMias opened a new issue, #3854:
URL: https://github.com/apache/dubbo-go/issues/3854

   ### What problem would this solve?
   
   For Triple streaming calls (client, server and bidi streaming), the consumer 
side has no usable traces or metrics.
   
   `TripleInvoker.Invoke` returns as soon as the stream is opened 
(`protocol/triple/triple_invoker.go`, the `CallClientStream` / 
`CallServerStream` / `CallBidiStream` cases put the stream object into the 
result). The consumer filter chain, including `otelClientTrace` and `metrics`, 
completes at that point, so:
   
   - the client span ends when the stream is opened, and its duration does not 
cover the stream;
   - consumer RPC metrics record the call when the stream is opened, so the RT 
is near zero and the request is counted as successful;
   - errors from sending, receiving or closing the stream later (provider 
errors, timeouts, cancellation, network failures) are not recorded on the span 
or in the failure metrics, and the span status stays `OK`.
   
   The provider side does not have this problem: the streaming handler runs 
inside `invoker.Invoke` (`protocol/triple/server.go`), so the server span and 
provider metrics cover the whole stream. The two sides of the same streaming 
call therefore disagree, and the consumer side cannot be used to diagnose slow 
or failed streams. `metrics/rpc/README.md` already lists this as a known limit.
   
   Part of #3562.
   
   ### Proposed solution (optional)
   
   End the consumer-side observation when the stream ends, not when it is 
opened:
   
   - Wrap the stream returned by the Triple invoker so that its completion (end 
of stream, error, or context cancellation) is detected once, whichever happens 
first.
   - Let the client trace filter and the metrics filter defer their completion 
for streaming results: end the client span and record the consumer RPC metrics 
on stream completion, with the stream's duration and its final error and error 
classification.
   - Keep unary calls unchanged.
   - Optionally record message counts sent and received on the span as 
attributes.
   
   This should not depend on unfinished work, and should be compatible with a 
multi-consumer `Observation` (#3835) if that lands first.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to