Skip to content

Commit 0949fc2

Browse files
rodion-kJeffreyhungcleptric
authored
Set status for console command transactions (#891)
Co-authored-by: Jeffrey Hung <[email protected]> Co-authored-by: Michi Hoffmann <[email protected]>
1 parent a6b680e commit 0949fc2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/EventListener/TracingConsoleListener.php

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Sentry\State\HubInterface;
88
use Sentry\Tracing\Span;
99
use Sentry\Tracing\SpanContext;
10+
use Sentry\Tracing\SpanStatus;
1011
use Sentry\Tracing\Transaction;
1112
use Sentry\Tracing\TransactionContext;
1213
use Sentry\Tracing\TransactionSource;
@@ -93,6 +94,7 @@ public function handleConsoleTerminateEvent(ConsoleTerminateEvent $event): void
9394
$span = $this->hub->getSpan();
9495

9596
if (null !== $span) {
97+
$span->setStatus(0 === $event->getExitCode() ? SpanStatus::ok() : SpanStatus::internalError());
9698
$span->finish();
9799
}
98100
}

0 commit comments

Comments
 (0)