Skip to content

Commit 40a622e

Browse files
authored
fix(inbound): instrument http connections in tagged transport stack (#3707)
Currently, TCP metrics are not logged for HTTP requests coming in through the tagged transport header stack. This adds that instrumentation, like we do for the opaque and gateway stacks already present. Signed-off-by: Scott Fleener <[email protected]>
1 parent cf4ef39 commit 40a622e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

linkerd/app/inbound/src/direct.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<N> Inbound<N> {
9393
self,
9494
policies: impl policy::GetPolicy + Clone + Send + Sync + 'static,
9595
gateway: svc::ArcNewTcp<GatewayTransportHeader, GatewayIo<I>>,
96-
http: svc::ArcNewTcp<LocalHttp, io::PrefixedIo<TlsIo<I>>>,
96+
http: svc::ArcNewTcp<LocalHttp, SensorIo<io::PrefixedIo<TlsIo<I>>>>,
9797
) -> Inbound<svc::ArcNewTcp<T, I>>
9898
where
9999
T: Param<Remote<ClientAddr>> + Param<OrigDstAddr>,
@@ -135,7 +135,14 @@ impl<N> Inbound<N> {
135135
// forwarding, or we may be processing an HTTP gateway connection. HTTP gateway
136136
// connections that have a transport header must provide a target name as a part of
137137
// the header.
138-
.push_switch(Ok::<Local, Infallible>, http)
138+
.push_switch(
139+
Ok::<Local, Infallible>,
140+
svc::stack(http)
141+
.push(transport::metrics::NewServer::layer(
142+
rt.metrics.proxy.transport.clone(),
143+
))
144+
.into_inner(),
145+
)
139146
.push_switch(
140147
{
141148
let policies = policies.clone();

0 commit comments

Comments
 (0)