Skip to content

Commit 402dc53

Browse files
committed
more messaging switch + fixed tests
1 parent 223700d commit 402dc53

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Instrumentation/Laravel/src/Hooks/Illuminate/Contracts/Queue/Queue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ protected function hookLater(): bool
9292
$span = $this->instrumentation
9393
->tracer()
9494
->spanBuilder(vsprintf('%s %s', [
95+
TraceAttributeValues::MESSAGING_OPERATION_TYPE_CREATE,
9596
/** @phan-suppress-next-line PhanUndeclaredMethod */
9697
method_exists($queue, 'getQueue') ? $queue->getQueue($params[2] ?? null) : $queue->getConnectionName(),
97-
'create',
9898
]))
9999
->setSpanKind(SpanKind::KIND_PRODUCER)
100100
->setAttributes($attributes)

src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/Worker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ private function hookWorkerProcess(): bool
5151
$span = $this->instrumentation
5252
->tracer()
5353
->spanBuilder(vsprintf('%s %s', [
54+
TraceAttributeValues::MESSAGING_OPERATION_TYPE_PROCESS,
5455
$attributes[TraceAttributes::MESSAGING_DESTINATION_NAME],
55-
'process',
5656
]))
5757
->setSpanKind(SpanKind::KIND_CONSUMER)
5858
->setParent($parent)

src/Instrumentation/Laravel/tests/Integration/Queue/QueueTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ public function test_it_can_push_a_message_with_a_delay(): void
5555
$this->queue->later(new DateInterval('PT10M'), new DummyJob('DateInterval'));
5656
$this->queue->later(new DateTimeImmutable('2024-04-15 22:29:00.123Z'), new DummyJob('DateTime'));
5757

58-
$this->assertEquals('sync create', $this->storage[2]->getName());
58+
$this->assertEquals('create sync', $this->storage[2]->getName());
5959
$this->assertIsInt(
6060
$this->storage[2]->getAttributes()->get('messaging.message.delivery_timestamp'),
6161
);
6262

63-
$this->assertEquals('sync create', $this->storage[5]->getName());
63+
$this->assertEquals('create sync', $this->storage[5]->getName());
6464
$this->assertIsInt(
6565
$this->storage[5]->getAttributes()->get('messaging.message.delivery_timestamp'),
6666
);
6767

68-
$this->assertEquals('sync create', $this->storage[8]->getName());
68+
$this->assertEquals('create sync', $this->storage[8]->getName());
6969
$this->assertIsInt(
7070
$this->storage[8]->getAttributes()->get('messaging.message.delivery_timestamp'),
7171
);

0 commit comments

Comments
 (0)