Customize a new duration histogram metric based on request duration and upstream service duration

I wonder how can I create a new Prometheus metric that is deduced by the formula (request duration - upstream service duration) by using Istio telemetry API.