openresty-1.17.8.2-1.el7 貌似和nginx-lua-prometheus 不兼容了,同样的操作报错如下
2020/07/24 14:25:24 [error] 8042#8042: *601675 failed to run log_by_lua*: log_by_lua(nginx.conf:37):2: attempt to index global 'metric_requests' (a nil value)
stack traceback:
log_by_lua(nginx.conf:37):2: in main chunk while logging request,

也取不到监控指标了
curl http://127.0.0.1:9145/metrics
<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>openresty</center>
</body>
</html>

    7 days later

    看起来是 nginx-lua-prometheus 有兼容性问题

      早几个版本,openresty 改了每请求的全局变量行为

        Write a Reply...