Prometheus path contains path variables

Hi, I’d like to rank paths by most called, slowest, highest error rate, etc. However I realized that the path label contains path variables, so it sees the same path as multiple when using different path variables.

For example, it will see these as 2 distinct paths:

v1/users/1
v1/users/2

I was wondering if there’s a way to capture the matched allowed_url from the policy, that way I can get the path in regex format like:
v1/users/.*

Thanks

I am not sure I quite understand the ask but it looks pretty similar to

Let us know if this helps.

Thanks, that’s exactly what I was looking for!