Skip to content

Commit b4c1854

Browse files
committed
Rename alwaysEmitSpans to alwaysReportSpans
1 parent dabaf31 commit b4c1854

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/Zipkin/DefaultTracing.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343
bool $isNoop,
4444
Propagation $propagation,
4545
bool $supportsJoin,
46-
bool $alwaysEmitSpans = false
46+
bool $alwaysReportSpans = false
4747
) {
4848
$this->tracer = new Tracer(
4949
$localEndpoint,
@@ -53,7 +53,7 @@ public function __construct(
5353
$currentTraceContext,
5454
$isNoop,
5555
$supportsJoin,
56-
$alwaysEmitSpans
56+
$alwaysReportSpans
5757
);
5858

5959
$this->propagation = $propagation;

src/Zipkin/Tracer.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ final class Tracer
5151
/**
5252
* @var bool
5353
*/
54-
private $alwaysEmitSpans;
54+
private $alwaysReportSpans;
5555

5656
/**
5757
* @param Endpoint $localEndpoint
@@ -60,7 +60,7 @@ final class Tracer
6060
* @param bool $usesTraceId128bits
6161
* @param CurrentTraceContext $currentTraceContext
6262
* @param bool $isNoop
63-
* @param bool $alwaysEmitSpans
63+
* @param bool $alwaysReportSpans
6464
*/
6565
public function __construct(
6666
Endpoint $localEndpoint,
@@ -70,15 +70,15 @@ public function __construct(
7070
CurrentTraceContext $currentTraceContext,
7171
bool $isNoop,
7272
bool $supportsJoin = true,
73-
bool $alwaysEmitSpans = false
73+
bool $alwaysReportSpans = false
7474
) {
7575
$this->recorder = new Recorder($localEndpoint, $reporter, $isNoop);
7676
$this->sampler = $sampler;
7777
$this->usesTraceId128bits = $usesTraceId128bits;
7878
$this->currentTraceContext = $currentTraceContext;
7979
$this->isNoop = $isNoop;
8080
$this->supportsJoin = $supportsJoin;
81-
$this->alwaysEmitSpans = $alwaysEmitSpans;
81+
$this->alwaysReportSpans = $alwaysReportSpans;
8282
}
8383

8484
/**
@@ -364,7 +364,7 @@ private function ensureSampled(TraceContext $context): Span
364364
*/
365365
private function toSpan(TraceContext $context): Span
366366
{
367-
if (!$this->isNoop && ($context->isSampled() || $this->alwaysEmitSpans)) {
367+
if (!$this->isNoop && ($context->isSampled() || $this->alwaysReportSpans)) {
368368
return new RealSpan($context, $this->recorder);
369369
}
370370

src/Zipkin/TracingBuilder.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class TracingBuilder
6161
/**
6262
* @var bool
6363
*/
64-
private $alwaysEmitSpans = false;
64+
private $alwaysReportSpans = false;
6565

6666
public static function create(): self
6767
{
@@ -189,12 +189,12 @@ public function supportingJoin(bool $supportsJoin): self
189189
}
190190

191191
/**
192-
* @param bool $alwaysEmitSpans
192+
* @param bool $alwaysReportSpans
193193
* @return $this
194194
*/
195-
public function alwaysEmittingSpans(bool $alwaysEmitSpans): self
195+
public function alwaysReportingSpans(bool $alwaysReportSpans): self
196196
{
197-
$this->alwaysEmitSpans = $alwaysEmitSpans;
197+
$this->alwaysReportSpans = $alwaysReportSpans;
198198
return $this;
199199
}
200200

@@ -225,7 +225,7 @@ public function build(): Tracing
225225
$this->isNoop,
226226
$propagation,
227227
$this->supportsJoin && $propagation->supportsJoin(),
228-
$this->alwaysEmitSpans
228+
$this->alwaysReportSpans
229229
);
230230
}
231231
}

tests/Unit/TracingBuilderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private function randomBool()
8989

9090
public function testAlwaysEmitSpans()
9191
{
92-
// If `alwaysEmittingSpans(true)` is called, we should be emitting the
92+
// If `alwaysReportingSpans(true)` is called, we should be emitting the
9393
// spans even if the trace isn't sampled
9494
$endpoint = Endpoint::createAsEmpty();
9595
$reporter = new InMemory();
@@ -100,7 +100,7 @@ public function testAlwaysEmitSpans()
100100
->havingLocalEndpoint($endpoint)
101101
->havingReporter($reporter)
102102
->havingSampler($sampler)
103-
->alwaysEmittingSpans(true)
103+
->alwaysReportingSpans(true)
104104
->build();
105105
$tracer = $tracing->getTracer();
106106

0 commit comments

Comments
 (0)