Skip to content

Commit 2fa9424

Browse files
committed
add span description
1 parent 786118a commit 2fa9424

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Tracing/HttpClient/AbstractTraceableHttpClient.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function request(string $method, string $url, array $options = []): Respo
5252

5353
$context = new SpanContext();
5454
$context->setOp('http.client');
55+
$context->setDescription('HTTP ' . $method);
5556
$context->setTags([
5657
'http.method' => $method,
5758
'http.url' => $url,

tests/Tracing/HttpClient/TraceableHttpClientTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public function testRequest(): void
7777
$this->assertCount(2, $spans);
7878
$this->assertNull($spans[1]->getEndTimestamp());
7979
$this->assertSame('http.client', $spans[1]->getOp());
80+
$this->assertSame('HTTP POST', $spans[1]->getDescription());
8081
$this->assertSame([
8182
'http.method' => 'POST',
8283
'http.url' => 'http://www.example.org/test-page',
@@ -88,6 +89,7 @@ public function testRequest(): void
8889
$this->assertCount(2, $spans);
8990
$this->assertNotNull($spans[1]->getEndTimestamp());
9091
$this->assertSame('http.client', $spans[1]->getOp());
92+
$this->assertSame('HTTP POST', $spans[1]->getDescription());
9193
$this->assertSame([
9294
'http.method' => 'POST',
9395
'http.url' => 'http://www.example.org/test-page',

0 commit comments

Comments
 (0)