show logged in user as root span name

This commit is contained in:
Andrew Dolgov 2023-10-21 10:19:53 +03:00
parent 93bb473bce
commit 492c4eecfb
No known key found for this signature in database
GPG Key ID: 1A56B4FA25D4AF2A
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ class Tracer {
$context = TraceContextPropagator::getInstance()->extract(getallheaders()); $context = TraceContextPropagator::getInstance()->extract(getallheaders());
$span = $this->tracer->spanBuilder('root') $span = $this->tracer->spanBuilder($_SESSION['name'] ?? 'not-logged-in')
->setParent($context) ->setParent($context)
->setSpanKind(SpanKind::KIND_SERVER) ->setSpanKind(SpanKind::KIND_SERVER)
->setAttribute('php.request', json_encode($_REQUEST)) ->setAttribute('php.request', json_encode($_REQUEST))