1- use crate :: { transport :: tls , Addr } ;
1+ use linkerd2_addr :: Addr ;
22use std:: fmt;
33
44#[ derive( Clone , Debug ) ]
55pub struct ControlAddr {
66 pub addr : Addr ,
7- pub identity : tls:: PeerIdentity ,
7+ pub identity : crate :: transport :: tls:: PeerIdentity ,
88}
99
1010impl fmt:: Display for ControlAddr {
@@ -16,9 +16,10 @@ impl fmt::Display for ControlAddr {
1616/// Sets the request's URI from `Config`.
1717pub mod add_origin {
1818 use super :: ControlAddr ;
19- use crate :: { svc, Error } ;
19+ use crate :: svc;
2020 use futures:: try_ready;
2121 use futures:: { Future , Poll } ;
22+ use linkerd2_error:: Error ;
2223 use std:: marker:: PhantomData ;
2324 use tower_request_modifier:: { Builder , RequestModifier } ;
2425
@@ -145,10 +146,14 @@ pub mod add_origin {
145146/// Resolves the controller's `addr` once before building a client.
146147pub mod resolve {
147148 use super :: { client, ControlAddr } ;
148- use crate :: { dns, logging, svc, Addr } ;
149+ use crate :: dns;
150+ use crate :: svc;
149151 use futures:: { try_ready, Future , Poll } ;
152+ use linkerd2_addr:: Addr ;
150153 use std:: net:: SocketAddr ;
151154 use std:: { error, fmt} ;
155+ use tracing:: info_span;
156+ use tracing_futures:: { Instrument , Instrumented } ;
152157
153158 #[ derive( Clone , Debug ) ]
154159 pub struct Layer {
@@ -177,7 +182,7 @@ pub mod resolve {
177182 config : ControlAddr ,
178183 stack : M ,
179184 } ,
180- Inner ( M :: Future ) ,
185+ Inner ( Instrumented < M :: Future > ) ,
181186 }
182187
183188 #[ derive( Debug ) ]
@@ -263,10 +268,10 @@ pub mod resolve {
263268 let target = client:: Target {
264269 addr,
265270 server_name : dst. identity . clone ( ) ,
266- log_ctx : logging:: admin ( ) . client ( "control" , dst. addr . clone ( ) ) ,
267271 } ;
268272
269- State :: Inner ( mk_svc. call ( target) )
273+ info_span ! ( "control" , peer. addr = %addr, peer. identity = ?dst. identity)
274+ . in_scope ( move || State :: Inner ( mk_svc. call ( target) . in_current_span ( ) ) )
270275 }
271276 }
272277
@@ -289,15 +294,14 @@ pub mod resolve {
289294pub mod client {
290295 use super :: super :: config:: H2Settings ;
291296 use crate :: transport:: { connect, tls} ;
292- use crate :: { logging , proxy:: http, svc, task , Addr } ;
297+ use crate :: { proxy:: http, svc} ;
293298 use futures:: Poll ;
294299 use std:: net:: SocketAddr ;
295300
296301 #[ derive( Clone , Debug ) ]
297302 pub struct Target {
298303 pub ( super ) addr : SocketAddr ,
299304 pub ( super ) server_name : tls:: PeerIdentity ,
300- pub ( super ) log_ctx : logging:: Client < & ' static str , Addr > ,
301305 }
302306
303307 #[ derive( Debug ) ]
@@ -326,7 +330,7 @@ pub mod client {
326330 http:: h2:: Connect < C , B > : svc:: Service < Target > ,
327331 {
328332 svc:: layer:: mk ( |mk_conn| {
329- let inner = http:: h2:: Connect :: new ( mk_conn, task :: LazyExecutor , H2Settings :: default ( ) ) ;
333+ let inner = http:: h2:: Connect :: new ( mk_conn, H2Settings :: default ( ) ) ;
330334 Client { inner }
331335 } )
332336 }
@@ -341,13 +345,13 @@ pub mod client {
341345 type Error = <http:: h2:: Connect < C , B > as svc:: Service < Target > >:: Error ;
342346 type Future = <http:: h2:: Connect < C , B > as svc:: Service < Target > >:: Future ;
343347
348+ #[ inline]
344349 fn poll_ready ( & mut self ) -> Poll < ( ) , Self :: Error > {
345350 self . inner . poll_ready ( )
346351 }
347352
353+ #[ inline]
348354 fn call ( & mut self , target : Target ) -> Self :: Future {
349- let exe = target. log_ctx . clone ( ) . with_remote ( target. addr ) . executor ( ) ;
350- self . inner . set_executor ( exe) ;
351355 self . inner . call ( target)
352356 }
353357 }
0 commit comments