From 879b33250dd847998df18a3d69b0aedf1e859bff Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Mon, 25 Mar 2024 14:43:01 -0700 Subject: [PATCH 01/21] feat(agent): create new function that sends up supportability metrics for packages --- agent/fw_support.c | 14 ++++++++++++++ agent/fw_support.h | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/agent/fw_support.c b/agent/fw_support.c index f615aef10..10b2f53ea 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -52,3 +52,17 @@ void nr_fw_support_add_logging_supportability_metric(nrtxn_t* txn, nrm_force_add(txn->unscoped_metrics, metname, 0); nr_free(metname); } + +void nr_fw_support_add_package_supportability_metric( + nrtxn_t* txn, + const char* package_name, + const char* package_version) { + if (NULL == txn || NULL == package_name || NULL == package_version) { + return; + } + + char* metname = nr_formatf("Supportability/PHP/package/%s/%c/detected", + package_name, package_version[0]); + nrm_force_add(txn->unscoped_metrics, metname, 0); + nr_free(metname); +} diff --git a/agent/fw_support.h b/agent/fw_support.h index 45c5f8269..5099a7d35 100644 --- a/agent/fw_support.h +++ b/agent/fw_support.h @@ -38,4 +38,17 @@ extern void nr_fw_support_add_logging_supportability_metric( const char* library_name, const bool is_enabled); +/* + * Purpose: Add 'Supportability/PHP/package/{package}/{version}/detected' metric + * + * Params : 1. Transaction object + * 2. Package name + * 3. Package version + * + */ +extern void nr_fw_support_add_package_supportability_metric( + nrtxn_t* txn, + const char* package_name, + const char* package_version); + #endif /* FW_SUPPORT_HDR */ From 2a830424f6e6bf921d2e9a1ed941ee52bf14c5b0 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Mon, 25 Mar 2024 14:46:36 -0700 Subject: [PATCH 02/21] feat(agent): add supportability metrics for packages that provide version --- agent/fw_drupal8.c | 2 ++ agent/fw_laravel.c | 2 ++ agent/fw_slim.c | 3 +++ agent/fw_wordpress.c | 2 ++ agent/lib_guzzle6.c | 2 ++ agent/lib_predis.c | 2 ++ 6 files changed, 13 insertions(+) diff --git a/agent/fw_drupal8.c b/agent/fw_drupal8.c index fbd04f315..3dd3678c5 100644 --- a/agent/fw_drupal8.c +++ b/agent/fw_drupal8.c @@ -685,6 +685,8 @@ void nr_drupal_version() { if (nr_php_is_zval_valid_string(zval_version)) { char* version = Z_STRVAL_P(zval_version); nr_txn_add_php_package(NRPRG(txn), "drupal/core", version); + nr_fw_support_add_package_supportability_metric(NRPRG(txn), "drupal/core", + version); } nr_php_zval_free(&zval_version); diff --git a/agent/fw_laravel.c b/agent/fw_laravel.c index 8d35715d2..0a2f0923c 100644 --- a/agent/fw_laravel.c +++ b/agent/fw_laravel.c @@ -960,6 +960,8 @@ NR_PHP_WRAPPER(nr_laravel_application_construct) { if (NRINI(vulnerability_management_package_detection_enabled)) { // Add php package to transaction nr_txn_add_php_package(NRPRG(txn), "laravel/framework", version); + nr_fw_support_add_package_supportability_metric( + NRPRG(txn), "laravel/framework", version); } if (version) { diff --git a/agent/fw_slim.c b/agent/fw_slim.c index e810dd7f4..863e3f147 100644 --- a/agent/fw_slim.c +++ b/agent/fw_slim.c @@ -122,6 +122,9 @@ NR_PHP_WRAPPER(nr_slim_application_construct) { // Add php package to transaction nr_txn_add_php_package(NRPRG(txn), "slim/slim", version); + nr_fw_support_add_package_supportability_metric(NRPRG(txn), "slim/slim", + version); + nr_free(version); nr_php_scope_release(&this_var); } diff --git a/agent/fw_wordpress.c b/agent/fw_wordpress.c index 874ab6cc8..e2a10ef57 100644 --- a/agent/fw_wordpress.c +++ b/agent/fw_wordpress.c @@ -810,6 +810,8 @@ void nr_wordpress_version() { if (nr_php_is_zval_valid_string(&retval)) { char* version = Z_STRVAL(retval); nr_txn_add_php_package(NRPRG(txn), "wordpress", version); + nr_fw_support_add_package_supportability_metric(NRPRG(txn), "wordpress", + version); } zval_dtor(&retval); } diff --git a/agent/lib_guzzle6.c b/agent/lib_guzzle6.c index 0f131b5d0..5cea3936c 100644 --- a/agent/lib_guzzle6.c +++ b/agent/lib_guzzle6.c @@ -354,6 +354,8 @@ NR_PHP_WRAPPER_START(nr_guzzle6_client_construct) { char* version = nr_php_get_object_constant(this_var, "VERSION"); // Add php package to transaction nr_txn_add_php_package(NRPRG(txn), "guzzlehttp/guzzle", version); + nr_fw_support_add_package_supportability_metric( + NRPRG(txn), "guzzlehttp/guzzle", version); nr_free(version); } diff --git a/agent/lib_predis.c b/agent/lib_predis.c index d4a287a03..54e33e6fd 100644 --- a/agent/lib_predis.c +++ b/agent/lib_predis.c @@ -650,6 +650,8 @@ NR_PHP_WRAPPER(nr_predis_client_construct) { char* version = nr_php_get_object_constant(scope, "VERSION"); // Add php package to transaction nr_txn_add_php_package(NRPRG(txn), "predis/predis", version); + nr_fw_support_add_package_supportability_metric( + NRPRG(txn), "predis/predis", version); nr_free(version); } From 08dbf018f59e58a0a874cb9a40a30a64a2a66bee Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Tue, 26 Mar 2024 16:50:45 -0700 Subject: [PATCH 03/21] feat(agent): add if statement to check if major version is more than one digit --- agent/fw_support.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index 10b2f53ea..eb9b9b44d 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -61,8 +61,25 @@ void nr_fw_support_add_package_supportability_metric( return; } - char* metname = nr_formatf("Supportability/PHP/package/%s/%c/detected", - package_name, package_version[0]); + char* metname = NULL; + char major_version[3]; + + /* If the second character is not a '.', this means the version is more than + * one digit and we need to extract the first two characters to get the major + * version. + */ + if ('.' != package_version[1]) { + strncpy(major_version, package_version, 2); + major_version[2] = '\0'; + } + + if (NR_FW_UNSET == NRINI(force_framework)) { + metname = nr_formatf("Supportability/PHP/package/%s/%s/detected", + package_name, major_version); + } else { + metname = nr_formatf("Supportability/PHP/package/%s/%s/forced", + package_name, major_version); + } nrm_force_add(txn->unscoped_metrics, metname, 0); nr_free(metname); } From cfa5e7fa376697f39ac66fb0864e33fefadfb0b6 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Tue, 26 Mar 2024 17:08:34 -0700 Subject: [PATCH 04/21] feat(agent): set major version to first digit only in else statement --- agent/fw_support.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/agent/fw_support.c b/agent/fw_support.c index eb9b9b44d..515d8f16e 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -71,6 +71,9 @@ void nr_fw_support_add_package_supportability_metric( if ('.' != package_version[1]) { strncpy(major_version, package_version, 2); major_version[2] = '\0'; + } else { + strncpy(major_version, package_version, 1); + major_version[1] = '\0'; } if (NR_FW_UNSET == NRINI(force_framework)) { From 9ff62348c35f0d941abfddfd4ea2d83e9766a614 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Tue, 26 Mar 2024 18:39:19 -0700 Subject: [PATCH 05/21] feat(agent): improve how the major version is found --- agent/fw_support.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index 515d8f16e..2f066f741 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -62,18 +62,17 @@ void nr_fw_support_add_package_supportability_metric( } char* metname = NULL; - char major_version[3]; + char major_version[4]; - /* If the second character is not a '.', this means the version is more than - * one digit and we need to extract the first two characters to get the major - * version. + /* The below for loop checks if the major version of the package is more than + * one digit and keeps looping until a '.' is encountered or one of the conditions is met. */ - if ('.' != package_version[1]) { - strncpy(major_version, package_version, 2); - major_version[2] = '\0'; - } else { - strncpy(major_version, package_version, 1); - major_version[1] = '\0'; + for (int i = 0; package_version[i] && i < 4; i++) { + if ('.' == package_version[i]) { + strncpy(major_version, package_version, i); + major_version[i] = '\0'; + break; + } } if (NR_FW_UNSET == NRINI(force_framework)) { From 3d36800809b5d9acf9ba107357ed908046307813 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Wed, 27 Mar 2024 11:31:16 -0700 Subject: [PATCH 06/21] chore(agent): add check to ensure major version is not null --- agent/fw_support.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index 2f066f741..966546085 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -62,10 +62,11 @@ void nr_fw_support_add_package_supportability_metric( } char* metname = NULL; - char major_version[4]; + char major_version[4] = {0}; /* The below for loop checks if the major version of the package is more than - * one digit and keeps looping until a '.' is encountered or one of the conditions is met. + * one digit and keeps looping until a '.' is encountered or one of the + * conditions is met. */ for (int i = 0; package_version[i] && i < 4; i++) { if ('.' == package_version[i]) { @@ -75,6 +76,10 @@ void nr_fw_support_add_package_supportability_metric( } } + if ('\0' == major_version[0]) { + return; + } + if (NR_FW_UNSET == NRINI(force_framework)) { metname = nr_formatf("Supportability/PHP/package/%s/%s/detected", package_name, major_version); From 2b4836a21c4649ddb554e4485169bd6707baea92 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Wed, 27 Mar 2024 13:50:10 -0700 Subject: [PATCH 07/21] chore(agent): set predis to specific version instead of latest --- files/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/Dockerfile b/files/Dockerfile index 4b50bebb8..6103fc905 100644 --- a/files/Dockerfile +++ b/files/Dockerfile @@ -152,7 +152,7 @@ RUN \ # install predis # installation will be in /usr/src/vendor/predis/predis # which is value which should be used for PREDIS_HOME -RUN php composer.phar require "predis/predis" +RUN php composer.phar require "predis/predis:2.2.2" RUN php composer.phar update # From 67eaae445d72c3ab30c26d0a7b69ee8046ab0c08 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Wed, 27 Mar 2024 13:51:46 -0700 Subject: [PATCH 08/21] chore(agent): add new supportability metric to guzzle and predis tests --- tests/integration/external/guzzle6/test_cat.php | 1 + tests/integration/external/guzzle6/test_dt.php | 1 + .../external/guzzle6/test_dt_newrelic_header_disabled.php | 1 + tests/integration/external/guzzle6/test_dt_synthetics.php | 1 + .../external/guzzle6/test_dt_synthetics_logging_off.php | 1 + tests/integration/external/guzzle6/test_no_cat_no_dt.php | 1 + tests/integration/predis/test_basic.php | 1 + tests/integration/predis/test_basic_logging_off.php | 1 + tests/integration/predis/test_basic_reporting_disabled.php | 1 + tests/integration/predis/test_pipeline.php | 1 + tests/integration/predis/test_pipeline_atomic.php | 1 + tests/integration/predis/test_pipeline_fire_and_forget.php | 1 + .../predis/test_pipeline_fire_and_forget_logging_off.php | 1 + 13 files changed, 13 insertions(+) diff --git a/tests/integration/external/guzzle6/test_cat.php b/tests/integration/external/guzzle6/test_cat.php index d2f3ac76e..9f4b40f2c 100644 --- a/tests/integration/external/guzzle6/test_cat.php +++ b/tests/integration/external/guzzle6/test_cat.php @@ -51,6 +51,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/6/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle6/test_dt.php b/tests/integration/external/guzzle6/test_dt.php index bb4cce2b2..da4d6584c 100644 --- a/tests/integration/external/guzzle6/test_dt.php +++ b/tests/integration/external/guzzle6/test_dt.php @@ -42,6 +42,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/6/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle6/test_dt_newrelic_header_disabled.php b/tests/integration/external/guzzle6/test_dt_newrelic_header_disabled.php index 8ee9d895a..ad87177dd 100644 --- a/tests/integration/external/guzzle6/test_dt_newrelic_header_disabled.php +++ b/tests/integration/external/guzzle6/test_dt_newrelic_header_disabled.php @@ -43,6 +43,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/6/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle6/test_dt_synthetics.php b/tests/integration/external/guzzle6/test_dt_synthetics.php index 67be5027f..ce80463ad 100644 --- a/tests/integration/external/guzzle6/test_dt_synthetics.php +++ b/tests/integration/external/guzzle6/test_dt_synthetics.php @@ -65,6 +65,7 @@ [{"name":"WebTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"WebTransactionTotalTime/Uri__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"HttpDispatcher"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/6/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle6/test_dt_synthetics_logging_off.php b/tests/integration/external/guzzle6/test_dt_synthetics_logging_off.php index 9d2a739ed..c843f9571 100644 --- a/tests/integration/external/guzzle6/test_dt_synthetics_logging_off.php +++ b/tests/integration/external/guzzle6/test_dt_synthetics_logging_off.php @@ -68,6 +68,7 @@ [{"name":"WebTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"WebTransactionTotalTime/Uri__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"HttpDispatcher"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/6/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle6/test_no_cat_no_dt.php b/tests/integration/external/guzzle6/test_no_cat_no_dt.php index 218f019ff..eb60de85c 100644 --- a/tests/integration/external/guzzle6/test_no_cat_no_dt.php +++ b/tests/integration/external/guzzle6/test_no_cat_no_dt.php @@ -42,6 +42,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/6/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/predis/test_basic.php b/tests/integration/predis/test_basic.php index 0adfeaa04..68abdf928 100644 --- a/tests/integration/predis/test_basic.php +++ b/tests/integration/predis/test_basic.php @@ -54,6 +54,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/predis/predis/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/predis/test_basic_logging_off.php b/tests/integration/predis/test_basic_logging_off.php index 4355fd359..03c84c3bb 100644 --- a/tests/integration/predis/test_basic_logging_off.php +++ b/tests/integration/predis/test_basic_logging_off.php @@ -57,6 +57,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/predis/predis/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/predis/test_basic_reporting_disabled.php b/tests/integration/predis/test_basic_reporting_disabled.php index b8ad0d057..73d262965 100644 --- a/tests/integration/predis/test_basic_reporting_disabled.php +++ b/tests/integration/predis/test_basic_reporting_disabled.php @@ -59,6 +59,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/predis/predis/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/predis/test_pipeline.php b/tests/integration/predis/test_pipeline.php index 1592084de..32312aab4 100644 --- a/tests/integration/predis/test_pipeline.php +++ b/tests/integration/predis/test_pipeline.php @@ -47,6 +47,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/predis/predis/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/predis/test_pipeline_atomic.php b/tests/integration/predis/test_pipeline_atomic.php index 620336534..fd695e5ed 100644 --- a/tests/integration/predis/test_pipeline_atomic.php +++ b/tests/integration/predis/test_pipeline_atomic.php @@ -47,6 +47,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/predis/predis/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/predis/test_pipeline_fire_and_forget.php b/tests/integration/predis/test_pipeline_fire_and_forget.php index ef3fdc2c6..4f7225884 100644 --- a/tests/integration/predis/test_pipeline_fire_and_forget.php +++ b/tests/integration/predis/test_pipeline_fire_and_forget.php @@ -47,6 +47,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/predis/predis/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/predis/test_pipeline_fire_and_forget_logging_off.php b/tests/integration/predis/test_pipeline_fire_and_forget_logging_off.php index fc15d052c..82a76903e 100644 --- a/tests/integration/predis/test_pipeline_fire_and_forget_logging_off.php +++ b/tests/integration/predis/test_pipeline_fire_and_forget_logging_off.php @@ -50,6 +50,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/predis/predis/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], From e32440d5e659a57b5ce6276c2b6bfc35428064df Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Thu, 28 Mar 2024 11:13:01 -0700 Subject: [PATCH 09/21] chore(agent): add if statement to not run predis tests on PHP 7.0/7.1 --- files/Dockerfile | 2 +- tests/integration/predis/predis.inc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/files/Dockerfile b/files/Dockerfile index 6103fc905..4b50bebb8 100644 --- a/files/Dockerfile +++ b/files/Dockerfile @@ -152,7 +152,7 @@ RUN \ # install predis # installation will be in /usr/src/vendor/predis/predis # which is value which should be used for PREDIS_HOME -RUN php composer.phar require "predis/predis:2.2.2" +RUN php composer.phar require "predis/predis" RUN php composer.phar update # diff --git a/tests/integration/predis/predis.inc b/tests/integration/predis/predis.inc index dbf390605..0788d2fb7 100644 --- a/tests/integration/predis/predis.inc +++ b/tests/integration/predis/predis.inc @@ -4,6 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ +if (version_compare(PHP_VERSION, '7.2', '<')) { + die("skip: PHP 7.2+ required\n"); +} + $PREDIS_HOME = getenv("PREDIS_HOME"); if (empty($PREDIS_HOME)) { From 5248b973b49710db11c228a9fd3ef42adb7b4c4c Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Fri, 29 Mar 2024 10:16:32 -0700 Subject: [PATCH 10/21] chore(agent): add supportability metrics for guzzle and monolog by major version --- agent/fw_support.c | 5 ++++- agent/lib_guzzle6.c | 3 +++ agent/lib_monolog.c | 4 ++++ agent/php_agent.c | 11 ++++++++--- tests/integration/external/guzzle7/test_cat.php | 1 + tests/integration/external/guzzle7/test_dt.php | 1 + .../guzzle7/test_dt_newrelic_header_disabled.php | 1 + .../external/guzzle7/test_dt_synthetics.php | 1 + .../external/guzzle7/test_no_cat_no_dt.php | 1 + .../logging/monolog2/test_monolog_basic.php | 1 + .../logging/monolog2/test_monolog_basic_clm.php | 1 + .../logging/monolog2/test_monolog_basic_clm_off.php | 1 + .../integration/logging/monolog2/test_monolog_cat.php | 1 + .../logging/monolog2/test_monolog_context_default.php | 1 + .../monolog2/test_monolog_context_exception.php | 1 + .../monolog2/test_monolog_context_filter_extra1.php | 1 + .../monolog2/test_monolog_context_filter_extra2.php | 1 + .../monolog2/test_monolog_context_filter_extra3.php | 1 + .../monolog2/test_monolog_context_filter_extra4.php | 1 + .../monolog2/test_monolog_context_filter_extra5.php | 1 + .../monolog2/test_monolog_context_filter_rule1.php | 1 + .../monolog2/test_monolog_context_filter_rule10.php | 1 + .../monolog2/test_monolog_context_filter_rule11.php | 1 + .../monolog2/test_monolog_context_filter_rule2.php | 1 + .../monolog2/test_monolog_context_filter_rule3.php | 1 + .../monolog2/test_monolog_context_filter_rule4.php | 1 + .../monolog2/test_monolog_context_filter_rule5.php | 1 + .../monolog2/test_monolog_context_filter_rule6.php | 1 + .../monolog2/test_monolog_context_filter_rule7.php | 1 + .../monolog2/test_monolog_context_filter_rule8.php | 1 + .../monolog2/test_monolog_context_filter_rule9.php | 1 + .../monolog2/test_monolog_context_limits_1.php | 1 + .../monolog2/test_monolog_context_limits_2.php | 1 + .../monolog2/test_monolog_context_precedence_1.php | 1 + .../monolog2/test_monolog_context_precedence_2.php | 1 + .../logging/monolog2/test_monolog_context_simple.php | 1 + .../test_monolog_decoration_and_forwarding.php | 1 + .../logging/monolog2/test_monolog_disable_metrics.php | 1 + .../logging/monolog2/test_monolog_drop_empty.php | 1 + .../logging/monolog2/test_monolog_escape_chars.php | 1 + .../monolog2/test_monolog_large_message_limit.php | 1 + .../test_monolog_large_message_limit_drops.php | 1 + .../monolog2/test_monolog_limit_log_events.php | 1 + .../monolog2/test_monolog_limit_zero_events.php | 1 + ...monolog_log_events_max_samples_stored_invalid1.php | 1 + ...monolog_log_events_max_samples_stored_invalid2.php | 1 + ...monolog_log_events_max_samples_stored_invalid3.php | 1 + ...monolog_log_events_max_samples_stored_invalid4.php | 1 + .../monolog2/test_monolog_log_level_filter.php | 1 + .../test_monolog_log_level_filter_invalid.php | 1 + .../monolog2/test_monolog_truncate_long_msgs.php | 1 + .../logging/monolog3/test_monolog_basic.php | 1 + .../logging/monolog3/test_monolog_basic_clm.php | 1 + .../logging/monolog3/test_monolog_basic_clm_off.php | 1 + .../integration/logging/monolog3/test_monolog_cat.php | 1 + .../logging/monolog3/test_monolog_context_default.php | 1 + .../monolog3/test_monolog_context_exception.php | 1 + .../monolog3/test_monolog_context_filter_extra1.php | 1 + .../monolog3/test_monolog_context_filter_extra2.php | 1 + .../monolog3/test_monolog_context_filter_extra3.php | 1 + .../monolog3/test_monolog_context_filter_extra4.php | 1 + .../monolog3/test_monolog_context_filter_extra5.php | 1 + .../monolog3/test_monolog_context_filter_rule1.php | 1 + .../monolog3/test_monolog_context_filter_rule10.php | 1 + .../monolog3/test_monolog_context_filter_rule11.php | 1 + .../monolog3/test_monolog_context_filter_rule2.php | 1 + .../monolog3/test_monolog_context_filter_rule3.php | 1 + .../monolog3/test_monolog_context_filter_rule4.php | 1 + .../monolog3/test_monolog_context_filter_rule5.php | 1 + .../monolog3/test_monolog_context_filter_rule6.php | 1 + .../monolog3/test_monolog_context_filter_rule7.php | 1 + .../monolog3/test_monolog_context_filter_rule8.php | 1 + .../monolog3/test_monolog_context_filter_rule9.php | 1 + .../monolog3/test_monolog_context_limits_1.php | 1 + .../monolog3/test_monolog_context_limits_2.php | 1 + .../monolog3/test_monolog_context_precedence_1.php | 1 + .../monolog3/test_monolog_context_precedence_2.php | 1 + .../logging/monolog3/test_monolog_context_simple.php | 1 + .../test_monolog_decoration_and_forwarding.php | 1 + .../logging/monolog3/test_monolog_disable_metrics.php | 1 + .../logging/monolog3/test_monolog_drop_empty.php | 1 + .../logging/monolog3/test_monolog_escape_chars.php | 1 + .../monolog3/test_monolog_large_message_limit.php | 1 + .../test_monolog_large_message_limit_drops.php | 1 + .../monolog3/test_monolog_limit_log_events.php | 1 + .../monolog3/test_monolog_limit_zero_events.php | 1 + ...monolog_log_events_max_samples_stored_invalid1.php | 1 + ...monolog_log_events_max_samples_stored_invalid2.php | 1 + ...monolog_log_events_max_samples_stored_invalid3.php | 1 + ...monolog_log_events_max_samples_stored_invalid4.php | 1 + .../monolog3/test_monolog_log_level_filter.php | 1 + .../test_monolog_log_level_filter_invalid.php | 1 + .../monolog3/test_monolog_truncate_long_msgs.php | 1 + 93 files changed, 108 insertions(+), 4 deletions(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index 966546085..709bdee6d 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -76,8 +76,11 @@ void nr_fw_support_add_package_supportability_metric( } } - if ('\0' == major_version[0]) { + if ('\0' == major_version[0] && '\0' == package_version[0]) { return; + } else { + strncpy(major_version, package_version, 1); + major_version[1] = '\0'; } if (NR_FW_UNSET == NRINI(force_framework)) { diff --git a/agent/lib_guzzle6.c b/agent/lib_guzzle6.c index 5cea3936c..7d5666bc4 100644 --- a/agent/lib_guzzle6.c +++ b/agent/lib_guzzle6.c @@ -352,6 +352,9 @@ NR_PHP_WRAPPER_START(nr_guzzle6_client_construct) { if (NRINI(vulnerability_management_package_detection_enabled)) { char* version = nr_php_get_object_constant(this_var, "VERSION"); + if (NULL == version) { + version = nr_php_get_object_constant(this_var, "MAJOR_VERSION"); + } // Add php package to transaction nr_txn_add_php_package(NRPRG(txn), "guzzlehttp/guzzle", version); nr_fw_support_add_package_supportability_metric( diff --git a/agent/lib_monolog.c b/agent/lib_monolog.c index 2216e1a06..13c920c20 100644 --- a/agent/lib_monolog.c +++ b/agent/lib_monolog.c @@ -373,6 +373,10 @@ NR_PHP_WRAPPER(nr_monolog_logger_addrecord) { api = nr_monolog_version(this_var TSRMLS_CC); timestamp = nr_monolog_get_timestamp(api, argc, NR_EXECUTE_ORIG_ARGS TSRMLS_CC); + char version[5]; + snprintf(version, sizeof(version), "%d", api); + nr_fw_support_add_package_supportability_metric(NRPRG(txn), + "monolog/monolog", version); } /* Record the log event */ diff --git a/agent/php_agent.c b/agent/php_agent.c index 4d2fabf70..50d942b62 100644 --- a/agent/php_agent.c +++ b/agent/php_agent.c @@ -727,10 +727,15 @@ char* nr_php_get_object_constant(zval* app, const char* name) { if (nr_php_is_zval_valid_string(version)) { retval = nr_strndup(Z_STRVAL_P(version), Z_STRLEN_P(version)); + } else if (nr_php_is_zval_valid_integer(version)) { + zend_string* zstr = zend_long_to_str(Z_LVAL_P(version)); + retval = nr_strndup(ZSTR_VAL(zstr), ZSTR_LEN(zstr)); + zend_string_release(zstr); } else { - nrl_verbosedebug(NRL_FRAMEWORK, - "%s: expected VERSION be a valid string, got type %d", - __func__, Z_TYPE_P(version)); + nrl_verbosedebug( + NRL_FRAMEWORK, + "%s: expected VERSION to be a valid string or int, got type %d", + __func__, Z_TYPE_P(version)); } nr_php_zval_free(&version); diff --git a/tests/integration/external/guzzle7/test_cat.php b/tests/integration/external/guzzle7/test_cat.php index 48e5c3060..23686fa53 100644 --- a/tests/integration/external/guzzle7/test_cat.php +++ b/tests/integration/external/guzzle7/test_cat.php @@ -51,6 +51,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/7/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle7/test_dt.php b/tests/integration/external/guzzle7/test_dt.php index 613f9dd94..0b82d6efb 100644 --- a/tests/integration/external/guzzle7/test_dt.php +++ b/tests/integration/external/guzzle7/test_dt.php @@ -42,6 +42,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/7/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle7/test_dt_newrelic_header_disabled.php b/tests/integration/external/guzzle7/test_dt_newrelic_header_disabled.php index 28771bd59..6587c3e4c 100644 --- a/tests/integration/external/guzzle7/test_dt_newrelic_header_disabled.php +++ b/tests/integration/external/guzzle7/test_dt_newrelic_header_disabled.php @@ -43,6 +43,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/7/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle7/test_dt_synthetics.php b/tests/integration/external/guzzle7/test_dt_synthetics.php index 809a9298d..dd293905b 100644 --- a/tests/integration/external/guzzle7/test_dt_synthetics.php +++ b/tests/integration/external/guzzle7/test_dt_synthetics.php @@ -65,6 +65,7 @@ [{"name":"WebTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"WebTransactionTotalTime/Uri__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"HttpDispatcher"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/7/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]], [{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/external/guzzle7/test_no_cat_no_dt.php b/tests/integration/external/guzzle7/test_no_cat_no_dt.php index 383b2c0fb..ad1996e3a 100644 --- a/tests/integration/external/guzzle7/test_no_cat_no_dt.php +++ b/tests/integration/external/guzzle7/test_no_cat_no_dt.php @@ -42,6 +42,7 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name":"Supportability/PHP/package/guzzlehttp/guzzle/7/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_basic.php b/tests/integration/logging/monolog2/test_monolog_basic.php index 50003fb6e..b562bf15e 100644 --- a/tests/integration/logging/monolog2/test_monolog_basic.php +++ b/tests/integration/logging/monolog2/test_monolog_basic.php @@ -58,6 +58,7 @@ [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]] diff --git a/tests/integration/logging/monolog2/test_monolog_basic_clm.php b/tests/integration/logging/monolog2/test_monolog_basic_clm.php index 50f234e57..5ed62d3b3 100644 --- a/tests/integration/logging/monolog2/test_monolog_basic_clm.php +++ b/tests/integration/logging/monolog2/test_monolog_basic_clm.php @@ -45,6 +45,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_basic_clm_off.php b/tests/integration/logging/monolog2/test_monolog_basic_clm_off.php index c997317e7..3c656ac97 100644 --- a/tests/integration/logging/monolog2/test_monolog_basic_clm_off.php +++ b/tests/integration/logging/monolog2/test_monolog_basic_clm_off.php @@ -44,6 +44,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_cat.php b/tests/integration/logging/monolog2/test_monolog_cat.php index 97a61b77d..d96e38aec 100644 --- a/tests/integration/logging/monolog2/test_monolog_cat.php +++ b/tests/integration/logging/monolog2/test_monolog_cat.php @@ -56,6 +56,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_default.php b/tests/integration/logging/monolog2/test_monolog_context_default.php index 5fbc32cf0..859ce1ffe 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_default.php +++ b/tests/integration/logging/monolog2/test_monolog_context_default.php @@ -44,6 +44,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_exception.php b/tests/integration/logging/monolog2/test_monolog_context_exception.php index 16b62e5b4..c806bddc8 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_exception.php +++ b/tests/integration/logging/monolog2/test_monolog_context_exception.php @@ -46,6 +46,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_extra1.php b/tests/integration/logging/monolog2/test_monolog_context_filter_extra1.php index fb318cdc3..13875a0a6 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_extra1.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_extra1.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_extra2.php b/tests/integration/logging/monolog2/test_monolog_context_filter_extra2.php index 5867f935c..b55735e92 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_extra2.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_extra2.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_extra3.php b/tests/integration/logging/monolog2/test_monolog_context_filter_extra3.php index 92812d6bd..e90245135 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_extra3.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_extra3.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_extra4.php b/tests/integration/logging/monolog2/test_monolog_context_filter_extra4.php index 84c0fdfcc..dc232b6dc 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_extra4.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_extra4.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_extra5.php b/tests/integration/logging/monolog2/test_monolog_context_filter_extra5.php index e29b78368..1d3934a1d 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_extra5.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_extra5.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule1.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule1.php index bebe8489b..0cb138798 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule1.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule1.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule10.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule10.php index 3a817bb7e..eeff02ad8 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule10.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule10.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule11.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule11.php index 71e268443..854579344 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule11.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule11.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule2.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule2.php index 87f4f3968..2b7847f73 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule2.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule2.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule3.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule3.php index bb65ea6b7..864173103 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule3.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule3.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule4.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule4.php index 09f13b10c..3f2f01cdd 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule4.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule4.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule5.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule5.php index 252180a7b..ed6e512b5 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule5.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule5.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule6.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule6.php index 799336ee5..22ec5cebe 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule6.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule6.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule7.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule7.php index 55bc44caa..f9be37447 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule7.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule7.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule8.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule8.php index d63c67184..9e36e3bcb 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule8.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule8.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_filter_rule9.php b/tests/integration/logging/monolog2/test_monolog_context_filter_rule9.php index b1be23aec..ba6ba4cc7 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_filter_rule9.php +++ b/tests/integration/logging/monolog2/test_monolog_context_filter_rule9.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_limits_1.php b/tests/integration/logging/monolog2/test_monolog_context_limits_1.php index 72245794f..a01498ead 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_limits_1.php +++ b/tests/integration/logging/monolog2/test_monolog_context_limits_1.php @@ -45,6 +45,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_limits_2.php b/tests/integration/logging/monolog2/test_monolog_context_limits_2.php index 300365203..213b7379a 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_limits_2.php +++ b/tests/integration/logging/monolog2/test_monolog_context_limits_2.php @@ -45,6 +45,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_precedence_1.php b/tests/integration/logging/monolog2/test_monolog_context_precedence_1.php index 94b6b9069..6d571330c 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_precedence_1.php +++ b/tests/integration/logging/monolog2/test_monolog_context_precedence_1.php @@ -48,6 +48,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_precedence_2.php b/tests/integration/logging/monolog2/test_monolog_context_precedence_2.php index 1401e6571..7bf8b13ce 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_precedence_2.php +++ b/tests/integration/logging/monolog2/test_monolog_context_precedence_2.php @@ -48,6 +48,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_context_simple.php b/tests/integration/logging/monolog2/test_monolog_context_simple.php index f29ab92d8..769694845 100644 --- a/tests/integration/logging/monolog2/test_monolog_context_simple.php +++ b/tests/integration/logging/monolog2/test_monolog_context_simple.php @@ -59,6 +59,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_decoration_and_forwarding.php b/tests/integration/logging/monolog2/test_monolog_decoration_and_forwarding.php index 01ce34da8..1737a919c 100644 --- a/tests/integration/logging/monolog2/test_monolog_decoration_and_forwarding.php +++ b/tests/integration/logging/monolog2/test_monolog_decoration_and_forwarding.php @@ -113,6 +113,7 @@ [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/api/get_linking_metadata"}, [16, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_disable_metrics.php b/tests/integration/logging/monolog2/test_monolog_disable_metrics.php index 9f9682652..95b84d636 100644 --- a/tests/integration/logging/monolog2/test_monolog_disable_metrics.php +++ b/tests/integration/logging/monolog2/test_monolog_disable_metrics.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_drop_empty.php b/tests/integration/logging/monolog2/test_monolog_drop_empty.php index e9d236e77..8139e3606 100644 --- a/tests/integration/logging/monolog2/test_monolog_drop_empty.php +++ b/tests/integration/logging/monolog2/test_monolog_drop_empty.php @@ -57,6 +57,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_escape_chars.php b/tests/integration/logging/monolog2/test_monolog_escape_chars.php index 6018682f0..b95a67b1f 100644 --- a/tests/integration/logging/monolog2/test_monolog_escape_chars.php +++ b/tests/integration/logging/monolog2/test_monolog_escape_chars.php @@ -38,6 +38,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_large_message_limit.php b/tests/integration/logging/monolog2/test_monolog_large_message_limit.php index a6790497b..d7c9b677a 100644 --- a/tests/integration/logging/monolog2/test_monolog_large_message_limit.php +++ b/tests/integration/logging/monolog2/test_monolog_large_message_limit.php @@ -40,6 +40,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_large_message_limit_drops.php b/tests/integration/logging/monolog2/test_monolog_large_message_limit_drops.php index f21657f53..0dfe1dc2d 100644 --- a/tests/integration/logging/monolog2/test_monolog_large_message_limit_drops.php +++ b/tests/integration/logging/monolog2/test_monolog_large_message_limit_drops.php @@ -40,6 +40,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1666, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_limit_log_events.php b/tests/integration/logging/monolog2/test_monolog_limit_log_events.php index ea2104892..c9106b2ea 100644 --- a/tests/integration/logging/monolog2/test_monolog_limit_log_events.php +++ b/tests/integration/logging/monolog2/test_monolog_limit_log_events.php @@ -58,6 +58,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_limit_zero_events.php b/tests/integration/logging/monolog2/test_monolog_limit_zero_events.php index 0aa718275..6ff0fa7d1 100644 --- a/tests/integration/logging/monolog2/test_monolog_limit_zero_events.php +++ b/tests/integration/logging/monolog2/test_monolog_limit_zero_events.php @@ -58,6 +58,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid1.php b/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid1.php index 28a670681..f760b19ac 100644 --- a/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid1.php +++ b/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid1.php @@ -45,6 +45,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid2.php b/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid2.php index 0999ba3b0..ada730ed7 100644 --- a/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid2.php +++ b/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid2.php @@ -45,6 +45,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid3.php b/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid3.php index afb9e5bbb..cdd99bc5f 100644 --- a/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid3.php +++ b/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid3.php @@ -45,6 +45,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid4.php b/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid4.php index 8696024df..354108a09 100644 --- a/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid4.php +++ b/tests/integration/logging/monolog2/test_monolog_log_events_max_samples_stored_invalid4.php @@ -45,6 +45,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog2/test_monolog_log_level_filter.php b/tests/integration/logging/monolog2/test_monolog_log_level_filter.php index f24a2a62f..939dd9cf5 100644 --- a/tests/integration/logging/monolog2/test_monolog_log_level_filter.php +++ b/tests/integration/logging/monolog2/test_monolog_log_level_filter.php @@ -60,6 +60,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog2/test_monolog_log_level_filter_invalid.php b/tests/integration/logging/monolog2/test_monolog_log_level_filter_invalid.php index 6259670f0..d2eac9410 100644 --- a/tests/integration/logging/monolog2/test_monolog_log_level_filter_invalid.php +++ b/tests/integration/logging/monolog2/test_monolog_log_level_filter_invalid.php @@ -61,6 +61,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog2/test_monolog_truncate_long_msgs.php b/tests/integration/logging/monolog2/test_monolog_truncate_long_msgs.php index db912a727..4b8303eb1 100644 --- a/tests/integration/logging/monolog2/test_monolog_truncate_long_msgs.php +++ b/tests/integration/logging/monolog2/test_monolog_truncate_long_msgs.php @@ -43,6 +43,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/2/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_basic.php b/tests/integration/logging/monolog3/test_monolog_basic.php index 538d5c9c9..5cbc3a1da 100644 --- a/tests/integration/logging/monolog3/test_monolog_basic.php +++ b/tests/integration/logging/monolog3/test_monolog_basic.php @@ -56,6 +56,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_basic_clm.php b/tests/integration/logging/monolog3/test_monolog_basic_clm.php index 675f292bb..8fe6f3613 100644 --- a/tests/integration/logging/monolog3/test_monolog_basic_clm.php +++ b/tests/integration/logging/monolog3/test_monolog_basic_clm.php @@ -44,6 +44,7 @@ [{"name": "OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_basic_clm_off.php b/tests/integration/logging/monolog3/test_monolog_basic_clm_off.php index 2ca2e988c..e4ed19192 100644 --- a/tests/integration/logging/monolog3/test_monolog_basic_clm_off.php +++ b/tests/integration/logging/monolog3/test_monolog_basic_clm_off.php @@ -44,6 +44,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_cat.php b/tests/integration/logging/monolog3/test_monolog_cat.php index 1c68774d4..dcf557213 100644 --- a/tests/integration/logging/monolog3/test_monolog_cat.php +++ b/tests/integration/logging/monolog3/test_monolog_cat.php @@ -56,6 +56,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_default.php b/tests/integration/logging/monolog3/test_monolog_context_default.php index f5dde42ad..9080370e6 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_default.php +++ b/tests/integration/logging/monolog3/test_monolog_context_default.php @@ -44,6 +44,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_exception.php b/tests/integration/logging/monolog3/test_monolog_context_exception.php index 900b614cc..f64a6fc29 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_exception.php +++ b/tests/integration/logging/monolog3/test_monolog_context_exception.php @@ -46,6 +46,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_extra1.php b/tests/integration/logging/monolog3/test_monolog_context_filter_extra1.php index 443dc5248..7eed2a0b7 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_extra1.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_extra1.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_extra2.php b/tests/integration/logging/monolog3/test_monolog_context_filter_extra2.php index ce5d41251..7949d2f62 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_extra2.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_extra2.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_extra3.php b/tests/integration/logging/monolog3/test_monolog_context_filter_extra3.php index 3abd81c6a..c55dda857 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_extra3.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_extra3.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_extra4.php b/tests/integration/logging/monolog3/test_monolog_context_filter_extra4.php index 2d7dcac60..842d5f85b 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_extra4.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_extra4.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_extra5.php b/tests/integration/logging/monolog3/test_monolog_context_filter_extra5.php index 0496fa444..8eff9169e 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_extra5.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_extra5.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule1.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule1.php index 27297c832..f21b520c4 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule1.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule1.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule10.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule10.php index 6c5a0c94b..528764c59 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule10.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule10.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule11.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule11.php index eb3b8f4ad..ea0cedc02 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule11.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule11.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule2.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule2.php index 648d24aa3..febcd5f39 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule2.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule2.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule3.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule3.php index 3b3954a17..602226e89 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule3.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule3.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule4.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule4.php index 6e07994f6..ba03f7696 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule4.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule4.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule5.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule5.php index 446120f46..ad9337295 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule5.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule5.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule6.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule6.php index 5544883ff..60bd29813 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule6.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule6.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule7.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule7.php index d4c4f85a6..95f97c449 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule7.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule7.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule8.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule8.php index abf12928f..527c79a7e 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule8.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule8.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_filter_rule9.php b/tests/integration/logging/monolog3/test_monolog_context_filter_rule9.php index 61c8f1a0c..98fc8b5e2 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_filter_rule9.php +++ b/tests/integration/logging/monolog3/test_monolog_context_filter_rule9.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_limits_1.php b/tests/integration/logging/monolog3/test_monolog_context_limits_1.php index 0eb98376f..9d5836311 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_limits_1.php +++ b/tests/integration/logging/monolog3/test_monolog_context_limits_1.php @@ -45,6 +45,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_limits_2.php b/tests/integration/logging/monolog3/test_monolog_context_limits_2.php index 6efed9ff5..6925fc905 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_limits_2.php +++ b/tests/integration/logging/monolog3/test_monolog_context_limits_2.php @@ -45,6 +45,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_precedence_1.php b/tests/integration/logging/monolog3/test_monolog_context_precedence_1.php index 6c66317b6..301164d11 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_precedence_1.php +++ b/tests/integration/logging/monolog3/test_monolog_context_precedence_1.php @@ -48,6 +48,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_precedence_2.php b/tests/integration/logging/monolog3/test_monolog_context_precedence_2.php index 451e5f49b..b05977c22 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_precedence_2.php +++ b/tests/integration/logging/monolog3/test_monolog_context_precedence_2.php @@ -48,6 +48,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_context_simple.php b/tests/integration/logging/monolog3/test_monolog_context_simple.php index 3c6fd51ef..1e77e6d25 100644 --- a/tests/integration/logging/monolog3/test_monolog_context_simple.php +++ b/tests/integration/logging/monolog3/test_monolog_context_simple.php @@ -59,6 +59,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_decoration_and_forwarding.php b/tests/integration/logging/monolog3/test_monolog_decoration_and_forwarding.php index 20b201daa..fa0bbb6cb 100644 --- a/tests/integration/logging/monolog3/test_monolog_decoration_and_forwarding.php +++ b/tests/integration/logging/monolog3/test_monolog_decoration_and_forwarding.php @@ -113,6 +113,7 @@ [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/api/get_linking_metadata"}, [16, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_disable_metrics.php b/tests/integration/logging/monolog3/test_monolog_disable_metrics.php index 90e6767fb..cb5beb8e1 100644 --- a/tests/integration/logging/monolog3/test_monolog_disable_metrics.php +++ b/tests/integration/logging/monolog3/test_monolog_disable_metrics.php @@ -51,6 +51,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_drop_empty.php b/tests/integration/logging/monolog3/test_monolog_drop_empty.php index 4cee51f79..61937fb9f 100644 --- a/tests/integration/logging/monolog3/test_monolog_drop_empty.php +++ b/tests/integration/logging/monolog3/test_monolog_drop_empty.php @@ -57,6 +57,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_escape_chars.php b/tests/integration/logging/monolog3/test_monolog_escape_chars.php index c7978a7a2..a1c768efd 100644 --- a/tests/integration/logging/monolog3/test_monolog_escape_chars.php +++ b/tests/integration/logging/monolog3/test_monolog_escape_chars.php @@ -38,6 +38,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_large_message_limit.php b/tests/integration/logging/monolog3/test_monolog_large_message_limit.php index 1e25b451f..191800f49 100644 --- a/tests/integration/logging/monolog3/test_monolog_large_message_limit.php +++ b/tests/integration/logging/monolog3/test_monolog_large_message_limit.php @@ -40,6 +40,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_large_message_limit_drops.php b/tests/integration/logging/monolog3/test_monolog_large_message_limit_drops.php index 66de51989..eed9a410a 100644 --- a/tests/integration/logging/monolog3/test_monolog_large_message_limit_drops.php +++ b/tests/integration/logging/monolog3/test_monolog_large_message_limit_drops.php @@ -40,6 +40,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1666, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_limit_log_events.php b/tests/integration/logging/monolog3/test_monolog_limit_log_events.php index 69bdb618c..b1f72e6b6 100644 --- a/tests/integration/logging/monolog3/test_monolog_limit_log_events.php +++ b/tests/integration/logging/monolog3/test_monolog_limit_log_events.php @@ -58,6 +58,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_limit_zero_events.php b/tests/integration/logging/monolog3/test_monolog_limit_zero_events.php index a9dd71587..38abfe890 100644 --- a/tests/integration/logging/monolog3/test_monolog_limit_zero_events.php +++ b/tests/integration/logging/monolog3/test_monolog_limit_zero_events.php @@ -58,6 +58,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], diff --git a/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid1.php b/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid1.php index 7b5892cc0..f33d832af 100644 --- a/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid1.php +++ b/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid1.php @@ -45,6 +45,7 @@ [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid2.php b/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid2.php index 644512bc2..73c70e58e 100644 --- a/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid2.php +++ b/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid2.php @@ -45,6 +45,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid3.php b/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid3.php index d64021bad..72ca4b06b 100644 --- a/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid3.php +++ b/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid3.php @@ -45,6 +45,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid4.php b/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid4.php index 7879dba27..2f60d6bc1 100644 --- a/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid4.php +++ b/tests/integration/logging/monolog3/test_monolog_log_events_max_samples_stored_invalid4.php @@ -45,6 +45,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [833, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog3/test_monolog_log_level_filter.php b/tests/integration/logging/monolog3/test_monolog_log_level_filter.php index 14a0a0c95..529ef1459 100644 --- a/tests/integration/logging/monolog3/test_monolog_log_level_filter.php +++ b/tests/integration/logging/monolog3/test_monolog_log_level_filter.php @@ -60,6 +60,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog3/test_monolog_log_level_filter_invalid.php b/tests/integration/logging/monolog3/test_monolog_log_level_filter_invalid.php index 5659971f3..e5387616f 100644 --- a/tests/integration/logging/monolog3/test_monolog_log_level_filter_invalid.php +++ b/tests/integration/logging/monolog3/test_monolog_log_level_filter_invalid.php @@ -61,6 +61,7 @@ [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [8, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]] ] ] diff --git a/tests/integration/logging/monolog3/test_monolog_truncate_long_msgs.php b/tests/integration/logging/monolog3/test_monolog_truncate_long_msgs.php index ac7e15bcf..4c99e09ba 100644 --- a/tests/integration/logging/monolog3/test_monolog_truncate_long_msgs.php +++ b/tests/integration/logging/monolog3/test_monolog_truncate_long_msgs.php @@ -43,6 +43,7 @@ [{"name": "OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name": "OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/PHP/Monolog/enabled"}, [1, "??", "??", "??", "??", "??"]], + [{"name": "Supportability/PHP/package/monolog/monolog/3/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/library/Monolog/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/LocalDecorating/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name": "Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], From 1fb5879e914e31768f86c12a0ce99907a70f65a2 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Fri, 29 Mar 2024 13:57:18 -0700 Subject: [PATCH 11/21] chore(agent): add macro to remove duplication --- agent/fw_drupal8.c | 8 +++++--- agent/fw_laravel.c | 6 ++++-- agent/fw_slim.c | 6 ++++-- agent/fw_wordpress.c | 7 ++++--- agent/lib_guzzle6.c | 6 ++++-- agent/lib_monolog.c | 6 ++++-- agent/lib_predis.c | 8 +++++--- 7 files changed, 30 insertions(+), 17 deletions(-) diff --git a/agent/fw_drupal8.c b/agent/fw_drupal8.c index 3dd3678c5..17ecb2bfe 100644 --- a/agent/fw_drupal8.c +++ b/agent/fw_drupal8.c @@ -18,6 +18,8 @@ #include "util_memory.h" #include "util_strings.h" +#define PHP_PACKAGE_NAME "drupal/core" + /* * Purpose : Convenience function to handle adding a callback to a method, * given a class entry and a method name. This will check the @@ -684,8 +686,8 @@ void nr_drupal_version() { // Add php package to transaction if (nr_php_is_zval_valid_string(zval_version)) { char* version = Z_STRVAL_P(zval_version); - nr_txn_add_php_package(NRPRG(txn), "drupal/core", version); - nr_fw_support_add_package_supportability_metric(NRPRG(txn), "drupal/core", + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, version); } @@ -755,7 +757,7 @@ void nr_drupal8_enable(TSRMLS_D) { } if (NRINI(vulnerability_management_package_detection_enabled)) { - nr_txn_add_php_package(NRPRG(txn), "drupal/core", + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, PHP_PACKAGE_VERSION_UNKNOWN); } } diff --git a/agent/fw_laravel.c b/agent/fw_laravel.c index 0a2f0923c..f2127f90f 100644 --- a/agent/fw_laravel.c +++ b/agent/fw_laravel.c @@ -24,6 +24,8 @@ #include "ext/standard/php_versioning.h" #include "Zend/zend_exceptions.h" +#define PHP_PACKAGE_NAME "laravel/framework" + /* * This instruments Laravel 4.0-5.0, inclusive. * There is no support for Laravel 3.X or earlier. @@ -959,9 +961,9 @@ NR_PHP_WRAPPER(nr_laravel_application_construct) { if (NRINI(vulnerability_management_package_detection_enabled)) { // Add php package to transaction - nr_txn_add_php_package(NRPRG(txn), "laravel/framework", version); + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); nr_fw_support_add_package_supportability_metric( - NRPRG(txn), "laravel/framework", version); + NRPRG(txn), PHP_PACKAGE_NAME, version); } if (version) { diff --git a/agent/fw_slim.c b/agent/fw_slim.c index 863e3f147..c576b8e0b 100644 --- a/agent/fw_slim.c +++ b/agent/fw_slim.c @@ -12,6 +12,8 @@ #include "fw_support.h" #include "util_logging.h" +#define PHP_PACKAGE_NAME "slim/slim" + static char* nr_slim_path_from_route(zval* route TSRMLS_DC) { zval* name = NULL; zval* pattern = NULL; @@ -120,9 +122,9 @@ NR_PHP_WRAPPER(nr_slim_application_construct) { version = nr_php_get_object_constant(this_var, "VERSION"); // Add php package to transaction - nr_txn_add_php_package(NRPRG(txn), "slim/slim", version); + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); - nr_fw_support_add_package_supportability_metric(NRPRG(txn), "slim/slim", + nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, version); nr_free(version); diff --git a/agent/fw_wordpress.c b/agent/fw_wordpress.c index e2a10ef57..241ec5c77 100644 --- a/agent/fw_wordpress.c +++ b/agent/fw_wordpress.c @@ -21,6 +21,7 @@ #define NR_WORDPRESS_HOOK_PREFIX "Framework/WordPress/Hook/" #define NR_WORDPRESS_PLUGIN_PREFIX "Framework/WordPress/Plugin/" +#define PHP_PACKAGE_NAME "wordpress" static nr_regex_t* wordpress_hook_regex; @@ -809,8 +810,8 @@ void nr_wordpress_version() { if (SUCCESS == result) { if (nr_php_is_zval_valid_string(&retval)) { char* version = Z_STRVAL(retval); - nr_txn_add_php_package(NRPRG(txn), "wordpress", version); - nr_fw_support_add_package_supportability_metric(NRPRG(txn), "wordpress", + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, version); } zval_dtor(&retval); @@ -867,7 +868,7 @@ void nr_wordpress_enable(TSRMLS_D) { #endif /* OAPI */ if (NRINI(vulnerability_management_package_detection_enabled)) { - nr_txn_add_php_package(NRPRG(txn), "wordpress", + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, PHP_PACKAGE_VERSION_UNKNOWN); } } diff --git a/agent/lib_guzzle6.c b/agent/lib_guzzle6.c index 7d5666bc4..95ee39d48 100644 --- a/agent/lib_guzzle6.c +++ b/agent/lib_guzzle6.c @@ -58,6 +58,8 @@ #include "ext/standard/php_var.h" +#define PHP_PACKAGE_NAME "guzzlehttp/guzzle" + /* * Since Guzzle 6 requires PHP 5.5.0 or later, we just won't build the Guzzle 6 * support on older versions and will instead provide simple stubs for the two @@ -356,9 +358,9 @@ NR_PHP_WRAPPER_START(nr_guzzle6_client_construct) { version = nr_php_get_object_constant(this_var, "MAJOR_VERSION"); } // Add php package to transaction - nr_txn_add_php_package(NRPRG(txn), "guzzlehttp/guzzle", version); + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); nr_fw_support_add_package_supportability_metric( - NRPRG(txn), "guzzlehttp/guzzle", version); + NRPRG(txn), PHP_PACKAGE_NAME, version); nr_free(version); } diff --git a/agent/lib_monolog.c b/agent/lib_monolog.c index 13c920c20..8b527cf3e 100644 --- a/agent/lib_monolog.c +++ b/agent/lib_monolog.c @@ -30,6 +30,8 @@ #define LOG_DECORATE_PROC_FUNC_NAME \ "newrelic_phpagent_monolog_decorating_processor" +#define PHP_PACKAGE_NAME "monolog/monolog" + /* * Purpose : Convert Monolog\Logger::API to integer * @@ -376,7 +378,7 @@ NR_PHP_WRAPPER(nr_monolog_logger_addrecord) { char version[5]; snprintf(version, sizeof(version), "%d", api); nr_fw_support_add_package_supportability_metric(NRPRG(txn), - "monolog/monolog", version); + PHP_PACKAGE_NAME, version); } /* Record the log event */ @@ -517,7 +519,7 @@ void nr_monolog_enable(TSRMLS_D) { nr_monolog_logger_addrecord TSRMLS_CC); if (NRINI(vulnerability_management_package_detection_enabled)) { - nr_txn_add_php_package(NRPRG(txn), "monolog/monolog", + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, PHP_PACKAGE_VERSION_UNKNOWN); } } diff --git a/agent/lib_predis.c b/agent/lib_predis.c index 54e33e6fd..a2fc55f67 100644 --- a/agent/lib_predis.c +++ b/agent/lib_predis.c @@ -19,6 +19,8 @@ #include "util_strings.h" #include "lib_predis_private.h" +#define PHP_PACKAGE_NAME "predis/predis" + /* * Predis instrumentation * ====================== @@ -649,9 +651,9 @@ NR_PHP_WRAPPER(nr_predis_client_construct) { if (NRINI(vulnerability_management_package_detection_enabled)) { char* version = nr_php_get_object_constant(scope, "VERSION"); // Add php package to transaction - nr_txn_add_php_package(NRPRG(txn), "predis/predis", version); - nr_fw_support_add_package_supportability_metric( - NRPRG(txn), "predis/predis", version); + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + nr_fw_support_add_package_supportability_metric(NRPRG(txn), + PHP_PACKAGE_NAME, version); nr_free(version); } From e94e897c4dab55acc26654e66e6acc883082205e Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Fri, 29 Mar 2024 14:07:57 -0700 Subject: [PATCH 12/21] chore(agent): fix error --- agent/fw_support.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index 709bdee6d..ea4bda243 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -76,9 +76,7 @@ void nr_fw_support_add_package_supportability_metric( } } - if ('\0' == major_version[0] && '\0' == package_version[0]) { - return; - } else { + if ('\0' == major_version[0] && '\0' != package_version[0]) { strncpy(major_version, package_version, 1); major_version[1] = '\0'; } From 4b612579ea2e1dfc9bb1e5a588cb8713e982e1c9 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Mon, 8 Apr 2024 14:55:34 -0700 Subject: [PATCH 13/21] chore(agent): simplify how we look for major version --- agent/fw_support.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index ea4bda243..175b67ff9 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -70,15 +70,9 @@ void nr_fw_support_add_package_supportability_metric( */ for (int i = 0; package_version[i] && i < 4; i++) { if ('.' == package_version[i]) { - strncpy(major_version, package_version, i); - major_version[i] = '\0'; break; } - } - - if ('\0' == major_version[0] && '\0' != package_version[0]) { - strncpy(major_version, package_version, 1); - major_version[1] = '\0'; + major_version[i] = package_version[i]; } if (NR_FW_UNSET == NRINI(force_framework)) { From c8f52a4e074994c11b02109aa755bafdf672d4e2 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Tue, 9 Apr 2024 13:29:43 -0700 Subject: [PATCH 14/21] chore(agent): add unit tests for package detection supportability metric --- agent/tests/test_fw_support.c | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/agent/tests/test_fw_support.c b/agent/tests/test_fw_support.c index 907330ee9..fdd5d0364 100644 --- a/agent/tests/test_fw_support.c +++ b/agent/tests/test_fw_support.c @@ -13,8 +13,15 @@ tlib_parallel_info_t parallel_info static void test_fw_supportability_metrics(void) { #define LIBRARY_NAME "php-package" +#define LIBRARY_MAJOR_VERSION "7" +#define LIBRARY_MAJOR_VERSION_2 "10" +#define LIBRARY_MAJOR_VERSION_3 "100" +#define LIBRARY_MAJOR_VERSION_4 "1.23" +#define LIBRARY_MAJOR_VERSION_5 "12.34" +#define LIBRARY_MAJOR_VERSION_6 "123.45" #define LIBRARY_METRIC "Supportability/library/" LIBRARY_NAME "/detected" #define LOGGING_LIBRARY_METRIC "Supportability/Logging/PHP/" LIBRARY_NAME +#define PACKAGE_METRIC "Supportability/PHP/package/" LIBRARY_NAME nrtxn_t t; nrtxn_t* txn = &t; txn->unscoped_metrics = nrm_table_create(10); @@ -36,6 +43,18 @@ static void test_fw_supportability_metrics(void) { tlib_pass_if_int_equal("NULL logging library metric not created", 0, nrm_table_size(txn->unscoped_metrics)); + nr_fw_support_add_package_supportability_metric(NULL, LIBRARY_NAME, LIBRARY_MAJOR_VERSION); + tlib_pass_if_int_equal("package metric not created in NULL metrics", + 0, nrm_table_size(txn->unscoped_metrics)); + + nr_fw_support_add_package_supportability_metric(txn, NULL, LIBRARY_MAJOR_VERSION); + tlib_pass_if_int_equal("NULL package name, metric not created", 0, + nrm_table_size(txn->unscoped_metrics)); + + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, NULL); + tlib_pass_if_int_equal("NULL major version, metric not created", 0, + nrm_table_size(txn->unscoped_metrics)); + /* Happy path */ nr_fw_support_add_library_supportability_metric(txn, LIBRARY_NAME); tlib_pass_if_not_null("happy path: library metric created", @@ -51,6 +70,42 @@ static void test_fw_supportability_metrics(void) { "happy path: logging library metric created", nrm_find(txn->unscoped_metrics, LOGGING_LIBRARY_METRIC "/disabled")); + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, + LIBRARY_MAJOR_VERSION); + tlib_pass_if_not_null("happy path test 1: package metric created", + nrm_find(txn->unscoped_metrics, PACKAGE_METRIC + "/" LIBRARY_MAJOR_VERSION "/detected")); + + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, + LIBRARY_MAJOR_VERSION_2); + tlib_pass_if_not_null("happy path test 2: package metric created", + nrm_find(txn->unscoped_metrics, PACKAGE_METRIC + "/" LIBRARY_MAJOR_VERSION_2 "/detected")); + + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, + LIBRARY_MAJOR_VERSION_3); + tlib_pass_if_not_null("happy path test 3: package metric created", + nrm_find(txn->unscoped_metrics, PACKAGE_METRIC + "/" LIBRARY_MAJOR_VERSION_3 "/detected")); + + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, + LIBRARY_MAJOR_VERSION_4); + tlib_pass_if_not_null( + "happy path test 4: package metric created", + nrm_find(txn->unscoped_metrics, PACKAGE_METRIC "/1/detected")); + + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, + LIBRARY_MAJOR_VERSION_5); + tlib_pass_if_not_null( + "happy path test 5: package metric created", + nrm_find(txn->unscoped_metrics, PACKAGE_METRIC "/12/detected")); + + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, + LIBRARY_MAJOR_VERSION_6); + tlib_pass_if_not_null( + "happy path test 6: package metric created", + nrm_find(txn->unscoped_metrics, PACKAGE_METRIC "/123/detected")); + nrm_table_destroy(&txn->unscoped_metrics); } From 423192259b130248b2fd1fa8310565521d10aa73 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Tue, 9 Apr 2024 14:08:47 -0700 Subject: [PATCH 15/21] chore(agent): increase size to account for null terminator --- agent/fw_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index 175b67ff9..f04ac3c00 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -62,7 +62,7 @@ void nr_fw_support_add_package_supportability_metric( } char* metname = NULL; - char major_version[4] = {0}; + char major_version[5] = {0}; /* The below for loop checks if the major version of the package is more than * one digit and keeps looping until a '.' is encountered or one of the From 5eedee9e66fc0d7d303c1a0d875ef133db5d88fc Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Tue, 9 Apr 2024 14:28:14 -0700 Subject: [PATCH 16/21] chore(agent): change where version is defined --- agent/tests/test_fw_support.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/tests/test_fw_support.c b/agent/tests/test_fw_support.c index fdd5d0364..8e95c761c 100644 --- a/agent/tests/test_fw_support.c +++ b/agent/tests/test_fw_support.c @@ -16,9 +16,6 @@ static void test_fw_supportability_metrics(void) { #define LIBRARY_MAJOR_VERSION "7" #define LIBRARY_MAJOR_VERSION_2 "10" #define LIBRARY_MAJOR_VERSION_3 "100" -#define LIBRARY_MAJOR_VERSION_4 "1.23" -#define LIBRARY_MAJOR_VERSION_5 "12.34" -#define LIBRARY_MAJOR_VERSION_6 "123.45" #define LIBRARY_METRIC "Supportability/library/" LIBRARY_NAME "/detected" #define LOGGING_LIBRARY_METRIC "Supportability/Logging/PHP/" LIBRARY_NAME #define PACKAGE_METRIC "Supportability/PHP/package/" LIBRARY_NAME @@ -88,6 +85,10 @@ static void test_fw_supportability_metrics(void) { nrm_find(txn->unscoped_metrics, PACKAGE_METRIC "/" LIBRARY_MAJOR_VERSION_3 "/detected")); + #define LIBRARY_MAJOR_VERSION_4 "1.23" + #define LIBRARY_MAJOR_VERSION_5 "12.34" + #define LIBRARY_MAJOR_VERSION_6 "123.45" + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, LIBRARY_MAJOR_VERSION_4); tlib_pass_if_not_null( From 15c042217757b9b32ed03c49832bb86624d04a64 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Tue, 9 Apr 2024 15:08:25 -0700 Subject: [PATCH 17/21] chore(agent): define version at the top --- agent/tests/test_fw_support.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/agent/tests/test_fw_support.c b/agent/tests/test_fw_support.c index 8e95c761c..fdd5d0364 100644 --- a/agent/tests/test_fw_support.c +++ b/agent/tests/test_fw_support.c @@ -16,6 +16,9 @@ static void test_fw_supportability_metrics(void) { #define LIBRARY_MAJOR_VERSION "7" #define LIBRARY_MAJOR_VERSION_2 "10" #define LIBRARY_MAJOR_VERSION_3 "100" +#define LIBRARY_MAJOR_VERSION_4 "1.23" +#define LIBRARY_MAJOR_VERSION_5 "12.34" +#define LIBRARY_MAJOR_VERSION_6 "123.45" #define LIBRARY_METRIC "Supportability/library/" LIBRARY_NAME "/detected" #define LOGGING_LIBRARY_METRIC "Supportability/Logging/PHP/" LIBRARY_NAME #define PACKAGE_METRIC "Supportability/PHP/package/" LIBRARY_NAME @@ -85,10 +88,6 @@ static void test_fw_supportability_metrics(void) { nrm_find(txn->unscoped_metrics, PACKAGE_METRIC "/" LIBRARY_MAJOR_VERSION_3 "/detected")); - #define LIBRARY_MAJOR_VERSION_4 "1.23" - #define LIBRARY_MAJOR_VERSION_5 "12.34" - #define LIBRARY_MAJOR_VERSION_6 "123.45" - nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, LIBRARY_MAJOR_VERSION_4); tlib_pass_if_not_null( From 97c639e0e64aeb8e5e4a6d4db7c25de4aa928c0e Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Tue, 9 Apr 2024 17:44:06 -0700 Subject: [PATCH 18/21] chore(agent): add additional tests --- agent/tests/test_fw_support.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/agent/tests/test_fw_support.c b/agent/tests/test_fw_support.c index fdd5d0364..c8b8e021d 100644 --- a/agent/tests/test_fw_support.c +++ b/agent/tests/test_fw_support.c @@ -19,6 +19,7 @@ static void test_fw_supportability_metrics(void) { #define LIBRARY_MAJOR_VERSION_4 "1.23" #define LIBRARY_MAJOR_VERSION_5 "12.34" #define LIBRARY_MAJOR_VERSION_6 "123.45" +#define LIBRARY_MAJOR_VERSION_7 "0.4.5" #define LIBRARY_METRIC "Supportability/library/" LIBRARY_NAME "/detected" #define LOGGING_LIBRARY_METRIC "Supportability/Logging/PHP/" LIBRARY_NAME #define PACKAGE_METRIC "Supportability/PHP/package/" LIBRARY_NAME @@ -106,6 +107,19 @@ static void test_fw_supportability_metrics(void) { "happy path test 6: package metric created", nrm_find(txn->unscoped_metrics, PACKAGE_METRIC "/123/detected")); + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, + LIBRARY_MAJOR_VERSION_7); + tlib_pass_if_not_null( + "happy path test 7: package metric created", + nrm_find(txn->unscoped_metrics, PACKAGE_METRIC "/0/detected")); + + NRINI(force_framework) = true; + nr_fw_support_add_package_supportability_metric(txn, LIBRARY_NAME, + LIBRARY_MAJOR_VERSION); + tlib_pass_if_not_null( + "happy path test 8: package metric created", + nrm_find(txn->unscoped_metrics, PACKAGE_METRIC "/7/forced")); + nrm_table_destroy(&txn->unscoped_metrics); } From 647d424ffb824368d14f803f6812df43a75be043 Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Wed, 10 Apr 2024 12:55:24 -0700 Subject: [PATCH 19/21] chore(agent): add supportability metric even when VM is disabled --- agent/fw_drupal8.c | 4 +++- agent/fw_laravel.c | 4 ++-- agent/fw_slim.c | 20 ++++++++++---------- agent/fw_wordpress.c | 4 +++- agent/lib_guzzle6.c | 15 ++++++++------- agent/lib_predis.c | 9 +++++---- 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/agent/fw_drupal8.c b/agent/fw_drupal8.c index 17ecb2bfe..6593e17a8 100644 --- a/agent/fw_drupal8.c +++ b/agent/fw_drupal8.c @@ -686,7 +686,9 @@ void nr_drupal_version() { // Add php package to transaction if (nr_php_is_zval_valid_string(zval_version)) { char* version = Z_STRVAL_P(zval_version); - nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + if (NRINI(vulnerability_management_package_detection_enabled)) { + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + } nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, version); } diff --git a/agent/fw_laravel.c b/agent/fw_laravel.c index f2127f90f..11718a7e6 100644 --- a/agent/fw_laravel.c +++ b/agent/fw_laravel.c @@ -962,9 +962,9 @@ NR_PHP_WRAPPER(nr_laravel_application_construct) { if (NRINI(vulnerability_management_package_detection_enabled)) { // Add php package to transaction nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); - nr_fw_support_add_package_supportability_metric( - NRPRG(txn), PHP_PACKAGE_NAME, version); } + nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, + version); if (version) { nrl_debug(NRL_FRAMEWORK, "Laravel version is " NRP_FMT, NRP_PHP(version)); diff --git a/agent/fw_slim.c b/agent/fw_slim.c index c576b8e0b..493e325a8 100644 --- a/agent/fw_slim.c +++ b/agent/fw_slim.c @@ -121,8 +121,10 @@ NR_PHP_WRAPPER(nr_slim_application_construct) { version = nr_php_get_object_constant(this_var, "VERSION"); - // Add php package to transaction - nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + if (NRINI(vulnerability_management_package_detection_enabled)) { + // Add php package to transaction + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + } nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, version); @@ -144,13 +146,11 @@ void nr_slim_enable(TSRMLS_D) { nr_php_wrap_user_function(NR_PSTR("Slim\\Routing\\Route::run"), nr_slim3_4_route_run TSRMLS_CC); - if (NRINI(vulnerability_management_package_detection_enabled)) { - /* Slim 2 does not have the same path as Slim 3/4 which is why - we need to separate these*/ - nr_php_wrap_user_function(NR_PSTR("Slim\\Slim::__construct"), - nr_slim_application_construct); + /* Slim 2 does not have the same path as Slim 3/4 which is why + we need to separate these*/ + nr_php_wrap_user_function(NR_PSTR("Slim\\Slim::__construct"), + nr_slim_application_construct); - nr_php_wrap_user_function(NR_PSTR("Slim\\App::__construct"), - nr_slim_application_construct); - } + nr_php_wrap_user_function(NR_PSTR("Slim\\App::__construct"), + nr_slim_application_construct); } diff --git a/agent/fw_wordpress.c b/agent/fw_wordpress.c index 241ec5c77..55a0be5f0 100644 --- a/agent/fw_wordpress.c +++ b/agent/fw_wordpress.c @@ -810,7 +810,9 @@ void nr_wordpress_version() { if (SUCCESS == result) { if (nr_php_is_zval_valid_string(&retval)) { char* version = Z_STRVAL(retval); - nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + if (NRINI(vulnerability_management_package_detection_enabled)) { + nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); + } nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, version); } diff --git a/agent/lib_guzzle6.c b/agent/lib_guzzle6.c index 95ee39d48..9038c2aaf 100644 --- a/agent/lib_guzzle6.c +++ b/agent/lib_guzzle6.c @@ -352,17 +352,18 @@ NR_PHP_WRAPPER_START(nr_guzzle6_client_construct) { zval* retval; zval* this_var = nr_php_scope_get(NR_EXECUTE_ORIG_ARGS); + char* version = nr_php_get_object_constant(this_var, "VERSION"); + if (NULL == version) { + version = nr_php_get_object_constant(this_var, "MAJOR_VERSION"); + } + if (NRINI(vulnerability_management_package_detection_enabled)) { - char* version = nr_php_get_object_constant(this_var, "VERSION"); - if (NULL == version) { - version = nr_php_get_object_constant(this_var, "MAJOR_VERSION"); - } // Add php package to transaction nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); - nr_fw_support_add_package_supportability_metric( - NRPRG(txn), PHP_PACKAGE_NAME, version); - nr_free(version); } + nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, + version); + nr_free(version); (void)wraprec; NR_UNUSED_SPECIALFN; diff --git a/agent/lib_predis.c b/agent/lib_predis.c index a2fc55f67..862649d3b 100644 --- a/agent/lib_predis.c +++ b/agent/lib_predis.c @@ -648,14 +648,15 @@ NR_PHP_WRAPPER(nr_predis_client_construct) { (void)wraprec; NR_PHP_WRAPPER_CALL; + + char* version = nr_php_get_object_constant(scope, "VERSION"); if (NRINI(vulnerability_management_package_detection_enabled)) { - char* version = nr_php_get_object_constant(scope, "VERSION"); // Add php package to transaction nr_txn_add_php_package(NRPRG(txn), PHP_PACKAGE_NAME, version); - nr_fw_support_add_package_supportability_metric(NRPRG(txn), - PHP_PACKAGE_NAME, version); - nr_free(version); } + nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, + version); + nr_free(version); /* * Grab the connection object from the client, since we actually instrument From 0fc0bdeb3bec8a23967331df67f90f9528bae8da Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Wed, 10 Apr 2024 13:59:57 -0700 Subject: [PATCH 20/21] chore(agent): update description --- axiom/nr_txn.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/axiom/nr_txn.h b/axiom/nr_txn.h index 01f085624..dc2cf014b 100644 --- a/axiom/nr_txn.h +++ b/axiom/nr_txn.h @@ -1161,7 +1161,8 @@ static inline nr_segment_t* nr_txn_allocate_segment(nrtxn_t* txn) { } /* - * Purpose : Add php packages to transaction + * Purpose : Add php packages to transaction. This function should only be + * called when Vulnerability Management is enabled. * * Params : 1. The transaction * 2. Package name From 55c1e1e6acc9b80e1a8a76e0406394b107e37ace Mon Sep 17 00:00:00 2001 From: Hitesh Ahuja Date: Mon, 15 Apr 2024 14:31:45 -0700 Subject: [PATCH 21/21] chore(agent): define major version length --- agent/fw_support.c | 6 ++++-- agent/lib_monolog.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/agent/fw_support.c b/agent/fw_support.c index f04ac3c00..daff2692c 100644 --- a/agent/fw_support.c +++ b/agent/fw_support.c @@ -11,6 +11,8 @@ #include "util_memory.h" #include "util_strings.h" +#define MAJOR_VERSION_LENGTH 8 + void nr_php_framework_add_supportability_metric(const char* framework_name, const char* name TSRMLS_DC) { char buf[512]; @@ -62,13 +64,13 @@ void nr_fw_support_add_package_supportability_metric( } char* metname = NULL; - char major_version[5] = {0}; + char major_version[MAJOR_VERSION_LENGTH] = {0}; /* The below for loop checks if the major version of the package is more than * one digit and keeps looping until a '.' is encountered or one of the * conditions is met. */ - for (int i = 0; package_version[i] && i < 4; i++) { + for (int i = 0; package_version[i] && i < MAJOR_VERSION_LENGTH - 1; i++) { if ('.' == package_version[i]) { break; } diff --git a/agent/lib_monolog.c b/agent/lib_monolog.c index 8b527cf3e..667e33583 100644 --- a/agent/lib_monolog.c +++ b/agent/lib_monolog.c @@ -31,6 +31,7 @@ "newrelic_phpagent_monolog_decorating_processor" #define PHP_PACKAGE_NAME "monolog/monolog" +#define MAJOR_VERSION_LENGTH 8 /* * Purpose : Convert Monolog\Logger::API to integer @@ -375,7 +376,7 @@ NR_PHP_WRAPPER(nr_monolog_logger_addrecord) { api = nr_monolog_version(this_var TSRMLS_CC); timestamp = nr_monolog_get_timestamp(api, argc, NR_EXECUTE_ORIG_ARGS TSRMLS_CC); - char version[5]; + char version[MAJOR_VERSION_LENGTH]; snprintf(version, sizeof(version), "%d", api); nr_fw_support_add_package_supportability_metric(NRPRG(txn), PHP_PACKAGE_NAME, version);