Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed May 30, 2024
1 parent 436de0d commit c14cd47
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion baseapp/grpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
otelcodes "go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/trace"

Expand Down Expand Up @@ -90,7 +91,15 @@ func (app *BaseApp) RegisterGRPCServer(server gogogrpc.Server, logQueries bool)

span.SetAttributes(attribute.String("http.method", grpcInfo.FullMethod))

return handler(grpcCtx, req)
resp, err = handler(grpcCtx, req)

if err != nil {
span.SetStatus(otelcodes.Error, err.Error())
} else {
span.SetStatus(otelcodes.Ok, "OK")
}

return resp, err
}

// Loop through all services and methods, add the interceptor, and register
Expand Down

0 comments on commit c14cd47

Please sign in to comment.