Read path parameters from requesturi to enable endpoint level aggregated metrics

Hi, I'm using AWS-ElasticSearch+kibana to save apigee logs and create metrics on the logged data. While creating the api's endpoint level metrics I'm seeing problem with requests involving the path parameters(I took care of query parameters). Example - Though the endpoints- shops/shop1/orders/order123 and shops/shop2/orders/order232 uses the same endpoint, there is noway i can create aggregated metrics at endpoint level unless I can read path parameters and make the path for two endpoints in the above example as something like this shops/COMMOMSHOP/orders/COMMONORDER in my log (I'm not worried about missing the real value of the path parameter in log as I can save the real data in different variable instead I would like to get the traffic/other metrics on the specific endpoint). This logic is part of the sharedflow that is common to all my proxies. So, it would be great if there are no changes at the proxy level instead on the sharedflow. Below if the flow I have -

ProxyA --> Logging Shared Flow --> AWS Elasticsearch --> Kibana

Any thoughts on this is appreciated.

0 2 252
2 REPLIES 2

Not applicable

you can use statistic collector policy to add value and do aggregation over that. You can add that in shared flow.

You can try aggregating with filter matching your path, only for sum of traffic.

But my sharedflow that is common to ~400 proxies and each proxy will have one or more than one endpoints with path parameters. I would be really tough to maintain all the endpoints possible to replace the path params with a static string to aggregate at the final spot. Also, I have to add an entry everytime a new proxy/endpoint with path param is onboarded.I agree we can make a change at the proxy level to setup a flow variable with the endpoints with path params and read it in the shared flow but I will have to make change in all the proxies which I want to avoid.