allow the change altStatName for backend
Currently, we build cluster name with the rule like httproute/default/backend/rule/0, this's fine for mostly of the cases.
The problem is that when we want to know what the exract hostname/backend name in metrics or tracing spane name.
Maybe we should provide a way to customize it directly beside ClusterStatName in EnvoyProxy.
xref: https://envoyproxy.slack.com/archives/C03E6NHLESV/p1762944475362659
cc @envoyproxy/gateway-maintainers
sure, can we added once https://github.com/envoyproxy/gateway/pull/6310 lands
@arkodg as #6310 landed, we can add another knob for cluster stats name?
Sure +1
Rethink about this, for a httproute like following:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: backend
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: eg
hostnames:
- mtls.example.com
rules:
- name: force-trace-rule
matches:
- path:
type: PathPrefix
value: /v1
backendRefs:
- group: gateway.envoyproxy.io
kind: Backend
name: backend
- name: normal-sampling-rule
matches:
- path:
type: PathPrefix
value: /v2
backendRefs:
- group: gateway.envoyproxy.io
kind: Backend
name: backend-v2
the goal is make sure that we know the hostname from the span or stat. As BackendTrafficPolicy is targeting to xRoute, seems not working for this case.
do we need a similar things like BackendTrafficPolicy, but target ref to Service/ServiceImport/Backend like BackednTLSPolicy.
you could use %BACKEND_REFS or %HOSTNAME (listener/route)
BACKEND_REFS may help if we the name is well-formed, but it would be better to have without namespace.
%HOSTNAME may not work if URLRewrite happened.
you can then target a BTP to a specific rule and only specific statName for it, and merge it back with parent BTP
you can then target a BTP to a specific rule and only specific statName for it, and merge it back with parent BTP
so we need N * BTP, and N is the number of the rule, which is a little crazy some time.
also it won't work when there're multiple backend in one rule.
@arkodg what about introuduce a new command named %BACKEND_HOSTNAME%
- For Service/ServiceImport, it will result
svc-name.svc-ns.svc.cluster.local - For Backend, it will use the hostname if there's only one fqdn otherwise fallback to
name.namespace.
wdyt @envoyproxy/gateway-maintainers
Community Meeting Notes:
- Can this information be provided using trace tags rather than the requested field
- Does the user want to see this replace the "ingress" label or the router "backend" label
Generally, +1 to BTP override of EP trace settings.
Community Meeting Notes:
- Can this information be provided using trace tags rather than the requested field
- Does the user want to see this replace the "ingress" label or the router "backend" label
Generally, +1 to BTP override of EP trace settings.
Trace will be fixed with this new API.
The case is that we need to link the metrics with trace and accesslog, that's why we need to override the altStatName on cluster.