Example #1
0
 function it_adds_the_span_in_the_stack_during_the_execution(ConsumerInterface $decoratedConsumer, SpanStack $spanStack)
 {
     $message = new AMQPMessage('');
     $spanStack->push(Argument::type(Span::class))->shouldBeCalled();
     $decoratedConsumer->execute($message)->shouldBeCalled();
     $spanStack->pop()->shouldBeCalled();
     $this->execute($message);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function execute(AMQPMessage $msg)
 {
     $span = $this->amqpSpanFactory->fromReceivedMessage($msg);
     $this->tracer->trace([$span]);
     $this->spanStack->push($span);
     $result = $this->decoratedConsumer->execute($msg);
     $this->tracer->trace([$this->amqpSpanFactory->fromConsumedMessage($msg)]);
     $this->spanStack->pop();
     return $result;
 }