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

gRPC AttributeExtractors should have access to gRPC Metadata passed to TracingClientCall.start() #6123

Closed
evantorrie opened this issue May 31, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@evantorrie
Copy link
Contributor

Is your feature request related to a problem? Please describe.

TL;DR; Custom AttributeExtractors added to instrumented gRPC client calls lack access to gRPC metadata sent in call.

Currently, the gRPC instrumentation constructs a GrpcRequest object at the beginning of interceptCall() at which point the gRPC Metadata is unset - set to null in the code.

gRPC Metadata for outgoing client calls is available at the point of TracingClientCall.start(Listener<RESPONSE> responseListener, Metadata header). However, the gRPC request object which is passed to instrumenter.end() never has its corresponding Metadata private field updated.

Describe the solution you'd like

instrumenter.end() calls each AttributeExtractor's onEnd() method. The request object passed to these methods should include an updated version of the metadata sourced from the metadata parameter passed to TracingClientCall.start().

Describe alternatives you've considered

Duplicating most of the code from the grpc Instrumentation simply to ensure that the GrpcRequest object is updated with the appropriate metadata to make it available to our own AttributeExtractors.

Additional context

This issue was raised at the May 10th Java SIG.

@evantorrie evantorrie added the enhancement New feature or request label May 31, 2022
@trask
Copy link
Member

trask commented Jun 1, 2022

hi @evantorrie! it would be great if you are able to send a PR for this

@laurit
Copy link
Contributor

laurit commented Jun 3, 2022

Resolved with #6125

@laurit laurit closed this as completed Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants