Close inner stream before finalizing trace span

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-13 19:40:54 +01:00
parent 91be6dcbfb
commit cb6189d7ac
2 changed files with 40 additions and 7 deletions

View File

@@ -112,8 +112,13 @@ func (s *tracedStream) Err() error {
}
func (s *tracedStream) Close() error {
err := s.inner.Close()
if err != nil {
s.span.RecordError(err)
s.span.SetStatus(codes.Error, err.Error())
}
s.finalizeSpan()
return s.inner.Close()
return err
}
func (s *tracedStream) finalizeSpan() {