Closed jpeach closed 2 years ago
triage: We should do this for MVP #3300
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
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