Skip to content

Commit ccb0529

Browse files
Merge pull request #47 from tidal/integration-test-patch
Update Mock SpanExporter to accept serviceName
2 parents 7e52fd7 + 2e1d5ad commit ccb0529

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tests/Integration/Symfony/OtelSdkBundle/Mock/SpanExporter.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@
99
class SpanExporter implements SpanExporterInterface
1010
{
1111
private ?string $logFile;
12+
private ?string $serviceName;
1213

13-
public function __construct(?string $logFile = null)
14+
public function __construct(?string $serviceName = null, ?string $logFile = null)
1415
{
16+
$this->serviceName = $serviceName;
1517
$this->logFile = $logFile;
1618
}
1719

1820
public static function fromConnectionString(string $endpointUrl, string $name, string $args): self
1921
{
20-
return new self();
22+
return new self($name, $args);
2123
}
2224

2325
public function export(iterable $spans): int
@@ -35,6 +37,11 @@ public function forceFlush(): bool
3537
return true;
3638
}
3739

40+
public function getServiceName(): ?string
41+
{
42+
return $this->serviceName;
43+
}
44+
3845
public function getLogFile(): ?string
3946
{
4047
return $this->logFile;

0 commit comments

Comments
 (0)