Skip to content

Commit ec74474

Browse files
timvermeulenTim Vermeulen
andauthored
fix: Implement tower::Service for OtelGrpcService (#201)
Co-authored-by: Tim Vermeulen <tim@bitonic.nl>
1 parent b0ead85 commit ec74474

File tree

1 file changed

+3
-3
lines changed
  • tonic-tracing-opentelemetry/src/middleware

1 file changed

+3
-3
lines changed

tonic-tracing-opentelemetry/src/middleware/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88
task::{Context, Poll},
99
};
1010
use tonic::client::GrpcService;
11-
use tower::Layer;
11+
use tower::{Layer, Service};
1212
use tracing::Span;
1313
use tracing_opentelemetry_instrumentation_sdk::{find_context_from_tracing, http as otel_http};
1414

@@ -34,7 +34,7 @@ pub struct OtelGrpcService<S> {
3434
inner: S,
3535
}
3636

37-
impl<S, B, B2> GrpcService<B> for OtelGrpcService<S>
37+
impl<S, B, B2> Service<Request<B>> for OtelGrpcService<S>
3838
where
3939
S: GrpcService<B, ResponseBody = B2> + Clone + Send + 'static,
4040
S::Future: Send + 'static,
@@ -43,7 +43,7 @@ where
4343
// B2: tonic::codegen::Body,
4444
B2: http_body::Body,
4545
{
46-
type ResponseBody = B2;
46+
type Response = Response<B2>;
4747
type Error = S::Error;
4848
type Future = ResponseFuture<S::Future>;
4949
// #[allow(clippy::type_complexity)]

0 commit comments

Comments
 (0)