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

Commit 90ec78f

Browse files
Stanthemanchingor13
authored andcommitted
Make NullTracer pass spanOptions to constructor (#202)
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.
1 parent 39585f2 commit 90ec78f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Trace/Tracer/NullTracer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function inSpan(array $spanOptions, callable $callable, array $arguments
5252
*/
5353
public function startSpan(array $spanOptions)
5454
{
55-
return new Span();
55+
return new Span($spanOptions);
5656
}
5757

5858
/**

0 commit comments

Comments
 (0)