You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/19 00:21:27 UTC

[GitHub] [apisix] membphis commented on issue #1574: feature: prometheus plugin `apisix_http_status` metric `route` tag Improve recognition

membphis commented on issue #1574:
URL: https://github.com/apache/apisix/issues/1574#issuecomment-711447339


   you can take a look at this, it can help you:
   
   https://github.com/api7/lua-resty-radixtree#synopsis
   
   ```lua
           -- try to match
           local opts = {
               host = "foo.com",
               method = "GET",
               remote_addr = "127.0.0.1",
               vars = ngx.var,
           }
           ngx.say(rx:match("/aa", opts))
   
           -- try to match and store the cached value
           local opts = {
               host = "foo.com",
               method = "GET",
               remote_addr = "127.0.0.1",
               vars = ngx.var,
               matched = {}
           }
           ngx.say(rx:match("/name/json/foo/bar/gloo", opts))
           ngx.say("name: ", opts.matched.name, " other:", opts.matched.other)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org