Skip to content

Commit de6f6cf

Browse files
committed
feat(agent): end transaction for laravel horizon
1 parent 09b8a53 commit de6f6cf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

agent/fw_laravel_queue.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,14 @@ NR_PHP_WRAPPER(nr_laravel_queue_queue_createpayload) {
839839
}
840840
NR_PHP_WRAPPER_END
841841

842+
NR_PHP_WRAPPER(nr_laravel_horizon_end) {
843+
NR_UNUSED_SPECIALFN;
844+
(void)wraprec;
845+
846+
nr_php_txn_end(1, 0 TSRMLS_CC);
847+
}
848+
NR_PHP_WRAPPER_END
849+
842850
void nr_laravel_queue_enable(TSRMLS_D) {
843851
/*
844852
* Hook the command class that implements Laravel's queue:work command so
@@ -892,6 +900,13 @@ void nr_laravel_queue_enable(TSRMLS_D) {
892900
nr_laravel_queue_workcommand_handle TSRMLS_CC);
893901
#endif
894902

903+
nr_php_wrap_user_function_before_after_clean(
904+
NR_PSTR("Laravel\\Horizon\\Console\\HorizonCommand::handle"),
905+
nr_laravel_horizon_end, NULL, NULL);
906+
907+
nr_php_wrap_user_function_before_after_clean(
908+
NR_PSTR("Laravel\\Horizon\\Console\\SupervisorCommand::handle"),
909+
nr_laravel_horizon_end, NULL, NULL);
895910
/*
896911
* Hook the method that creates the JSON payloads for queued jobs so that we
897912
* can add our metadata for CATMQ.

0 commit comments

Comments
 (0)