Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(agent): use Observer API to hook into Zend Engine for PHPs 8.0+ #542

Merged
merged 68 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
fa73a84
chore: Update branches that the GHA PR runner monitors. (#509)
zsistla Aug 24, 2022
a3c4cb5
feat(agent): Registered function begin/end and error handlers with Ob…
zsistla Sep 12, 2022
73d2816
feat(agent): Add/Update functions to utilize the OAPI zend_execute_da…
zsistla Oct 3, 2022
5365878
feat(agent): Propagate OAPI return values and update return value fun…
zsistla Oct 6, 2022
2871e2f
feat(agent): update nr_get_zend_execute_data to only use OAPI provide…
zsistla Oct 6, 2022
ecd977c
feat(agent): Add code level metrics functionality. (#506)
zsistla Oct 7, 2022
6d632da
feat(agent): user instrumentation via PHP's OAPI (#551)
zsistla Oct 13, 2022
e74dfc0
feat(agent): implement php_execute_show functionality for OAPI (#555)
bduranleau-nr Oct 20, 2022
8db0cab
fix(agent): detect framework in oapi's fcall_begin (#554)
lavarou Oct 25, 2022
4c732d9
tests(integration): update generator tests for oapi (#562)
bduranleau-nr Oct 25, 2022
363983d
fix(agent): fix check for max strlen when generating clm attributes (…
bduranleau-nr Oct 31, 2022
5896966
fix(agent): instrument `drupal_http_request` (#552)
lavarou Nov 1, 2022
4893277
feat(agent): OAPI exception handling (#580)
zsistla Jan 20, 2023
c7d4dfc
Merge remote-tracking branch 'origin/dev' into oapi
zsistla Jan 20, 2023
8764ea6
fix(agent): move globals that utilized the call stack into a global s…
ZNeumann Jan 26, 2023
0051e67
feat(agent): Remove php_vm.c overwriting opcodes when using OAPI (#559)
ZNeumann Jan 26, 2023
4ea50b6
fix(agent): Ensure txn exists before we try to reference it. (#600)
zsistla Jan 26, 2023
947f42a
fix(wordpress): fix unbound memory allocation when wordpress tags off…
ZNeumann Jan 27, 2023
7648b1a
fix(agent): Explicitly call some special function instrumentation in …
zsistla Feb 16, 2023
295ab5d
Merge remote-tracking branch 'origin/dev' into oapi
zsistla Feb 28, 2023
c974a2e
Merge remote-tracking branch 'origin/dev' into oapi
zsistla Mar 9, 2023
f3c38a3
test(agent): Fix tests to CLM on (#637)
mfulb Mar 10, 2023
4209f55
chore(install): Disable ZTS installs (#636)
mfulb Mar 10, 2023
cd99428
Revert "chore(install): Disable ZTS installs" (#662)
lavarou Apr 28, 2023
712396c
Merge remote-tracking branch 'origin/dev' into oapi
zsistla Jul 19, 2023
21a383b
tests: 'enhance' logging libraries mocks (#699)
lavarou Jul 26, 2023
447daab
tests: fix predis/test_pipeline expectation (#704)
lavarou Aug 1, 2023
fdb79fd
suppress `Invalid read` error in test_redis (#707)
lavarou Aug 8, 2023
33fed1d
fix(agent): set oapi callbacks the right way (#700)
ZNeumann Aug 8, 2023
6846ba4
feat(agent): instrument Drupal 9.4 hooks with oapi (#701)
ZNeumann Aug 9, 2023
dca53bd
fix: add guards to oapi cufa opcode check (#708)
ZNeumann Aug 9, 2023
1e7c861
fix(agent): wrap zend_try in a func to avoid clobbering (#703)
ZNeumann Aug 9, 2023
7d0a768
tests: 'enhance' laravel framework mock (#716)
lavarou Aug 21, 2023
8e683b1
Merge remote-tracking branch 'origin/dev' into oapi
zsistla Aug 22, 2023
f582376
tests: fix metrics expectation in drupal tests (#726)
lavarou Sep 6, 2023
7b142fc
refactor(agent): improve phpunit instrumentation (#725)
lavarou Sep 6, 2023
fae2aed
Merge branch 'dev' into oapi
zsistla Sep 8, 2023
f9fa14a
feat: optimize oapi cufa detection (#729)
ZNeumann Sep 21, 2023
54a23d4
feat: optional instrumentated function metric (#730)
ZNeumann Sep 21, 2023
b6c47aa
feat: redo wordpress hooks instrumentation for OAPI (#731)
ZNeumann Sep 21, 2023
4e791b7
Merge branch 'dev' (release 10.12) into oapi
lavarou Sep 22, 2023
3eb2abe
fix(agent): fix wrapping transient user functions (#735)
ZNeumann Sep 29, 2023
7b349f5
Merge branch 'dev' (release 10.13) into oapi
lavarou Sep 29, 2023
2b9e3b4
add new metric to oapi integration tests
lavarou Sep 29, 2023
8bcd5ca
tests(agent): Add tests that specifically exercise JIT. (#715)
zsistla Oct 22, 2023
a0783d4
tests: fix user exception and error handler implementation (#748)
lavarou Oct 23, 2023
58662eb
fix(agent): Correctly handle laravel queues (#746)
zsistla Nov 13, 2023
069310b
Merge branch 'dev' (release 10.14+tests) into oapi
lavarou Nov 21, 2023
55d781c
Merge branch 'dev' (release 10.15) into oapi
lavarou Dec 22, 2023
b4e3e5f
fixup! 24c1c656540a742d9d0466b79d33808ca2507ed7
lavarou Dec 22, 2023
bdb1174
fixup! 0150c096dc959dad60f820defb95d031d692aef9
lavarou Dec 21, 2023
99bd0ef
tests: remove broken exception handling unit tests (#817)
bduranleau-nr Jan 25, 2024
93e5a54
Merge branch 'dev' (release 10.16) into oapi
lavarou Jan 31, 2024
bfc5ac2
fixup! 43590ae2dfe0a86ca12d699e4406ad9d831d04bb
lavarou Jan 25, 2024
5035298
fixup! 43590ae2dfe0a86ca12d699e4406ad9d831d04bb
lavarou Jan 25, 2024
a20529b
fixup! 0fa3083c32c65abf8d48b28f76e96ee17679440a
lavarou Jan 29, 2024
e99f7cb
fixup! ac78511ede0e96d59610b798b6a41b53a202364b
lavarou Jan 29, 2024
53d10e0
fixup! 43590ae2dfe0a86ca12d699e4406ad9d831d04bb
lavarou Jan 29, 2024
4da1211
fix(agent): revert zend_try/catch php call logic (#811)
bduranleau-nr Jan 31, 2024
5640be3
feat(oapi): rework exception handling (#767)
ZNeumann Feb 2, 2024
49a6c1a
refactor: condense exception handling instrumentation (#825)
ZNeumann Feb 5, 2024
26648fe
feat(oapi): use segment pool instead of stacked segments (#776)
ZNeumann Feb 6, 2024
5d7ee9b
fix: correctly instrument WebdisConnection executeCommand in OAPI (#779)
ZNeumann Feb 6, 2024
958d859
feat: faster segment de-parenting via index tracking (#801)
ZNeumann Feb 8, 2024
55d3904
feat(tests): Enable opcache by default for the integration runner. (#…
zsistla Feb 22, 2024
b38f940
Merge branch 'dev' (release 10.17) into oapi
lavarou Feb 23, 2024
180bf59
fixup! e11b992cda2bad691bc651e28b0184ea720cdc04
lavarou Feb 23, 2024
4086b6b
fix(agent): fix Lumen detection (#838)
lavarou Feb 27, 2024
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
2 changes: 1 addition & 1 deletion agent/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ if test "$PHP_NEWRELIC" = "yes"; then
php_explain_pdo_mysql.c php_extension.c php_file_get_contents.c \
php_globals.c php_hash.c php_header.c php_httprequest_send.c \
php_internal_instrument.c php_minit.c php_mshutdown.c php_mysql.c \
php_mysqli.c php_newrelic.c php_nrini.c php_output.c php_pdo.c \
php_mysqli.c php_newrelic.c php_nrini.c php_observer.c php_output.c php_pdo.c \
php_pdo_mysql.c php_pdo_pgsql.c php_pgsql.c php_psr7.c php_redis.c \
php_rinit.c php_rshutdown.c php_samplers.c php_stack.c \
php_stacked_segment.c php_txn.c php_user_instrument.c \
Expand Down
37 changes: 37 additions & 0 deletions agent/fw_cakephp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ nr_framework_classification_t nr_cakephp_special_2(
* Component::initialize(). This function takes a controller as a parameter
* and we look into the params array of that controller object, and pick up
* the controller and action out of that array.
*
* CakePHP 1.x is end-of-life and no longer supported by the agent.
* Cake PHP 1.x does not support PHP 8+ and this wrapper is not updated for OAPI
* compatibility.
*
*/
NR_PHP_WRAPPER(nr_cakephp_name_the_wt_pre20) {
zval* arg1 = 0;
Expand Down Expand Up @@ -130,6 +135,17 @@ NR_PHP_WRAPPER_END
* and we get the action from the params array in that object. The
* controller object ($this) has a name, and that name is used (along
* with the word "Controller" appended which is what the CakePHP code does).
*
* CakePHP 2.x is end-of-life and in maintenance mode (critical bugfixes only).
* As such, functionality added in PHP 7.1+ is not well supported.
*
* txn naming scheme:
* In this case, `nr_txn_set_path` is called after `NR_PHP_WRAPPER_CALL` with
* `NR_NOT_OK_TO_OVERWRITE`
* This entails that the last wrapped call gets to name the txn.
* No changes required to ensure OAPI compatibility this corresponds to the
* default way of calling the wrapped function in func_end.
*
*/
NR_PHP_WRAPPER(nr_cakephp_name_the_wt_2) {
zval* arg1 = 0;
Expand Down Expand Up @@ -243,6 +259,11 @@ NR_PHP_WRAPPER_END
*
* Dispatch::cakeError will be called if there is a problem during dispatch
* (action or controller not found).
*
* CakePHP 1.x is end-of-life and no longer supported by the agent.
* Cake PHP 1.x does not support PHP 8+ and this wrapper is not updated for OAPI
* compatibility.
*
*/
NR_PHP_WRAPPER(nr_cakephp_problem_1) {
const char* name = "Dispatcher::cakeError";
Expand All @@ -266,6 +287,16 @@ NR_PHP_WRAPPER_END
* appropriate Exception will be created and thrown. We wrap the CakeException
* constructor instead of the Exception handler, since CakePHP allows for the
* handler to be completely replaced.
*
* CakePHP 2.x is end-of-life and in maintenance mode (critical bugfixes only).
* As such, functionality added in PHP 7.1+ is not well supported.
*
* txn naming scheme:
* In this case, `nr_txn_set_path` is called before `NR_PHP_WRAPPER_CALL` with
* `NR_NOT_OK_TO_OVERWRITE` and as this corresponds to calling the wrapped
* function in func_begin it needs to be explicitly set as a before_callback to
* ensure OAPI compatibility. This entails that the first wrapped call gets to
* name the txn.
*/
NR_PHP_WRAPPER(nr_cakephp_problem_2) {
const char* name = "Exception";
Expand Down Expand Up @@ -298,6 +329,12 @@ void nr_cakephp_enable_1(TSRMLS_D) {
void nr_cakephp_enable_2(TSRMLS_D) {
nr_php_wrap_user_function(NR_PSTR("Controller::invokeAction"),
nr_cakephp_name_the_wt_2 TSRMLS_CC);
#if ZEND_MODULE_API_NO >= ZEND_8_0_X_API_NO \
&& !defined OVERWRITE_ZEND_EXECUTE_DATA
nr_php_wrap_user_function_before_after_clean(
NR_PSTR("CakeException::__construct"), nr_cakephp_problem_2, NULL, NULL);
#else
nr_php_wrap_user_function(NR_PSTR("CakeException::__construct"),
nr_cakephp_problem_2 TSRMLS_CC);
#endif
}
Loading
Loading