[PHP] Distributed tracing: nginx


I am stuck on the topic of distributed tracing.

We would like to link the nginx access logs with the PHP Transactions (APM). The nginx is our loadbalancer which passes the requests to the apache/php upstreams.

From my point of view it is necessary to give the nginx logs a trace.id and then link the APM transactions to this trace.id. At the same time the nginx has to pass the trace.id via http header to the PHP application.

I could not find any documentation for this.
How can I enrich the nginx logs with a trace.id?
How can I link the PHP Transactions with this trace.id?

Thanks for your help!