unit
unit copied to clipboard
Variables: add request_id
Hi team,
In our nginx setup, we are using request_id
for tracing purpose . This is an embedded variable as documented here https://nginx.org/en/docs/http/ngx_http_core_module.html#variables. The setting is done thanks to fastcgi
setting as below
# nginx.conf
fastcgi_param HTTP_X_REQUEST_ID $request_id;
My question is how we can get a similar thing with unit
configuration?
Thanks for your reading and support.
Hello!
How do you use this variable end-to-end? Presumably you also log this variable in the access log for correlation purposes? Or does it end up somewhere else?
Hello!
How do you use this variable end-to-end? Presumably you also log this variable in the access log for correlation purposes? Or does it end up somewhere else?
We are using Symfony + Newrelic integration. Though I don't really get all details how it's exactly working, I think our developers are using HTTP_X_REQUEST_ID
header value (which is $request_id
) as Newrelic tracing ID.
Fyi, the Symfony project seems not to get a final resolution (discussed in https://github.com/symfony/symfony/issues/11573 ). There are some patches, but I think it's great if unit
can support $request_id
out of the box.
Thanks for making this clear. It will be generally possible to create a request_id
and add it to the application context so it will be accessible from inside your PHP application.
As a request ID should be a secure random the implementation need some architectural design work first. I will mark this as enhancement and look how it will fit in the roadmap / next releases.