From d94d3162045e634e01e414716cf81b9a558d1892 Mon Sep 17 00:00:00 2001 From: John Murret Date: Thu, 2 Nov 2023 19:58:54 -0600 Subject: [PATCH] NET-6319 - L7 routes have statePrefix of upstream. and should have a full path (#19473) --- .../listeners/destination/mixed-multi-destination.golden | 2 +- ...ort-l4-and-l7-multiple-implicit-destinations-tproxy.golden | 4 ++-- ...tiport-l4-and-l7-single-implicit-destination-tproxy.golden | 2 +- ...implicit-destination-with-multiple-workloads-tproxy.golden | 2 +- .../internal/controllers/sidecarproxy/builder/destinations.go | 4 ++-- .../testdata/destination/mixed-multi-destination.golden | 2 +- ...ort-l4-and-l7-multiple-implicit-destinations-tproxy.golden | 4 ++-- ...tiport-l4-and-l7-single-implicit-destination-tproxy.golden | 2 +- ...implicit-destination-with-multiple-workloads-tproxy.golden | 2 +- .../xds/testdata/destination/mixed-multi-destination.golden | 2 +- ...ort-l4-and-l7-multiple-implicit-destinations-tproxy.golden | 4 ++-- ...tiport-l4-and-l7-single-implicit-destination-tproxy.golden | 2 +- ...implicit-destination-with-multiple-workloads-tproxy.golden | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/agent/xdsv2/testdata/listeners/destination/mixed-multi-destination.golden b/agent/xdsv2/testdata/listeners/destination/mixed-multi-destination.golden index 23dd5e4c64..eae168bf8a 100644 --- a/agent/xdsv2/testdata/listeners/destination/mixed-multi-destination.golden +++ b/agent/xdsv2/testdata/listeners/destination/mixed-multi-destination.golden @@ -17,7 +17,7 @@ "name": "envoy.filters.network.http_connection_manager", "typedConfig": { "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager", - "statPrefix": "upstream.", + "statPrefix": "upstream.http.api-1.default.default.dc1", "rds": { "configSource": { "ads": {}, diff --git a/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden b/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden index 9cd146e6ef..b0477d8310 100644 --- a/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden +++ b/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden @@ -47,7 +47,7 @@ "name": "envoy.filters.network.http_connection_manager", "typedConfig": { "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager", - "statPrefix": "upstream.", + "statPrefix": "upstream.http.api-app.default.default.dc1", "rds": { "configSource": { "ads": {}, @@ -140,7 +140,7 @@ "name": "envoy.filters.network.http_connection_manager", "typedConfig": { "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager", - "statPrefix": "upstream.", + "statPrefix": "upstream.http.api-app2.default.default.dc1", "rds": { "configSource": { "ads": {}, diff --git a/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden b/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden index 71dec1b4db..180213b652 100644 --- a/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden +++ b/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden @@ -47,7 +47,7 @@ "name": "envoy.filters.network.http_connection_manager", "typedConfig": { "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager", - "statPrefix": "upstream.", + "statPrefix": "upstream.http.api-app.default.default.dc1", "rds": { "configSource": { "ads": {}, diff --git a/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden b/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden index 71dec1b4db..180213b652 100644 --- a/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden +++ b/agent/xdsv2/testdata/listeners/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden @@ -47,7 +47,7 @@ "name": "envoy.filters.network.http_connection_manager", "typedConfig": { "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager", - "statPrefix": "upstream.", + "statPrefix": "upstream.http.api-app.default.default.dc1", "rds": { "configSource": { "ads": {}, diff --git a/internal/mesh/internal/controllers/sidecarproxy/builder/destinations.go b/internal/mesh/internal/controllers/sidecarproxy/builder/destinations.go index f2c4901c89..c078c3273e 100644 --- a/internal/mesh/internal/controllers/sidecarproxy/builder/destinations.go +++ b/internal/mesh/internal/controllers/sidecarproxy/builder/destinations.go @@ -248,7 +248,7 @@ func (b *Builder) buildDestination( panic(fmt.Sprintf("it should not be possible to have a tcp protocol here: %v", effectiveProtocol)) } - rb := lb.addL7Router(routeName, "", effectiveProtocol) + rb := lb.addL7Router(routeName, statPrefix, effectiveProtocol) if destination.Explicit == nil { rb.addIPAndPortMatch(destination.VirtualIPs, virtualPortNumber) } @@ -372,7 +372,7 @@ func (b *ListenerBuilder) addL4RouterForDirect(clusterName, statPrefix string) * router := &pbproxystate.Router{} if statPrefix == "" { - statPrefix = "upstream." + statPrefix = fmt.Sprintf("upstream.%s", clusterName) } router.Destination = &pbproxystate.Router_L4{ diff --git a/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/mixed-multi-destination.golden b/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/mixed-multi-destination.golden index ca69db7dfc..cbd28e7a70 100644 --- a/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/mixed-multi-destination.golden +++ b/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/mixed-multi-destination.golden @@ -234,7 +234,7 @@ "route": { "name": "default/local/default/api-1:http:1.1.1.1:1234" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-1.default.default.dc1" } } ] diff --git a/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden b/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden index f77f427d19..94e8e1c215 100644 --- a/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden +++ b/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden @@ -257,7 +257,7 @@ "route": { "name": "default/local/default/api-app:http" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-app.default.default.dc1" }, "match": { "destinationPort": 8080, @@ -274,7 +274,7 @@ "route": { "name": "default/local/default/api-app2:http" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-app2.default.default.dc1" }, "match": { "destinationPort": 8080, diff --git a/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden b/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden index e6f75c9078..479a4e7aef 100644 --- a/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden +++ b/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden @@ -152,7 +152,7 @@ "route": { "name": "default/local/default/api-app:http" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-app.default.default.dc1" }, "match": { "destinationPort": 8080, diff --git a/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden b/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden index e6f75c9078..479a4e7aef 100644 --- a/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden +++ b/internal/mesh/internal/controllers/sidecarproxy/builder/testdata/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden @@ -152,7 +152,7 @@ "route": { "name": "default/local/default/api-app:http" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-app.default.default.dc1" }, "match": { "destinationPort": 8080, diff --git a/internal/mesh/internal/controllers/xds/testdata/destination/mixed-multi-destination.golden b/internal/mesh/internal/controllers/xds/testdata/destination/mixed-multi-destination.golden index 2638cf3f80..3acd9869e5 100644 --- a/internal/mesh/internal/controllers/xds/testdata/destination/mixed-multi-destination.golden +++ b/internal/mesh/internal/controllers/xds/testdata/destination/mixed-multi-destination.golden @@ -285,7 +285,7 @@ "route": { "name": "default/local/default/api-1:http:1.1.1.1:1234" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-1.default.default.dc1" } } ] diff --git a/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden b/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden index 0d418fc680..0158f07aa2 100644 --- a/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden +++ b/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-multiple-implicit-destinations-tproxy.golden @@ -330,7 +330,7 @@ "route": { "name": "default/local/default/api-app:http" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-app.default.default.dc1" }, "match": { "destinationPort": 8080, @@ -347,7 +347,7 @@ "route": { "name": "default/local/default/api-app2:http" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-app2.default.default.dc1" }, "match": { "destinationPort": 8080, diff --git a/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden b/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden index c465d0ad84..3c9d62fb4e 100644 --- a/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden +++ b/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-single-implicit-destination-tproxy.golden @@ -192,7 +192,7 @@ "route": { "name": "default/local/default/api-app:http" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-app.default.default.dc1" }, "match": { "destinationPort": 8080, diff --git a/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden b/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden index c465d0ad84..3c9d62fb4e 100644 --- a/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden +++ b/internal/mesh/internal/controllers/xds/testdata/destination/multiport-l4-and-l7-single-implicit-destination-with-multiple-workloads-tproxy.golden @@ -192,7 +192,7 @@ "route": { "name": "default/local/default/api-app:http" }, - "statPrefix": "upstream." + "statPrefix": "upstream.http.api-app.default.default.dc1" }, "match": { "destinationPort": 8080,