Skip to content

Commit 22d0138

Browse files
authored
fix(agent): don't try to instrument anything when not recording (#1112)
When agent is not recording, Observer API fcall_init callback shouldn't do anything, including framework detection. This is how the agent operated before it used Observer API to hook into Zend Engine.
1 parent a8f64fe commit 22d0138

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

agent/php_observer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ static zend_observer_fcall_handlers nr_php_fcall_register_handlers(
8484
return handlers;
8585
}
8686

87+
if (0 == nr_php_recording()) {
88+
return handlers;
89+
}
90+
8791
if (nrunlikely(NR_PHP_PROCESS_GLOBALS(special_flags).show_executes)) {
8892
nr_php_show_exec("observe", execute_data, NULL);
8993
}

0 commit comments

Comments
 (0)