Namespace/Service Namespace "unknown" in Standard Metrics for Virtual Service to External Endpoint

Our team is working on using the standard istio metrics for monitoring requests to our services. One use case that we have is to create a service entry and destination rule for a set of external clusters, and a corresponding virtual service when routing to those clusters, i.e:

ServiceEntry: example.com

DestinationRule: example.com (with mTLS config)

VirtualService: for somedomain.com http rewrite to example.com (the external cluster) with host header override.

One thing that we noticed is that in the istio standard metrics, the following:

  • destination_service_namespace
  • namespace
  • destination_workload_namespace

are all set to “unknown”. Is there any way we can override these to be the namespace where the virtual service resides? For context, we have tons of these virtual services, so editing them all wouldn’t be preferable, but could be done if that’s the only way.

Here is a link to an example to reproduce: