Skip to content

Commit 923b2fc

Browse files
committed
cluster stat name: lowercase Kind
Signed-off-by: Guy Daich <guy.daich@sap.com>
1 parent 34f641a commit 923b2fc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/gatewayapi/route.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2083,7 +2083,7 @@ func getStatPattern(routeContext RouteContext, parentRef *RouteParentContext) st
20832083
func buildStatName(pattern string, route RouteContext, ruleName *gwapiv1.SectionName, idx int, refs []string) string {
20842084
statName := strings.ReplaceAll(pattern, egv1a1.StatFormatterRouteName, route.GetName())
20852085
statName = strings.ReplaceAll(statName, egv1a1.StatFormatterRouteNamespace, route.GetNamespace())
2086-
statName = strings.ReplaceAll(statName, egv1a1.StatFormatterRouteKind, route.GetObjectKind().GroupVersionKind().Kind)
2086+
statName = strings.ReplaceAll(statName, egv1a1.StatFormatterRouteKind, strings.ToLower(route.GetObjectKind().GroupVersionKind().Kind))
20872087
if ruleName == nil {
20882088
statName = strings.ReplaceAll(statName, egv1a1.StatFormatterRouteRuleName, "-")
20892089
} else {

internal/gatewayapi/testdata/envoyproxy-with-statname.out.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ xdsIR:
230230
name: httproute/default/httproute-1/rule/0/backend/1
231231
protocol: HTTP
232232
weight: 1
233-
statName: HTTPRoute/default/httproute-1/foo/0/default/service-3|default/service-4
233+
statName: httproute/default/httproute-1/foo/0/default/service-3|default/service-4
234234
hostname: gateway.envoyproxy.io
235235
isHTTP2: false
236236
metadata:
@@ -262,7 +262,7 @@ xdsIR:
262262
name: httproute/default/httproute-1/rule/1/backend/0
263263
protocol: HTTP
264264
weight: 1
265-
statName: HTTPRoute/default/httproute-1/fallback/1/default/service-1
265+
statName: httproute/default/httproute-1/fallback/1/default/service-1
266266
hostname: gateway.envoyproxy.io
267267
isHTTP2: false
268268
metadata:
@@ -326,7 +326,7 @@ xdsIR:
326326
name: grpcroute/default/grpcroute-1/rule/0/backend/3
327327
protocol: GRPC
328328
weight: 1
329-
statName: GRPCRoute/default/grpcroute-1/-/0/default/service-1|default/service-2|default/service-3|default/service-4
329+
statName: grpcroute/default/grpcroute-1/-/0/default/service-1|default/service-2|default/service-3|default/service-4
330330
hostname: '*'
331331
isHTTP2: true
332332
metadata:

0 commit comments

Comments
 (0)