-
Notifications
You must be signed in to change notification settings - Fork 821
[instrumentation/google.golang.org/grpc/otelgrpc] Do not assume HandleRPC receives a gRPCContext #4825
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
[instrumentation/google.golang.org/grpc/otelgrpc] Do not assume HandleRPC receives a gRPCContext #4825
Changes from 6 commits
bbff530
d263c04
d67730c
377c541
a4c3363
60fbb4e
2eb2a49
9be483c
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 |
|---|---|---|
|
|
@@ -135,10 +135,14 @@ func (h *clientHandler) HandleConn(context.Context, stats.ConnStats) { | |
|
|
||
| func (c *config) handleRPC(ctx context.Context, rs stats.RPCStats, isServer bool) { // nolint: revive // isServer is not a control flag. | ||
| span := trace.SpanFromContext(ctx) | ||
| gctx, _ := ctx.Value(gRPCContextKey{}).(*gRPCContext) | ||
| var metricAttrs []attribute.KeyValue | ||
| var messageId int64 | ||
| metricAttrs := make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1) | ||
| metricAttrs = append(metricAttrs, gctx.metricAttrs...) | ||
|
|
||
| gctx, ok := ctx.Value(gRPCContextKey{}).(*gRPCContext) | ||
| if ok && gctx != nil { | ||
| metricAttrs = make([]attribute.KeyValue, 0, len(gctx.metricAttrs)+1) | ||
|
mx-psi marked this conversation as resolved.
|
||
| metricAttrs = append(metricAttrs, gctx.metricAttrs...) | ||
|
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 can use
Member
Author
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. Since this was already there and I am only moving it inside the |
||
| } | ||
| wctx := withoutCancel(ctx) | ||
|
|
||
| switch rs := rs.(type) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.