Skip to content
Next Next commit
feat(agent): end transaction for laravel horizon
  • Loading branch information
hahuja2 committed Oct 15, 2025
commit b37a77f9e67f3d061e16dfb8cdea8c89b1a2b091
15 changes: 15 additions & 0 deletions agent/fw_laravel_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,14 @@ NR_PHP_WRAPPER(nr_laravel_queue_queue_createpayload) {
}
NR_PHP_WRAPPER_END

NR_PHP_WRAPPER(nr_laravel_horizon_end) {
NR_UNUSED_SPECIALFN;
(void)wraprec;

nr_php_txn_end(1, 0 TSRMLS_CC);
}
NR_PHP_WRAPPER_END

void nr_laravel_queue_enable(TSRMLS_D) {
/*
* Hook the command class that implements Laravel's queue:work command so
Expand Down Expand Up @@ -975,6 +983,13 @@ void nr_laravel_queue_enable(TSRMLS_D) {
nr_laravel_queue_workcommand_handle TSRMLS_CC);
#endif

nr_php_wrap_user_function_before_after_clean(
NR_PSTR("Laravel\\Horizon\\Console\\HorizonCommand::handle"),
nr_laravel_horizon_end, NULL, NULL);

nr_php_wrap_user_function_before_after_clean(
NR_PSTR("Laravel\\Horizon\\Console\\SupervisorCommand::handle"),
nr_laravel_horizon_end, NULL, NULL);
/*
* Hook the method that creates the JSON payloads for queued jobs so that we
* can add our metadata for CATMQ.
Expand Down