Tolerance\Tracer\SpanStack\SpanStack::current PHP Method

current() public method

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

Usage Example

Example #1
0
 /**
  * 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