Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Make NullTracer pass spanOptions to constructor (#202)
Browse files Browse the repository at this point in the history
Pass spanOptions through to the newly created Span instead of always using
default values.

The Span constructor does additional work if there's no options passed in.
Instrumented code that uses the NullTracer (as a result of not sampling or
other reasons) can avoid this work by passing the options that are already
set.

This change also makes the use of the stackTrace option more consistent. It
preserves the passed-in stackTrace, which may be pre-filtered or an empty array.
The current behavior leads to the unexpected outcome that the non-sampled
requests were taking deubg_backtraces when the instrumented route was passing
in its own value.
  • Loading branch information
Stantheman authored and chingor13 committed Sep 19, 2018
1 parent 39585f2 commit 90ec78f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Trace/Tracer/NullTracer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function inSpan(array $spanOptions, callable $callable, array $arguments
*/
public function startSpan(array $spanOptions)
{
return new Span();
return new Span($spanOptions);
}

/**
Expand Down

0 comments on commit 90ec78f

Please sign in to comment.