References between Traces

For distributed tracing, related traces and traces following from each other there are APIs to propagate the tracing headers from the current request to other requests.

Propagate Headers for Distributed Tracing and Profiling

To propgate the necessary HTTP headers to allow distributed tracing between requests you can call the method Tideways\Profiler::generateDistributedTracingHeaders:

$tracingHeaders = method_exists('Tideways\Profiler', 'generateDistributedTracingHeaders')
    ? \Tideways\Profiler::generateDistributedTracingHeaders() : [];

$headerString '';
foreach ($tracingHeaders as $headerName => $headerValue) {
    $headerString .= sprintf("%s: %s\r\n", $headerName, $headerValue);
}
Still need help? Email [email protected]