Skip to content

Commit

Permalink
chore(app/trace_collector): remove Default bounds (#3651)
Browse files Browse the repository at this point in the history
see linkerd/linkerd2#8733 for more information.

in hyper 1.x, `Incoming` bodies do not provide a `Default`
implementation. compare the trait implementations here:

* https://docs.rs/hyper/0.14.31/hyper/body/struct.Body.html#impl-Default-for-Body
* https://docs.rs/hyper/latest/hyper/body/struct.Incoming.html#trait-implementations

this commit removes these bounds from the
`linkerd_app::trace_collector::otel_collector::SpanExporter<T, S>` and
other connected functions.

Signed-off-by: katelyn martin <[email protected]>
  • Loading branch information
cratelyn authored Feb 25, 2025
1 parent ea8a970 commit 5ee4f71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion linkerd/app/src/trace_collector/otel_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ where
S: GrpcService<BoxBody> + Clone + Send + 'static,
S::Error: Into<Error>,
S::Future: Send,
S::ResponseBody: Default + Body<Data = tonic::codegen::Bytes> + Send + 'static,
S::ResponseBody: Body<Data = tonic::codegen::Bytes> + Send + 'static,
<S::ResponseBody as Body>::Error: Into<Error> + Send,
{
let (span_sink, spans_rx) = mpsc::channel(crate::trace_collector::SPAN_BUFFER_CAPACITY);
Expand Down
4 changes: 2 additions & 2 deletions linkerd/opencensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub async fn export_spans<T, S>(client: T, node: Node, spans: S, metrics: Regist
where
T: GrpcService<BoxBody> + Clone,
T::Error: Into<Error>,
T::ResponseBody: Default + Body<Data = tonic::codegen::Bytes> + Send + 'static,
T::ResponseBody: Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<Error> + Send,
S: Stream<Item = ExportSpan> + Unpin,
{
Expand All @@ -49,7 +49,7 @@ impl<T, S> SpanExporter<T, S>
where
T: GrpcService<BoxBody>,
T::Error: Into<Error>,
T::ResponseBody: Default + Body<Data = tonic::codegen::Bytes> + Send + 'static,
T::ResponseBody: Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<Error> + Send,
S: Stream<Item = ExportSpan> + Unpin,
{
Expand Down
4 changes: 2 additions & 2 deletions linkerd/opentelemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub async fn export_spans<T, S>(
) where
T: GrpcService<BoxBody> + Clone,
T::Error: Into<Error>,
T::ResponseBody: Default + Body<Data = tonic::codegen::Bytes> + Send + 'static,
T::ResponseBody: Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<Error> + Send,
S: Stream<Item = ExportSpan> + Unpin,
{
Expand All @@ -66,7 +66,7 @@ impl<T, S> SpanExporter<T, S>
where
T: GrpcService<BoxBody> + Clone,
T::Error: Into<Error>,
T::ResponseBody: Default + Body<Data = tonic::codegen::Bytes> + Send + 'static,
T::ResponseBody: Body<Data = tonic::codegen::Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<Error> + Send,
S: Stream<Item = ExportSpan> + Unpin,
{
Expand Down

0 comments on commit 5ee4f71

Please sign in to comment.