diff --git a/src/Trace/Integrations/Guzzle/EventSubscriber.php b/src/Trace/Integrations/Guzzle/EventSubscriber.php index b85ad9681..1e701abbe 100644 --- a/src/Trace/Integrations/Guzzle/EventSubscriber.php +++ b/src/Trace/Integrations/Guzzle/EventSubscriber.php @@ -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; @@ -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([