From 3b4ab82d7a85ded9ab6cf1527cf2984fd0c48790 Mon Sep 17 00:00:00 2001 From: Michal Nowacki Date: Thu, 17 Aug 2023 11:30:18 -0400 Subject: [PATCH 1/4] improve guzzle detection --- agent/php_execute.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/agent/php_execute.c b/agent/php_execute.c index 5dee4712d..a6bb53ed5 100644 --- a/agent/php_execute.c +++ b/agent/php_execute.c @@ -476,12 +476,8 @@ typedef struct _nr_library_table_t { static nr_library_table_t libraries[] = { {"Doctrine 2", "doctrine/orm/query.php", nr_doctrine2_enable}, {"Guzzle 3", "guzzle/http/client.php", nr_guzzle3_enable}, - /* - * NOTE: This file ClientInterface.php also exists in Guzzle 3 and 6. - * This file also exists in Predis. - */ - {"Guzzle 4-5", "clientinterface.php", nr_guzzle4_enable}, - {"Guzzle 6", "handlerstack.php", nr_guzzle6_enable}, + {"Guzzle 4-5", "hasemitterinterface.php", nr_guzzle4_enable}, + {"Guzzle 6", "guzzle/src/functions_include.php", nr_guzzle6_enable}, {"MongoDB", "mongodb/src/client.php", nr_mongodb_enable}, From bf071bbfeb27c4d5746ef4d6bf9f30de279e2d7e Mon Sep 17 00:00:00 2001 From: Michal Nowacki Date: Thu, 17 Aug 2023 11:32:25 -0400 Subject: [PATCH 2/4] fix predis integration tests --- tests/integration/predis/test_basic.php | 1 - tests/integration/predis/test_basic_logging_off.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 - 6 files changed, 6 deletions(-) diff --git a/tests/integration/predis/test_basic.php b/tests/integration/predis/test_basic.php index 32864a73b..9c4dcd674 100644 --- a/tests/integration/predis/test_basic.php +++ b/tests/integration/predis/test_basic.php @@ -55,7 +55,6 @@ [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/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 1dcce308e..1a53a6e43 100644 --- a/tests/integration/predis/test_basic_logging_off.php +++ b/tests/integration/predis/test_basic_logging_off.php @@ -58,7 +58,6 @@ [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]] ] diff --git a/tests/integration/predis/test_pipeline.php b/tests/integration/predis/test_pipeline.php index 1a134807f..ef0043038 100644 --- a/tests/integration/predis/test_pipeline.php +++ b/tests/integration/predis/test_pipeline.php @@ -48,7 +48,6 @@ [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/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 a266d5c6f..e2aac9dac 100644 --- a/tests/integration/predis/test_pipeline_atomic.php +++ b/tests/integration/predis/test_pipeline_atomic.php @@ -48,7 +48,6 @@ [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/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 512fda582..4def76323 100644 --- a/tests/integration/predis/test_pipeline_fire_and_forget.php +++ b/tests/integration/predis/test_pipeline_fire_and_forget.php @@ -48,7 +48,6 @@ [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/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 4be55fd8a..33e4dcdf0 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 @@ -51,7 +51,6 @@ [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/disabled"}, [1, "??", "??", "??", "??", "??"]] ] From 4bdfe3657c4850c329e9a243c94dad863555e638 Mon Sep 17 00:00:00 2001 From: Michal Nowacki Date: Thu, 17 Aug 2023 11:37:06 -0400 Subject: [PATCH 3/4] fix guzzle 6 and 7 integration 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/external/guzzle7/test_cat.php | 1 - tests/integration/external/guzzle7/test_dt.php | 1 - .../external/guzzle7/test_dt_newrelic_header_disabled.php | 1 - tests/integration/external/guzzle7/test_dt_synthetics.php | 1 - tests/integration/external/guzzle7/test_no_cat_no_dt.php | 1 - 11 files changed, 11 deletions(-) diff --git a/tests/integration/external/guzzle6/test_cat.php b/tests/integration/external/guzzle6/test_cat.php index 62fce17c6..119981b6e 100644 --- a/tests/integration/external/guzzle6/test_cat.php +++ b/tests/integration/external/guzzle6/test_cat.php @@ -51,7 +51,6 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]], [{"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 c4a366b2c..516611e3e 100644 --- a/tests/integration/external/guzzle6/test_dt.php +++ b/tests/integration/external/guzzle6/test_dt.php @@ -42,7 +42,6 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]], [{"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 86f803062..3f7c5f545 100644 --- a/tests/integration/external/guzzle6/test_dt_newrelic_header_disabled.php +++ b/tests/integration/external/guzzle6/test_dt_newrelic_header_disabled.php @@ -43,7 +43,6 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]], [{"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 e7b5f4532..701adc02c 100644 --- a/tests/integration/external/guzzle6/test_dt_synthetics.php +++ b/tests/integration/external/guzzle6/test_dt_synthetics.php @@ -65,7 +65,6 @@ [{"name":"WebTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"WebTransactionTotalTime/Uri__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"HttpDispatcher"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]], [{"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 8d207ec26..64d80aabd 100644 --- a/tests/integration/external/guzzle6/test_dt_synthetics_logging_off.php +++ b/tests/integration/external/guzzle6/test_dt_synthetics_logging_off.php @@ -68,7 +68,6 @@ [{"name":"WebTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"WebTransactionTotalTime/Uri__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"HttpDispatcher"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]], [{"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 31815b8d7..7fceb272b 100644 --- a/tests/integration/external/guzzle6/test_no_cat_no_dt.php +++ b/tests/integration/external/guzzle6/test_no_cat_no_dt.php @@ -42,7 +42,6 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]], [{"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/external/guzzle7/test_cat.php b/tests/integration/external/guzzle7/test_cat.php index e1abb1499..897ad8ac3 100644 --- a/tests/integration/external/guzzle7/test_cat.php +++ b/tests/integration/external/guzzle7/test_cat.php @@ -53,7 +53,6 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [2, 0, 0, 0, 0, 0]], [{"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]], diff --git a/tests/integration/external/guzzle7/test_dt.php b/tests/integration/external/guzzle7/test_dt.php index 1bb9bcbff..2f6882b2c 100644 --- a/tests/integration/external/guzzle7/test_dt.php +++ b/tests/integration/external/guzzle7/test_dt.php @@ -42,7 +42,6 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [2, 0, 0, 0, 0, 0]], [{"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 4ccd95878..7c7644a0d 100644 --- a/tests/integration/external/guzzle7/test_dt_newrelic_header_disabled.php +++ b/tests/integration/external/guzzle7/test_dt_newrelic_header_disabled.php @@ -43,7 +43,6 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [2, 0, 0, 0, 0, 0]], [{"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]], diff --git a/tests/integration/external/guzzle7/test_dt_synthetics.php b/tests/integration/external/guzzle7/test_dt_synthetics.php index 50359d92a..33ad546cd 100644 --- a/tests/integration/external/guzzle7/test_dt_synthetics.php +++ b/tests/integration/external/guzzle7/test_dt_synthetics.php @@ -65,7 +65,6 @@ [{"name":"WebTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"WebTransactionTotalTime/Uri__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"HttpDispatcher"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [2, 0, 0, 0, 0, 0]], [{"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]], 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 ecbd9175f..2fb5c830d 100644 --- a/tests/integration/external/guzzle7/test_no_cat_no_dt.php +++ b/tests/integration/external/guzzle7/test_no_cat_no_dt.php @@ -42,7 +42,6 @@ [{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [2, 0, 0, 0, 0, 0]], [{"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, "??", "??", "??", "??", "??"]] From 5b02c1eaf863e0443c538ad2d8fc821c8d92d2d1 Mon Sep 17 00:00:00 2001 From: Michal Nowacki Date: Thu, 17 Aug 2023 12:52:30 -0400 Subject: [PATCH 4/4] fixup! fix predis integration tests --- tests/integration/predis/test_basic_reporting_disabled.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration/predis/test_basic_reporting_disabled.php b/tests/integration/predis/test_basic_reporting_disabled.php index 0567f878a..6583c6f1d 100644 --- a/tests/integration/predis/test_basic_reporting_disabled.php +++ b/tests/integration/predis/test_basic_reporting_disabled.php @@ -55,7 +55,6 @@ [{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]], [{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/library/Predis/detected"}, [1, "??", "??", "??", "??", "??"]], - [{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]], [{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]] ]