[alibaba/tengine]请教个问题:有没有模块能统计到 upstream 级别?

2024-06-26 922 views
9

请教个问题:有没有模块能统计到 upstream 级别? 比如我想得到 $domain:$port:$location:$upstream 级别的 2xx,4xx,5xx 之类的统计,有模块能做到这个级别的统计吗? 更进一步能不能统计到 $domain:$port:$location:$upstream:$Ip:port 级别? 谢谢。

回答

7

reqstat就可以!刚做完在测试

6

@aesirteam 可以给个简单的示例吗,谢谢。 我看介绍只能配置到 $host:$server_port,也就是 domain 级别。

2

@aesirteam 明白了,可以通过 $host:$uri:$proxy_host:$server_addr:$server_port 这种配置进行统计是吧。不过我通过 rewrite_by_lua 阶段做了很多其它事情,所以一些变量不符合预期了,看来我得想其它办法了,无法直接搞定;

6

req_status_zone reqstat_zone "$proxy_host,$upstream_addr" 2m; req_status_lazy on; req_status reqstat_zone;