$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