Tolerance\Tracer\SpanStack\SpanStack::current PHP Méthode

current() public méthode

Get the current span in the stack.
public current ( ) : Span | null
Résultat Tolerance\Tracer\Span\Span | null
    public function current();

Usage Example

 /**
  * Updates the record with the span identifiers.
  *
  * @param array $record
  *
  * @return array
  */
 public function __invoke(array $record)
 {
     if (null === ($span = $this->spanStack->current())) {
         return $record;
     }
     $record['context']['tags'] = ['span_id' => (string) $span->getIdentifier(), 'trace_id' => (string) $span->getTraceIdentifier()];
     return $record;
 }
All Usage Examples Of Tolerance\Tracer\SpanStack\SpanStack::current