Taking an example metric :-
sum(istio_requests_total{reporter='destination',app="myApp"}) by (app, request_method, request_url_path, response_code)
This gives many values for each URI like :-
{app="myApp", request_method="GET", request_url_path="/orders/123-456-6543/info", response_code="200"} 1
{app="myApp", request_method="GET", request_url_path="/orders/666-777-8888/info", response_code="200"} 1
{app="myApp", request_method="GET", request_url_path="/orders/111-222-3338/info", response_code="200"} 1
{app="myApp", request_method="GET", request_url_path="/ordersDetails/123-456-6543/details", response_code="200"} 1
{app="myApp", request_method="GET", request_url_path="/ordersDetails/666-777-8888/details", response_code="200"} 1
{app="myApp", request_method="GET", request_url_path="/ordersDetails/111-222-3338/details", response_code="200"} 1
However, they are technically part of two API endpoints:-
/orders/{order-id}/info
/ordersDetails/{order-id}/details
how can I specify this kind of URI patterns in prometheus Or istio Config, so that the metrics end up with something like this:
{app="myApp", request_method="GET", request_url_path="/orders/{id}/info", response_code="200"} 3
{app="myApp", request_method="GET", request_url_path="/ordersDetails/{id}/details", response_code="200"} 3