Capture nginx webserver error messages in context of kong api tx #13498
Replies: 2 comments 5 replies
-
Yes, because these error message is hard coded into nginx internal structure, and later nginx just directly output them into error.log.
I think if we dont modify nginx/openresty source code , it's hard to implement it gracefully.
From the source code, I think it's tricky way to implement the error code detection via raw error.log message and status_code. |
Beta Was this translation helpful? Give feedback.
-
Hoping maybe this can get a jira board ticket for just exposing it as a variable in the tx context possibly and think more on how kong wants to use it. I know how I would use it anyways xD. |
Beta Was this translation helpful? Give feedback.
-
My understanding is there is no way today to capture the "timed out reading response header from upstream" that nginx webservers throw out to error log/standard out via the ngx.* variable or the kong.* vars.
I would like to always correlate nginx webserver upstream connection and read write timeout errors especially so if its not a native part of nginx lua or Kong would like a way to grab:
ngx.webserver_errors[0] ... ngx.webserver_errors[n]
Or via kong var:
kong.webserver_errors[0] ... kong.webserver_errors[n]
Typically there is only 1 nginx webserver error message on a tx I think from reverse proxy perspective so might not need a list.
There are ways to kinda do it today I do like so:
https://github.com/Optum/kong-error-log/blob/master/src/handler.lua but this is hacky and at high tx vols confuses different errors with other txs.
Beta Was this translation helpful? Give feedback.
All reactions