Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
Use ArrayHeaders in EventSubscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenad Stojanovikj committed Mar 28, 2019
1 parent 7ba1f2f commit 90f478d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Trace/Integrations/Guzzle/EventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
namespace OpenCensus\Trace\Integrations\Guzzle;

use OpenCensus\Core\Scope;
use OpenCensus\Trace\Propagator\ArrayHeaders;
use OpenCensus\Trace\Span;
use OpenCensus\Trace\Tracer;
use OpenCensus\Trace\Propagator\HttpHeaderPropagator;
Expand Down Expand Up @@ -88,8 +89,9 @@ public function onBefore(BeforeEvent $event)
$request = $event->getRequest();
$context = Tracer::spanContext();
if ($context->enabled()) {
$headers = new ArrayHeaders();
$this->propagator->inject($context, $headers);
$request->setHeaders($headers);
$request->setHeaders($headers->toArray());
}

$span = Tracer::startSpan([
Expand Down

0 comments on commit 90f478d

Please sign in to comment.