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
Access HTTP2 headers in Client/Server interceptors #7711
Comments
Not as such. Our API surface is gRPC and not HTTP/2. Most HTTP libraries wouldn't even expose those directly as HTTP/2 headers, even if it happens to use HTTP/2. On server-side ServerCall provides some of what you need: authority is available via Client-side has
No, no, no. That is very internal and is free to change at any time. I'd be tempted to rename the class each release to purposefully break your hack. |
Thanks for the write-up. I will have a look and report back.
Shall I open an issue to track it separatelly? How do I infer scheme based on
😄 !!! (btw. we download all defined gRPC versions from maven and check if such API exists :) to recognize potential API incompatibilities at agent compile time.) |
Yeah, go ahead. It would allow us a place to discuss the API. CC me when creating it.
Yeah. |
I created #7719 to track the addition of SecurityLevel to server-side. |
@pavolloffay, it seems this is resolved from our side from now. If there's additional discussion you need, you can comment and we can reopen. #7719 will continue tracking that specific SecurityLevel addition. |
thanks @ejona86 :love |
Hello,
we are writing OpenTelemetry based Java agent https://github.com/hypertrace/javaagent. The agent does bytecode manipulation via ByteBuddy however the implementation just installs gRPC interceptors - https://github.com/hypertrace/javaagent/blob/main/instrumentation/grpc-1.5/src/main/java/io/opentelemetry/instrumentation/hypertrace/grpc/v1_5/server/GrpcServerBodyInstrumentation.java#L60
In the interceptors we would like to capture HTTP2 headers - authority, method, scheme and path. However this are not propagated from the transport (e.g. netty) to the interceptors. Is there any supported way to access these headers in gRPC interceptors?
Currently our implementation uses hacks and it instruments
io.grpc.netty.Utils#convertHeaders
. The instrumentation adds HTTP2 headers into gRPCMetadata
object. This works well for the server side, although we don't like that we store additional data to Metadata. For the client it does not work and we had to instrumentio.grpc.netty.Utils#convertClientHeaders
and put the HTTP2 headers directly to span object - accessed via thread local - this does not work for the first request when DelayedStream is used see hypertrace/javaagent#109 (comment).Any hits are appreciated.
The text was updated successfully, but these errors were encountered: