Routing between services based on path

At this moment we have our own homegrown service based based on HAProxy. Our current setup makes it so that the services do not know which services they need to call for a specific API path (we have a composite API domain). Our sidecar knows which API path needs to go where and will route the request to the corresponding service.

As Im looking into Istio the way we should do that is to create a global virtual service with all our paths in it and redirect all internal traffic to that specific virtual service. If we choose to go down that route, do we still have the metrics of latency between the specific services or do we lose them because we route everything via the global virtual service?
Or is there an other solution for our requirements?

Thanks in advance!

Assuming you have a proxy instance running next to each service you will get the metrics.

Consider the following snippet from the virtual service:

http:
- match:
  - uri:
     prefix: "/service1/"
  route:
  - destination:
     host: service1.default.svc.cluster.local
- match:
  - uri:
     prefix: "/service2/"
  route:
  - destination:
     host: service2.default.svc.cluster.local

If service1 and service2 instances have a proxy running next to them you should be able to get the metrics.

Thanks for your answer @peterj !

Based on your example, how can service1 reach the VirtualService to let the traffic route to service2? AFAIK you cannot reach a VirtualService by a DNS record.