diff --git a/src/platform-includes/configuration/before-send-transaction/php.laravel.mdx b/src/platform-includes/configuration/before-send-transaction/php.laravel.mdx new file mode 100644 index 0000000000000..a9d9acd668e0a --- /dev/null +++ b/src/platform-includes/configuration/before-send-transaction/php.laravel.mdx @@ -0,0 +1,13 @@ +In the Laravel config, a closure can be used to modify the event or return a completely new one. If you return `null`, the event will be discarded. + +```php {filename:config/sentry.php} +'before_send_transaction' => function (\Sentry\Event $transaction): ?\Sentry\Event { + return $transaction; +}, +``` + + + +Learn more in [Closures and Config Caching](/platforms/php/guides/laravel/configuration/laravel-options/#closures-and-config-caching). + + diff --git a/src/platform-includes/configuration/before-send-transaction/php.mdx b/src/platform-includes/configuration/before-send-transaction/php.mdx new file mode 100644 index 0000000000000..677266183a15d --- /dev/null +++ b/src/platform-includes/configuration/before-send-transaction/php.mdx @@ -0,0 +1,10 @@ +In PHP, a closure can be used to modify the event or return a completely new one. If you return `null`, the event will be discarded. + +```php +\Sentry\init([ + 'dsn' => '___PUBLIC_DSN___', + 'before_send_transaction' => function (\Sentry\Event $transaction): ?\Sentry\Event { + return $transaction; + }, +]); +``` diff --git a/src/platforms/common/configuration/options.mdx b/src/platforms/common/configuration/options.mdx index 0e5b35219899d..a1af126c4b570 100644 --- a/src/platforms/common/configuration/options.mdx +++ b/src/platforms/common/configuration/options.mdx @@ -567,7 +567,7 @@ This function is called with an SDK-specific message or error event object, and - + This function is called with an SDK-specific transaction event object, and can return a modified transaction event object, or `null` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.