Add monitor lua module

This commit is contained in:
Francisco Mejia 2018-06-13 22:54:09 -04:00
parent 764bcd5a1b
commit 966e9f5e25
6 changed files with 266 additions and 0 deletions

View file

@ -69,6 +69,13 @@ http {
balancer = res
end
{{ end }}
ok, res = pcall(require, "monitor")
if not ok then
error("require failed: " .. tostring(res))
else
monitor = res
end
}
{{ if $all.DynamicConfigurationEnabled }}
@ -903,6 +910,11 @@ stream {
{{ if $all.DynamicConfigurationEnabled}}
balancer.log()
{{ end }}
ok, res = pcall(monitor.call)
if not ok then
ngx.log(ngx.ERR, "request_id failed: " .. tostring(res))
end
}
{{ end }}