Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 408 Bytes

message-bodies.md

File metadata and controls

17 lines (13 loc) · 408 Bytes

Adding request and response bodies as span attributes when tracing HTTP requests

$client = new \Instrumentation\Http\TracingHttpClient();

$client->request('GET', 'https://github.com', [
    'extra' => [
        'span_attributes' => ['request.body', 'response.body'],
    ],
]);

Or enable it globally setting and env var:

OTEL_PHP_HTTP_SPAN_ATTRIBUTES=request.body,response.body