-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add metrics ability to the lua bouncer #80
base: main
Are you sure you want to change the base?
Conversation
* add metrics
* in some case allow sending 0 value processed request
* get rid of METRICS_PERIOD configuration item. It's now 300.
…r into tests/stream
ngx.log(ngx.INFO, "no labels") | ||
end | ||
|
||
key = key .. "/" .. utils.table_to_string(labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to show in a comment what a key look like please?
for _, key in ipairs(keys) do | ||
if utils.starts_with(key, "decision_cache/") then | ||
local decision_string = stream.cache:get(key) | ||
local t = utils.split_on_delimiter(decision_string,"/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you show in a comment what are different part of the decision, else it is a mess to understand the rest of the code
ngx.log(ngx.DEBUG, "timer started: " .. tostring(runtime.timer_started) .. " in worker " .. tostring(ngx.worker.id())) | ||
if runtime.timer_started == false and runtime.conf["MODE"] == "stream" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did the check on "stream" mode has been removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has not been removed you will find it in:
if runtime.conf["MODE"] == "stream" then
ngx.log(ngx.INFO, "stream mode")
SetupStream()
end
The metrics code doesn't depend on mode, so that's why it is not ran under a check with stream mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful with all ngx.INFO messages.
One question, what happens if the remote LAPI doesn't support metrics ?
For now, further tests are needed, especially for captcha
Updates: