Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] body request and body response in tracer-zipkin #6736

Closed
jonaselias198 opened this issue May 8, 2024 · 0 comments
Closed

[QUESTION] body request and body response in tracer-zipkin #6736

jonaselias198 opened this issue May 8, 2024 · 0 comments
Labels
question Further information is requested

Comments

@jonaselias198
Copy link

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants