Skip to content

Commit

Permalink
outbound: Add logging for endpoint opaqueness (#1614)
Browse files Browse the repository at this point in the history
The outbound proxy's logging doesn't make it clear how targets decide
whether protocol detection is employed. This change adds debug logging
to make it easier to understand these decisions.

Signed-off-by: Oliver Gould <ver@buoyant.io>
  • Loading branch information
olix0r authored Apr 19, 2022
1 parent 7624cd2 commit 25a480b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions linkerd/app/outbound/src/http/detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ impl<N> Outbound<N> {
// detection and just use the TCP stack directly.
|target: T| -> Result<_, Infallible> {
if let Some(Skip) = target.param() {
tracing::debug!("Skipping HTTP protocol detection");
return Ok(svc::Either::B(target));
}
tracing::debug!("Attempting HTTP protocol detection");
Ok(svc::Either::A(target))
},
skipped,
Expand Down
6 changes: 5 additions & 1 deletion linkerd/app/outbound/src/switch_logical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,28 @@ impl<S> Outbound<S> {
// If the profile provides an endpoint, then the target is single endpoint and
// not a logical/load-balanced service.
if let Some((addr, metadata)) = rx.endpoint() {
let is_opaque = rx.is_opaque_protocol();
tracing::debug!(%is_opaque, "Profile describes an endpoint");
return Ok(svc::Either::A(Endpoint::from_metadata(
addr,
metadata,
no_tls_reason,
rx.is_opaque_protocol(),
is_opaque,
&*inbound_ips,
)));
}

// Otherwise, if the profile provides a (named) logical address, then we build a
// logical stack so we apply routes, traffic splits, and load balancing.
if let Some(logical_addr) = rx.logical_addr() {
tracing::debug!("Profile describes a logical service");
return Ok(svc::Either::B(Logical::new(logical_addr, rx)));
}
}

// If there was no profile or it didn't include any useful metadata, create a bare
// endpoint from the original destination address.
tracing::debug!("No profile; forwarding to the original destination");
Ok(svc::Either::A(Endpoint::forward(
target.param(),
no_tls_reason,
Expand Down

0 comments on commit 25a480b

Please sign in to comment.