kumahq / kuma

🐻 The multi-zone service mesh for containers, Kubernetes and VMs. Built with Envoy. CNCF Sandbox Project.
https://kuma.io/install
Apache License 2.0
3.6k stars 332 forks source link

Re-evaluate virtualhost names for Gateway #3320

Closed jpeach closed 2 years ago

jpeach commented 2 years ago

What happened?

The Gateway resource has a hostname that maps directly to the Envoy VirtualHost domains field. However, VirtualHost has a "name" field that is used for statistics.

We should figure out a reasonable mapping from the Gateway host to the name that is used in metric, because that is ABI for user deployments and monitoring.

https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-field-config-route-v3-virtualhost-name

jpeach commented 2 years ago

triage: We should do this for MVP #3300

jpeach commented 2 years ago

Looking into this, the name is effectively treated as a domain name, and split into a label series.

Here's what we get with the current code (using a xDS style resource name):

envoy_vhost_example_com_vcluster_other_upstream_rq_retry{envoy_virtual_host="edge-gateway:HTTP:8080:foo"} 0

If we use the domain name(s) are configuring as the stats name, the result is much more pleasing:

# TYPE envoy_vhost_example_com_vcluster_other_upstream_rq_retry counter
envoy_vhost_example_com_vcluster_other_upstream_rq_retry{envoy_virtual_host="*"} 0
envoy_vhost_example_com_vcluster_other_upstream_rq_retry{envoy_virtual_host="baz"} 0
envoy_vhost_example_com_vcluster_other_upstream_rq_retry{envoy_virtual_host="foo"} 0