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
Cannot use TraceLayer with GrpcService #973
Comments
cc @davidpdrsn |
If you box the response body like this it works: let mut tester_client = TesterClient::new(
ServiceBuilder::new()
.layer(tower_http::map_response_body::MapResponseBodyLayer::new(http_body::Body::boxed_unsync))
.layer(tower_http::trace::TraceLayer::new_for_grpc())
.service(conn),
); Requires adding the |
Also, looking at https://github.com/NAlexPear/tonic/blob/2a61ea0e3e7e746f21a1f82f7d6e34bff58640c0/tonic-build/src/client.rs#L61 I think the |
I think you are correct. I've forked locally and can confirm that |
Sure! |
Fixed by #974 |
Bug Report
Version
tonic: 0.7.1
prost: 0.10
tonic-build: 0.7.0
tower: 0.4
tower-http: 0.2.5
Platform
N/A
Crates
tonic/tower-http
Description
tower-http
'strace::TraceLayer
is incompatible with a tonic client GrpcService. It'sResponse
does not implementDefault
, but since this change it's now required.Demo
We use this layer to automatically propagate our opentelemetry contexts
The text was updated successfully, but these errors were encountered: