hseeberger / comments

0 stars 0 forks source link

2023-08-28-dist-tracing-3/ #2

Open utterances-bot opened 4 months ago

utterances-bot commented 4 months ago

Distributed Tracing in Rust, Episode 3: inter-service tracing

In the previous episode we were looking at the basics of tracing with the Tokio tracing framework and showed how to create traces inside a single service. Now let’s see how we can deal with inter-serv

https://heikoseeberger.de/2023-08-28-dist-tracing-3/

Guillaume-Fortin commented 4 months ago

Hello, Thanks for your documentation, it's very useful.

I have a trait problem when i upgrade all dependencies of your project. Could you take a time for check the problem?


error[E0277]: the trait bound `tower_http::trace::Trace<tower::util::MapRequest<tower::util::MapRequest<Route, fn(axum::http::Request<axum::body::Body>) -> axum::http::Request<axum::body::Body> {record_trace_id}>, fn(axum::http::Request<axum::body::Body>) -> axum::http::Request<axum::body::Body> {accept_trace}>, SharedClassifier<ServerErrorsAsFailures>, for<'a> fn(&'a axum::http::Request<axum::body::Body>) -> Span {api::make_span}>: Service<axum::http::Request<_>>` is not satisfied
   --> hello-tracing-gateway/src/api/mod.rs:44:13
    |
43  |           .layer(
    |            ----- required by a bound introduced by this call
44  | /             ServiceBuilder::new()
45  | |                 .layer(TraceLayer::new_for_http().make_span_with(make_span))
46  | |                 .map_request(accept_trace)
47  | |                 .map_request(record_trace_id),
    | |_____________________________________________^ the trait `Service<axum::http::Request<_>>` is not implemented for `Trace<MapRequest<MapRequest<Route, fn(Request<Body>) -> Request<Body> {record_trace_id}>, ...>, ..., ...>`
    |
    = help: the trait `Service<http::request::Request<ReqBody>>` is implemented for `tower_http::trace::Trace<S, M, MakeSpanT, OnRequestT, OnResponseT, OnBodyChunkT, OnEosT, OnFailureT>`
note: the method call chain might not have had the expected associated types
hseeberger commented 4 months ago

I think this is ultimately related to tonic not yet upgrading to http 1.0: https://github.com/hyperium/tonic/pull/1670.