You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by Jan Li <ja...@airwallex.com> on 2020/06/05 07:22:40 UTC

How can we aggregate status code count by URIs?

Hi team,

       I'm using Prometheus plugin to monitor status code, but there is an
obstacle when we try to group status code by URI.

       Suppose we have such a route configuration:

       {"uri": "/event/*", vars: [["uri", "~~", "^/event/.*/subscribe"]]}

       And the actual request uri can be /event/12324829832/subscribe or
/event/3489284928/subscribe.

       But in Prometheus, we want to count response code on
^/event/.*/subscribe, is there any good way we can do this?

Re: How can we aggregate status code count by URIs?

Posted by YuanSheng Wang <me...@apache.org>.
Hi:

that is an interesting question. I think we need to way to find the right
`pattern`.

how about this step?

1. the `pattern` in vars which named `uri`
2. matched `uri`, eg: /event/*



On Fri, Jun 5, 2020 at 3:22 PM Jan Li <ja...@airwallex.com> wrote:

> Hi team,
>
>        I'm using Prometheus plugin to monitor status code, but there is an
> obstacle when we try to group status code by URI.
>
>        Suppose we have such a route configuration:
>
>        {"uri": "/event/*", vars: [["uri", "~~", "^/event/.*/subscribe"]]}
>
>        And the actual request uri can be /event/12324829832/subscribe or
> /event/3489284928/subscribe.
>
>        But in Prometheus, we want to count response code on
> ^/event/.*/subscribe, is there any good way we can do this?
>


-- 
*MembPhis*
My github: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix