Skip to content

Commit

Permalink
Set status for console command transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
rodion-k committed Nov 5, 2024
1 parent 5f8da13 commit 7998a9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/EventListener/TracingConsoleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Sentry\State\HubInterface;
use Sentry\Tracing\Span;
use Sentry\Tracing\SpanContext;
use Sentry\Tracing\SpanStatus;
use Sentry\Tracing\Transaction;
use Sentry\Tracing\TransactionContext;
use Sentry\Tracing\TransactionSource;
Expand Down Expand Up @@ -93,6 +94,7 @@ public function handleConsoleTerminateEvent(ConsoleTerminateEvent $event): void
$span = $this->hub->getSpan();

if (null !== $span) {
$span->setStatus(0 === $event->getExitCode() ? SpanStatus::ok() : SpanStatus::internalError());
$span->finish();
}
}
Expand Down

0 comments on commit 7998a9b

Please sign in to comment.