Skip to content

Commit 7a811f6

Browse files
committed
Revert "Merge branch 'ver/route-reqs-mtx'"
This reverts commit fdd2128, reversing changes made to 7859b9a.
1 parent fdd2128 commit 7a811f6

File tree

11 files changed

+30
-285
lines changed

11 files changed

+30
-285
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,6 @@ dependencies = [
10321032
name = "linkerd-app-outbound"
10331033
version = "0.1.0"
10341034
dependencies = [
1035-
"ahash",
10361035
"bytes",
10371036
"futures",
10381037
"http",

linkerd/app/outbound/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ test-subscriber = []
1616
test-util = ["linkerd-app-test", "linkerd-meshtls-rustls/test-util"]
1717

1818
[dependencies]
19-
ahash = "0.8"
2019
bytes = "1"
2120
http = "0.2"
2221
futures = { version = "0.3", default-features = false }

linkerd/app/outbound/src/http/logical.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ where
162162
S::Future: Send,
163163
{
164164
svc::layer::mk(move |concrete: N| {
165-
let policy = svc::stack(concrete.clone())
166-
.push(policy::Policy::layer(metrics.http_route_backends.clone()));
165+
let policy = svc::stack(concrete.clone()).push(policy::Policy::layer());
167166
let profile =
168167
svc::stack(concrete.clone()).push(profile::Params::layer(metrics.proxy.clone()));
169168
svc::stack(concrete)

linkerd/app/outbound/src/http/logical/policy.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod router;
88
mod tests;
99

1010
pub use self::{
11-
route::{backend::RouteBackendMetrics, errors},
11+
route::errors,
1212
router::{GrpcParams, HttpParams},
1313
};
1414
pub use linkerd_proxy_client_policy::{ClientPolicy, FailureAccrual};
@@ -45,17 +45,11 @@ where
4545
// Parent target type.
4646
T: Debug + Eq + Hash,
4747
T: Clone + Send + Sync + 'static,
48-
route::backend::ExtractMetrics:
49-
svc::ExtractParam<route::backend::RequestCount, route::backend::Http<T>>,
50-
// route::backend::ExtractMetrics:
51-
// svc::ExtractParam<route::backend::RequestCount, route::backend::Grpc<T>>,
5248
{
5349
/// Builds a stack that dynamically updates and applies HTTP or gRPC policy
5450
/// routing configurations to route requests over cached inner backend
5551
/// services.
56-
pub(super) fn layer<N, S>(
57-
route_backend_metrics: RouteBackendMetrics,
58-
) -> impl svc::Layer<
52+
pub(super) fn layer<N, S>() -> impl svc::Layer<
5953
N,
6054
Service = svc::ArcNewService<
6155
Self,
@@ -80,9 +74,8 @@ where
8074
S::Future: Send,
8175
{
8276
svc::layer::mk(move |inner: N| {
83-
let http =
84-
svc::stack(inner.clone()).push(router::Http::layer(route_backend_metrics.clone()));
85-
let grpc = svc::stack(inner).push(router::Grpc::layer(route_backend_metrics.clone()));
77+
let http = svc::stack(inner.clone()).push(router::Http::layer());
78+
let grpc = svc::stack(inner).push(router::Grpc::layer());
8679

8780
http.push_switch(
8881
|pp: Policy<T>| {

linkerd/app/outbound/src/http/logical/policy/route.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use crate::RouteRef;
2-
3-
use super::{super::Concrete, RouteBackendMetrics};
1+
use super::super::Concrete;
42
use linkerd_app_core::{classify, proxy::http, svc, Addr, Error, Result};
53
use linkerd_distribute as distribute;
64
use linkerd_http_route as http_route;
@@ -27,7 +25,7 @@ pub(crate) struct Matched<M, P> {
2725
pub(crate) struct Route<T, F, E> {
2826
pub(super) parent: T,
2927
pub(super) addr: Addr,
30-
pub(super) route_ref: RouteRef,
28+
pub(super) meta: Arc<policy::Meta>,
3129
pub(super) filters: Arc<[F]>,
3230
pub(super) distribution: BackendDistribution<T, F>,
3331
pub(super) failure_policy: E,
@@ -68,14 +66,11 @@ where
6866
Self: filters::Apply,
6967
Self: svc::Param<classify::Request>,
7068
MatchedBackend<T, M, F>: filters::Apply,
71-
backend::ExtractMetrics: svc::ExtractParam<backend::RequestCount, MatchedBackend<T, M, F>>,
7269
{
7370
/// Builds a route stack that applies policy filters to requests and
7471
/// distributes requests over each route's backends. These [`Concrete`]
7572
/// backends are expected to be cached/shared by the inner stack.
76-
pub(crate) fn layer<N, S>(
77-
backend_metrics: RouteBackendMetrics,
78-
) -> impl svc::Layer<
73+
pub(crate) fn layer<N, S>() -> impl svc::Layer<
7974
N,
8075
Service = svc::ArcNewService<
8176
Self,
@@ -103,7 +98,7 @@ where
10398
svc::stack(inner)
10499
// Distribute requests across route backends, applying policies
105100
// and filters for each of the route-backends.
106-
.push(MatchedBackend::layer(backend_metrics.clone()))
101+
.push(MatchedBackend::layer())
107102
.lift_new_with_target()
108103
.push(NewDistribute::layer())
109104
// The router does not take the backend's availability into

linkerd/app/outbound/src/http/logical/policy/route/backend.rs

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
use crate::RouteRef;
2-
31
use super::{super::Concrete, filters};
42
use linkerd_app_core::{proxy::http, svc, Error, Result};
53
use linkerd_http_route as http_route;
64
use linkerd_proxy_client_policy as policy;
75
use std::{fmt::Debug, hash::Hash, sync::Arc};
86

9-
mod count_reqs;
10-
mod metrics;
11-
12-
pub use self::{count_reqs::RequestCount, metrics::RouteBackendMetrics};
13-
147
#[derive(Debug, PartialEq, Eq, Hash)]
158
pub(crate) struct Backend<T, F> {
16-
pub(crate) route_ref: RouteRef,
179
pub(crate) concrete: Concrete<T>,
1810
pub(crate) filters: Arc<[F]>,
1911
}
@@ -24,17 +16,11 @@ pub(crate) type Http<T> =
2416
pub(crate) type Grpc<T> =
2517
MatchedBackend<T, http_route::grpc::r#match::RouteMatch, policy::grpc::Filter>;
2618

27-
#[derive(Clone, Debug)]
28-
pub struct ExtractMetrics {
29-
metrics: RouteBackendMetrics,
30-
}
31-
3219
// === impl Backend ===
3320

3421
impl<T: Clone, F> Clone for Backend<T, F> {
3522
fn clone(&self) -> Self {
3623
Self {
37-
route_ref: self.route_ref.clone(),
3824
filters: self.filters.clone(),
3925
concrete: self.concrete.clone(),
4026
}
@@ -65,16 +51,13 @@ where
6551
F: Clone + Send + Sync + 'static,
6652
// Assert that filters can be applied.
6753
Self: filters::Apply,
68-
ExtractMetrics: svc::ExtractParam<RequestCount, Self>,
6954
{
7055
/// Builds a stack that applies per-route-backend policy filters over an
7156
/// inner [`Concrete`] stack.
7257
///
7358
/// This [`MatchedBackend`] must implement [`filters::Apply`] to apply these
7459
/// filters.
75-
pub(crate) fn layer<N, S>(
76-
metrics: RouteBackendMetrics,
77-
) -> impl svc::Layer<
60+
pub(crate) fn layer<N, S>() -> impl svc::Layer<
7861
N,
7962
Service = svc::ArcNewService<
8063
Self,
@@ -107,9 +90,6 @@ where
10790
}| concrete,
10891
)
10992
.push(filters::NewApplyFilters::<Self, _, _>::layer())
110-
.push(count_reqs::NewCountRequests::layer_via(ExtractMetrics {
111-
metrics: metrics.clone(),
112-
}))
11393
.push(svc::ArcNewService::layer())
11494
.into_inner()
11595
})
@@ -129,23 +109,3 @@ impl<T> filters::Apply for Grpc<T> {
129109
filters::apply_grpc(&self.r#match, &self.params.filters, req)
130110
}
131111
}
132-
133-
impl<T> svc::ExtractParam<RequestCount, Http<T>> for ExtractMetrics {
134-
fn extract_param(&self, params: &Http<T>) -> RequestCount {
135-
RequestCount(self.metrics.http_requests_total(
136-
params.params.concrete.parent_ref.clone(),
137-
params.params.route_ref.clone(),
138-
params.params.concrete.backend_ref.clone(),
139-
))
140-
}
141-
}
142-
143-
impl<T> svc::ExtractParam<RequestCount, Grpc<T>> for ExtractMetrics {
144-
fn extract_param(&self, params: &Grpc<T>) -> RequestCount {
145-
RequestCount(self.metrics.grpc_requests_total(
146-
params.params.concrete.parent_ref.clone(),
147-
params.params.route_ref.clone(),
148-
params.params.concrete.backend_ref.clone(),
149-
))
150-
}
151-
}

linkerd/app/outbound/src/http/logical/policy/route/backend/count_reqs.rs

Lines changed: 0 additions & 73 deletions
This file was deleted.

linkerd/app/outbound/src/http/logical/policy/route/backend/metrics.rs

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)