[QUESTION] body request and body response in tracer-zipkin
jonaselias198 opened this issue Β· comments
Hi!
I have a question about spans tracer config, is there any specific reason why the body request and body response is not made available as an option in span Zipkin tracer?
'tags' => [
'request' => [
'path' => 'request.path',
'uri' => 'request.uri',
'method' => 'request.method',
'header' => 'request.header',
'data' => 'request.data', // not available π’
'body' => 'request.body', // not available π’
],
'coroutine' => [
'id' => 'coroutine.id',
],
'response' => [
'status_code' => 'response.status_code',
'body' => 'response.body', // not available π’
],
],
Available options in hyperf/tracer:
protected function buildSpan(ServerRequestInterface $request): Span
{
$uri = $request->getUri();
$span = $this->startSpan(sprintf('request: %s %s', $request->getMethod(), $uri->getPath()));
$span->setTag($this->spanTagManager->get('coroutine', 'id'), (string) Coroutine::id());
$span->setTag($this->spanTagManager->get('request', 'path'), (string) $uri->getPath());
$span->setTag($this->spanTagManager->get('request', 'method'), $request->getMethod());
$span->setTag($this->spanTagManager->get('request', 'uri'), (string) $uri);
foreach ($request->getHeaders() as $key => $value) {
$span->setTag($this->spanTagManager->get('request', 'header') . '.' . $key, implode(', ', $value));
}
return $span;
}