Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardChukwu committed Oct 17, 2024
2 parents ea5f1b1 + 78a04ce commit f6a23dd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Instrumentation/Symfony/src/MessengerInstrumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ public static function register(): void
// Instrument dispatch as a "send" operation with SpanKind::KIND_PRODUCER
$builder = $instrumentation
->tracer()
<<<<<<< HEAD
->spanBuilder(\sprintf('publish %s', $messageClass))
->setSpanKind(SpanKind::KIND_PRODUCER) // Set KIND_PRODUCER for dispatch
=======
->spanBuilder(\sprintf('DISPATCH %s', $messageClass))
->setSpanKind(SpanKind::KIND_PRODUCER)
>>>>>>> 78a04cebaeba48d60a00dc1c48653695b926299d
->setAttribute(TraceAttributes::CODE_FUNCTION, $function)
->setAttribute(TraceAttributes::CODE_NAMESPACE, $class)
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
Expand Down Expand Up @@ -118,6 +123,7 @@ public static function register(): void

// Instrument sending as a "send" operation with SpanKind::KIND_PRODUCER
$builder = $instrumentation
<<<<<<< HEAD
->tracer()
->spanBuilder(\sprintf('send %s', $messageClass))
->setSpanKind(SpanKind::KIND_PRODUCER) // Set KIND_PRODUCER for sending
Expand All @@ -127,6 +133,19 @@ public static function register(): void
->setAttribute(TraceAttributes::CODE_LINENO, $lineno)
->setAttribute(self::ATTRIBUTE_MESSENGER_TRANSPORT, $class)
->setAttribute(self::ATTRIBUTE_MESSENGER_MESSAGE, $messageClass);
=======
->tracer()
->spanBuilder(\sprintf('SEND %s', $messageClass))
->setSpanKind(SpanKind::KIND_PRODUCER)
->setAttribute(TraceAttributes::CODE_FUNCTION, $function)
->setAttribute(TraceAttributes::CODE_NAMESPACE, $class)
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
->setAttribute(TraceAttributes::CODE_LINENO, $lineno)

->setAttribute(self::ATTRIBUTE_MESSENGER_TRANSPORT, $class)
->setAttribute(self::ATTRIBUTE_MESSENGER_MESSAGE, $messageClass)
;
>>>>>>> 78a04cebaeba48d60a00dc1c48653695b926299d

$parent = Context::getCurrent();
$span = $builder
Expand Down

0 comments on commit f6a23dd

Please sign in to comment.