Skip to content

Commit

Permalink
Merge pull request #276 from adri/adri/fix-insert-distributed-headers
Browse files Browse the repository at this point in the history
Distributed traces > Pass $headers by reference
  • Loading branch information
jderusse authored Mar 25, 2022
2 parents 106f948 + 562d408 commit aa29fd8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion NewRelic/AdaptiveInteractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function isSampled(): bool
return $this->interactor->isSampled();
}

public function insertDistributedTracingHeaders(array $headers): void
public function insertDistributedTracingHeaders(array &$headers): void
{
if (!method_exists($this->interactor, 'insertDistributedTracingHeaders')) {
throw new \BadMethodCallException('The decorated interaction does not implement this method');
Expand Down
2 changes: 1 addition & 1 deletion NewRelic/BlackholeInteractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function isSampled(): bool
return true;
}

public function insertDistributedTracingHeaders(array $headers): void
public function insertDistributedTracingHeaders(array &$headers): void
{
}

Expand Down
2 changes: 1 addition & 1 deletion NewRelic/LoggingInteractorDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function isSampled(): bool
return $isSampled;
}

public function insertDistributedTracingHeaders(array $headers): void
public function insertDistributedTracingHeaders(array &$headers): void
{
$this->logger->debug('Setting New Relic distributed tracing headers', ['headers' => $headers]);

Expand Down
2 changes: 1 addition & 1 deletion NewRelic/NewRelicInteractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function isSampled(): bool
return newrelic_is_sampled();
}

public function insertDistributedTracingHeaders(array $headers): void
public function insertDistributedTracingHeaders(array &$headers): void
{
if (!function_exists('newrelic_insert_distributed_trace_headers')) {
throw new \BadMethodCallException('You need the "newrelic" extension version 9.8 or higher to use this method');
Expand Down
2 changes: 1 addition & 1 deletion NewRelic/NewRelicInteractorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @method array getTraceMetadata()
* @method array getLinkingMetadata()
* @method bool isSampled()
* @method void insertDistributedTracingHeaders(array $headers)
* @method void insertDistributedTracingHeaders(array &$headers)
* @method void acceptDistributedTraceHeaders(array $headers, string $transportType = 'HTTP')
*/
interface NewRelicInteractorInterface
Expand Down

0 comments on commit aa29fd8

Please sign in to comment.