Add monitor lua module
This commit is contained in:
parent
764bcd5a1b
commit
966e9f5e25
6 changed files with 266 additions and 0 deletions
|
|
@ -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 }}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue