diff --git a/mirrord/agent/src/steal/connections/filtered.rs b/mirrord/agent/src/steal/connections/filtered.rs index 4e8ece6f355..70447f42722 100644 --- a/mirrord/agent/src/steal/connections/filtered.rs +++ b/mirrord/agent/src/steal/connections/filtered.rs @@ -458,7 +458,7 @@ where /// Matches the given [`Request`] against [`Self::filters`] and state of [`Self::subscribed`]. #[tracing::instrument( - level = Level::DEBUG, + level = Level::TRACE, name = "match_request_with_filter", skip(self, request), fields( @@ -481,7 +481,7 @@ where /// If there is no blocked request for the given ([`ClientId`], [`RequestId`]) combination or /// the HTTP connection is dead, does nothing. #[tracing::instrument( - level = Level::DEBUG, + level = Level::TRACE, name = "handle_filtered_request_response", skip(self, response), fields( @@ -531,7 +531,7 @@ where /// If there is no blocked request for the given ([`ClientId`], [`RequestId`]) combination or /// the HTTP connection is dead, does nothing. #[tracing::instrument( - level = Level::DEBUG, + level = Level::TRACE, name = "handle_filtered_request_response_failure", skip(self), fields( @@ -555,7 +555,13 @@ where } /// Handles a [`Request`] intercepted by the [`FilteringService`]. - #[tracing::instrument(level = Level::INFO, skip(self, tx), fields(?request = request.request), ret, err(level = Level::WARN))] + #[tracing::instrument( + level = Level::TRACE, + skip(self, tx), + fields(?request = request.request), + ret, + err(level = Level::WARN) + )] async fn handle_request( &mut self, mut request: ExtractedRequest, @@ -579,7 +585,6 @@ where connection_id: self.connection_id, }) .await?; - tracing::info!("It's the first time!"); } let id = self.next_request_id; @@ -597,9 +602,6 @@ where self.blocked_requests .insert((client_id, id), request.response_tx); - let request_ids = self.blocked_requests.keys(); - tracing::debug!(?request_ids, "ids for stuff"); - Ok(()) } diff --git a/mirrord/agent/src/steal/http/filter.rs b/mirrord/agent/src/steal/http/filter.rs index cd5a418d380..8afcbc85f25 100644 --- a/mirrord/agent/src/steal/http/filter.rs +++ b/mirrord/agent/src/steal/http/filter.rs @@ -122,7 +122,7 @@ struct NormalizedHeaders(Vec); impl NormalizedHeaders { /// Checks whether any header in this set matches the given [`Regex`]. - #[tracing::instrument(level = Level::DEBUG, ret)] + #[tracing::instrument(level = Level::TRACE, ret)] fn has_match(&self, regex: &Regex) -> bool { self.0.iter().any(|header| { regex diff --git a/mirrord/cli/src/internal_proxy.rs b/mirrord/cli/src/internal_proxy.rs index 134a6ee37d5..3dede9072ac 100644 --- a/mirrord/cli/src/internal_proxy.rs +++ b/mirrord/cli/src/internal_proxy.rs @@ -86,11 +86,11 @@ pub(crate) async fn proxy(listen_port: u16, watch: drain::Watch) -> Result<(), I .internal_proxy .log_level .as_deref() - .unwrap_or("mirrord=debug,hyper=debug"); + .unwrap_or("mirrord=info,info"); tracing_subscriber::fmt() .with_writer(output_file) - .with_ansi(true) + .with_ansi(false) .with_env_filter(EnvFilter::builder().parse_lossy(log_level)) .pretty() .init(); diff --git a/mirrord/intproxy/Cargo.toml b/mirrord/intproxy/Cargo.toml index 75686dc27a8..c0da1dbc1f1 100644 --- a/mirrord/intproxy/Cargo.toml +++ b/mirrord/intproxy/Cargo.toml @@ -33,6 +33,7 @@ tokio.workspace = true tracing.workspace = true tokio-stream.workspace = true hyper = { workspace = true, features = ["client", "http1", "http2"] } +# For checking the `RST_STREAM` error from HTTP2 stealer + filter. h2 = "0.4" hyper-util.workspace = true http-body-util.workspace = true diff --git a/mirrord/intproxy/src/proxies/incoming.rs b/mirrord/intproxy/src/proxies/incoming.rs index b77a3689e61..bedae96e1ed 100644 --- a/mirrord/intproxy/src/proxies/incoming.rs +++ b/mirrord/intproxy/src/proxies/incoming.rs @@ -55,7 +55,7 @@ mod subscriptions; /// # Exception /// /// If the given `addr` is unspecified, this function binds to localhost. -#[tracing::instrument(level = Level::DEBUG, ret, err)] +#[tracing::instrument(level = Level::TRACE, ret, err)] fn bind_similar(addr: SocketAddr) -> io::Result { match addr.ip() { IpAddr::V4(Ipv4Addr::UNSPECIFIED) => { @@ -576,7 +576,7 @@ impl IncomingProxy { /// process, by sending the original `request` again through the http `interceptor` to /// our hyper handler. #[allow(clippy::type_complexity)] - #[tracing::instrument(level = Level::DEBUG, skip(self), ret)] + #[tracing::instrument(level = Level::TRACE, skip(self), ret)] async fn streamed_http_response( &mut self, mut response: HttpResponse, hyper::Error>>>>, diff --git a/mirrord/intproxy/src/proxies/incoming/interceptor.rs b/mirrord/intproxy/src/proxies/incoming/interceptor.rs index ee831c5b639..852ca7a143d 100644 --- a/mirrord/intproxy/src/proxies/incoming/interceptor.rs +++ b/mirrord/intproxy/src/proxies/incoming/interceptor.rs @@ -154,7 +154,7 @@ impl BackgroundTask for Interceptor { type MessageIn = MessageIn; type MessageOut = MessageOut; - #[tracing::instrument(level = Level::DEBUG, skip_all, err)] + #[tracing::instrument(level = Level::TRACE, skip_all, err)] async fn run(self, message_bus: &mut MessageBus) -> InterceptorResult<(), Self::Error> { let mut stream = self.socket.connect(self.peer).await?; @@ -248,7 +248,7 @@ impl HttpConnection { /// /// See [`HttpResponseFallback::response_from_request`] for notes on picking the correct /// [`HttpResponseFallback`] variant. - #[tracing::instrument(level = Level::DEBUG, skip(self, response), err(level = Level::WARN))] + #[tracing::instrument(level = Level::TRACE, skip(self, response), err(level = Level::WARN))] async fn handle_response( &self, request: HttpRequestFallback, @@ -365,7 +365,7 @@ impl HttpConnection { /// [`RETRY_ON_RESET_ATTEMPTS`]. /// /// Returns [`HttpResponseFallback`] from the server. - #[tracing::instrument(level = Level::DEBUG, skip(self), ret, err)] + #[tracing::instrument(level = Level::TRACE, skip(self), ret, err)] async fn send( &mut self, request: HttpRequestFallback, @@ -415,7 +415,7 @@ impl HttpConnection { /// /// When an HTTP upgrade happens, the underlying [`TcpStream`] is reclaimed, wrapped /// in a [`RawConnection`] and returned. When [`MessageBus`] closes, [`None`] is returned. - #[tracing::instrument(level = Level::DEBUG, skip_all, ret, err)] + #[tracing::instrument(level = Level::TRACE, skip_all, ret, err)] async fn run( mut self, message_bus: &mut MessageBus,