Skip to content

Commit 931a280

Browse files
committed
fix zipkin tag value type
1 parent 35d20d5 commit 931a280

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/Tracing/Exporter/ZipkinExporter.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ private function convertAttributes(array $attributes): array
5656
$tags = [];
5757

5858
foreach ($attributes as $k => $v) {
59-
if (is_bool($v)) {
60-
$v = (string) $v;
61-
}
62-
$tags[$k] = $v;
59+
$tags[$k] = (string) $v;
6360
}
6461

6562
return $tags;

tests/Tracing/TransportTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function testZipkin()
1919
$span = $tracer->getActiveSpan();
2020
$event = $span->addEvent('hello world');
2121
$span->setAttribute('nick', 'nekufa');
22+
$span->setAttribute('counter', 27);
2223
$span->end();
2324

2425
$client = new MockHttpClient([
@@ -38,8 +39,9 @@ function ($method, $url, $options) use ($span, $event) {
3839
$this->assertSame($row->duration, (int) $duration);
3940

4041
$this->assertEquals($row->localEndpoint, (object) [ 'serviceName' => 'tester' ]);
41-
$this->assertCount(1, get_object_vars($row->tags));
42+
$this->assertCount(2, get_object_vars($row->tags));
4243
$this->assertSame($row->tags->nick, 'nekufa');
44+
$this->assertSame($row->tags->counter, '27');
4345
$this->assertCount(1, $row->annotations);
4446

4547
[ $annotation ] = $row->annotations;

0 commit comments

Comments
 (0)