Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/sentry/publish/sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@
'vendor:publish',
],

// AMQP consumers to ignore for performance monitoring
'ignore_amqp_consumer' => [
// App\Amqp\Consumers\DemoConsumer::class,
],

// Performance monitoring specific configuration
'tracing' => [
'amqp' => env('SENTRY_TRACING_ENABLE_AMQP', true),
Expand Down
7 changes: 7 additions & 0 deletions src/sentry/src/Tracing/Listener/EventHandleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ class EventHandleListener implements ListenerInterface

protected array $ignoreCommands = [];

protected array $ignoreAmqpConsumer = [];

public function __construct(
protected ContainerInterface $container,
protected ConfigInterface $config,
protected Feature $feature
) {
$this->ignoreCommands = (array) $this->config->get('sentry.ignore_commands', []);
$this->ignoreAmqpConsumer = (array) $this->config->get('sentry.ignore_amqp_consumer', []);
}

public function listen(): array
Expand Down Expand Up @@ -559,6 +562,10 @@ protected function handleAmqpMessageProcessing(AmqpEvent\BeforeConsume $event):

/** @var ConsumerMessage $message */
$message = $event->getMessage();
if (in_array($message::class, $this->ignoreAmqpConsumer, true)) {
return;
}

$carrier = null;

if (method_exists($event, 'getAMQPMessage')) {
Expand Down
Loading