Skip to content
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

otelgrpc: Add peer attributes to spans generated by stats handlers #4531

Closed
pellared opened this issue Nov 6, 2023 · 3 comments · Fixed by #4873
Closed

otelgrpc: Add peer attributes to spans generated by stats handlers #4531

pellared opened this issue Nov 6, 2023 · 3 comments · Fixed by #4873
Assignees
Labels
area: instrumentation Related to an instrumentation package enhancement New feature or request instrumentation: otelgrpc

Comments

@pellared
Copy link
Member

pellared commented Nov 6, 2023

The trace instrumentation implemented in #3002 misses peer attributes.

// TagConn can attach some information to the given context.
func (h *serverHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context {
span := trace.SpanFromContext(ctx)
attrs := peerAttr(peerFromCtx(ctx))
span.SetAttributes(attrs...)
return ctx
}

The span returned in TagConn is always noop as TagConn is invoked before TagRPC, therefore the peer attributes are never added to the spans.

Currently seems to be blocked by grpc/grpc-go#6897.

@pellared pellared added enhancement New feature or request area: instrumentation Related to an instrumentation package instrumentation: otelgrpc labels Nov 6, 2023
@pellared
Copy link
Member Author

pellared commented Nov 6, 2023

@fatsheep9146 Can you take a look at this issue?

@pellared pellared added bug Something isn't working and removed enhancement New feature or request labels Nov 6, 2023
@pellared pellared changed the title otelgrpc: Add peer attributes to spans generated by stats handlers otelgrpc: Missing peer attributes to spans generated by stats handlers Nov 6, 2023
@fatsheep9146
Copy link
Contributor

@fatsheep9146 Can you take a look at this issue?

No problem, please assign to me :)

@pellared
Copy link
Member Author

pellared commented Dec 28, 2023

Currently seems to be blocked by grpc/grpc-go#6897.

@pellared pellared changed the title otelgrpc: Missing peer attributes to spans generated by stats handlers otelgrpc: Add peer attributes to spans generated by stats handlers Dec 29, 2023
@pellared pellared added enhancement New feature or request and removed bug Something isn't working labels Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment