Skip to content

Commit

Permalink
debug -> trace
Browse files Browse the repository at this point in the history
  • Loading branch information
meowjesty committed Oct 10, 2024
1 parent 5c02661 commit 5b7fc0b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
18 changes: 10 additions & 8 deletions mirrord/agent/src/steal/connections/filtered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand All @@ -579,7 +585,6 @@ where
connection_id: self.connection_id,
})
.await?;
tracing::info!("It's the first time!");
}

let id = self.next_request_id;
Expand All @@ -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(())
}

Expand Down
2 changes: 1 addition & 1 deletion mirrord/agent/src/steal/http/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct NormalizedHeaders(Vec<String>);

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
Expand Down
4 changes: 2 additions & 2 deletions mirrord/cli/src/internal_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions mirrord/intproxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mirrord/intproxy/src/proxies/incoming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TcpSocket> {
match addr.ip() {
IpAddr::V4(Ipv4Addr::UNSPECIFIED) => {
Expand Down Expand Up @@ -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<StreamBody<ReceiverStream<Result<Frame<Bytes>, hyper::Error>>>>,
Expand Down
8 changes: 4 additions & 4 deletions mirrord/intproxy/src/proxies/incoming/interceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self>) -> InterceptorResult<(), Self::Error> {
let mut stream = self.socket.connect(self.peer).await?;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<Interceptor>,
Expand Down

0 comments on commit 5b7fc0b

Please sign in to comment.