diff --git a/src/sentry/publish/sentry.php b/src/sentry/publish/sentry.php index b00f47fa9..f80883b41 100644 --- a/src/sentry/publish/sentry.php +++ b/src/sentry/publish/sentry.php @@ -117,7 +117,6 @@ 'view' => env('SENTRY_TRACING_SPANS_VIEW', true), ], 'extra_tags' => [ - 'exception.stack_trace' => true, 'amqp.result' => false, 'annotation.result' => false, 'db.sql.bindings' => true, diff --git a/src/sentry/src/Tracing/Aspect/CoroutineAspect.php b/src/sentry/src/Tracing/Aspect/CoroutineAspect.php index 0f296df9f..fdb1740fe 100644 --- a/src/sentry/src/Tracing/Aspect/CoroutineAspect.php +++ b/src/sentry/src/Tracing/Aspect/CoroutineAspect.php @@ -111,15 +111,7 @@ public function process(ProceedingJoinPoint $proceedingJoinPoint) 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $coTransaction->setData([ - 'exception.stack_trace' => (string) $exception, - ]); - } throw $exception; } diff --git a/src/sentry/src/Tracing/Aspect/GuzzleHttpClientAspect.php b/src/sentry/src/Tracing/Aspect/GuzzleHttpClientAspect.php index 2c90e753d..21fa59dbb 100644 --- a/src/sentry/src/Tracing/Aspect/GuzzleHttpClientAspect.php +++ b/src/sentry/src/Tracing/Aspect/GuzzleHttpClientAspect.php @@ -161,15 +161,7 @@ function (Scope $scope) use ($proceedingJoinPoint, $options, $guzzleConfig) { 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $span->setData([ - 'exception.stack_trace' => (string) $exception, - ]); - } } if (is_callable($onStats)) { diff --git a/src/sentry/src/Tracing/Listener/EventHandleListener.php b/src/sentry/src/Tracing/Listener/EventHandleListener.php index dd9b3fa68..3206c97ea 100644 --- a/src/sentry/src/Tracing/Listener/EventHandleListener.php +++ b/src/sentry/src/Tracing/Listener/EventHandleListener.php @@ -363,15 +363,7 @@ protected function handleRequestHandled(HttpEvent\RequestHandled|RpcEvent\Reques 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), - ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $span->setData([ - 'exception.stack_trace' => (string) $exception, ]); - } } } @@ -429,15 +421,7 @@ protected function handleCommandFinished(CommandEvent\AfterExecute $event): void 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), - ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $transaction->setData([ - 'exception.stack_trace' => (string) $exception, ]); - } } $transaction->setStatus( @@ -478,13 +462,7 @@ function (Scope $scope) use ($event) { 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $span->setData(['exception.stack_trace' => (string) $exception]); - } } }, SpanContext::make() @@ -555,13 +533,7 @@ protected function handleCrontabTaskFinished(CrontabEvent\FailToExecute|CrontabE 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $transaction->setData(['exception.stack_trace' => (string) $exception]); - } } } @@ -635,13 +607,7 @@ protected function handleAmqpMessageProcessed(AmqpEvent\AfterConsume|AmqpEvent\F 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $transaction->setData(['exception.stack_trace' => (string) $exception]); - } } } @@ -707,13 +673,7 @@ protected function handleKafkaMessageProcessed(KafkaEvent\AfterConsume|KafkaEven 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $transaction->setData(['exception.stack_trace' => (string) $exception]); - } } } @@ -766,13 +726,7 @@ protected function handleAsyncQueueJobProcessed(AsyncQueueEvent\AfterHandle|Asyn 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), ]); - if ($this->feature->isTracingExtraTagEnabled('exception.stack_trace')) { - $transaction->setData(['exception.stack_trace' => (string) $exception]); - } } } diff --git a/src/sentry/src/Tracing/Tracer.php b/src/sentry/src/Tracing/Tracer.php index 72e719743..8a21bb076 100644 --- a/src/sentry/src/Tracing/Tracer.php +++ b/src/sentry/src/Tracing/Tracer.php @@ -11,7 +11,6 @@ namespace FriendsOfHyperf\Sentry\Tracing; -use FriendsOfHyperf\Sentry\Feature; use Hyperf\Engine\Coroutine; use Sentry\SentrySdk; use Sentry\State\Scope; @@ -27,10 +26,6 @@ class Tracer { - public function __construct(protected Feature $feature) - { - } - /** * Starts a new Transaction and returns it. This is the entry point to manual tracing instrumentation. */ @@ -74,8 +69,6 @@ public function startTransaction(TransactionContext $transactionContext, array $ */ public function trace(callable $trace, SpanContext $context) { - $isTracingExtraTagEnabled = $this->feature->isTracingExtraTagEnabled('exception.stack_trace'); - if ($context->getStatus() === null) { $context->setStatus(SpanStatus::ok()); } @@ -87,7 +80,7 @@ public function trace(callable $trace, SpanContext $context) $context->setData(['coroutine.id' => Coroutine::id()] + $context->getData()); return trace( - function (Scope $scope) use ($trace, $isTracingExtraTagEnabled) { + function (Scope $scope) use ($trace) { try { return $trace($scope); } catch (Throwable $exception) { @@ -98,15 +91,7 @@ function (Scope $scope) use ($trace, $isTracingExtraTagEnabled) { 'error' => 'true', 'exception.class' => $exception::class, 'exception.code' => (string) $exception->getCode(), - ]) - ->setData([ - 'exception.message' => $exception->getMessage(), - ]); - if ($isTracingExtraTagEnabled) { - $span->setData([ - 'exception.stack_trace' => (string) $exception, ]); - } } throw $exception; }