New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contrib/google.golang.org/grpc: add WithErrorCheck
option
#2035
base: main
Are you sure you want to change the base?
Changes from 6 commits
08a7e75
252e275
06ce818
6a8cac1
057eaab
c6b7f79
fb4336f
50c90b2
0fd73e7
b925a3a
100083f
6a3227e
5b83467
4fca224
cff830c
ca200c3
7f0c9b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -43,6 +43,7 @@ func (h *serverStatsHandler) TagRPC(ctx context.Context, rti *stats.RPCTagInfo) | |||||||||||||||||||||||||
h.cfg.serviceName, | ||||||||||||||||||||||||||
spanOpts..., | ||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||
ctx = context.WithValue(ctx, fullMethodNameKey{}, rti.FullMethodName) | ||||||||||||||||||||||||||
return ctx | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
@@ -52,8 +53,16 @@ func (h *serverStatsHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { | |||||||||||||||||||||||||
if !ok { | ||||||||||||||||||||||||||
return | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
val := ctx.Value(fullMethodNameKey{}) | ||||||||||||||||||||||||||
if val == nil { | ||||||||||||||||||||||||||
return | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
fullMethod, ok := val.(string) | ||||||||||||||||||||||||||
if !ok { | ||||||||||||||||||||||||||
return | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Returning early here will result in
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are correct, finishWithError needs to be called. I made a mistake. Thanks. |
||||||||||||||||||||||||||
if v, ok := rs.(*stats.End); ok { | ||||||||||||||||||||||||||
finishWithError(span, v.Error, h.cfg) | ||||||||||||||||||||||||||
finishWithError(span, v.Error, fullMethod, h.cfg) | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, don't we want to run
finishWithError
regardless?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it, too.
5b83467