otelgrpc's UnaryServerInterceptor cannot send metrics with correct grpc status code #4480
Labels
area: instrumentation
Related to an instrumentation package
bug
Something isn't working
instrumentation: otelgrpc
Milestone
Description
In this part of the code, as it is in a
defer
call, thestatusCode
seems to be always 0 and cannot be set to the actual status returned by the handler call.opentelemetry-go-contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go
Lines 370 to 375 in 5adc271
I guess instead of using
defer
and moving that piece of code after the handler call should make it work?The text was updated successfully, but these errors were encountered: