mystamps
mystamps copied to clipboard
Add tracing capabilities
In order to improve logging and simplify debugging, let's pass random number that uniquely identifies every request.
- pass
$request_idin theRequest-IDheader to a backend - include request id to the logs on nginx side
- include request id to the logs on applcation side
Resources:
- https://www.nginx.com/blog/application-tracing-nginx-plus/
- https://gongled.ru/blog/2017/01/05/tracing-requests-in-nginx.html (in Russian)
BTW here is the similar (?) for HAproxy: https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4.2-unique-id-header