Closed divyak8 closed 2 years ago
You can use Lua standard library to modify the values before you pass them to the library. The details depends on how your urls look like, but very naive example for metric that counts requests per method and url could look like this:
local location = ngx.var.uri:gsub("/subscription/.*/", "/subscription/<ID>/"):gsub("/account/.*/", "/account/<ID>/")
request_count_total:inc(1, {location, ngx.var.request_method})
This would count request to /account/12345/details
with label /account/<ID>/details
.
how can we replace account id's and subscription id's in original URL with {subscription ID} , {account ID}.