Skip to content

Commit 6449c88

Browse files
committed
refactor(agent): improve guzzle detection (#714)
Use files that more uniquely identify Guzzle 5, and Guzzle 6. Because the file used to identify Guzzle 5 is unique to Guzzle 5, Guzzle 4-5 supportability metrics are no longer generated when predis is detected. Guzzle 4-5 supportability metrics is also not generated when Guzzle 6 or Guzzle 7 are detected.
1 parent b1eef1d commit 6449c88

19 files changed

+2
-24
lines changed

agent/php_execute.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,8 @@ typedef struct _nr_library_table_t {
481481
static nr_library_table_t libraries[] = {
482482
{"Doctrine 2", "doctrine/orm/query.php", nr_doctrine2_enable},
483483
{"Guzzle 3", "guzzle/http/client.php", nr_guzzle3_enable},
484-
/*
485-
* NOTE: This file ClientInterface.php also exists in Guzzle 3 and 6.
486-
* This file also exists in Predis.
487-
*/
488-
{"Guzzle 4-5", "clientinterface.php", nr_guzzle4_enable},
489-
{"Guzzle 6", "handlerstack.php", nr_guzzle6_enable},
484+
{"Guzzle 4-5", "hasemitterinterface.php", nr_guzzle4_enable},
485+
{"Guzzle 6", "guzzle/src/functions_include.php", nr_guzzle6_enable},
490486

491487
{"MongoDB", "mongodb/src/client.php", nr_mongodb_enable},
492488

tests/integration/external/guzzle6/test_cat.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
5252
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
5353
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
54-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]],
5554
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
5655
[{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]],
5756
[{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]],

tests/integration/external/guzzle6/test_dt.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
4343
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
4444
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
45-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]],
4645
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
4746
[{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]],
4847
[{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]],

tests/integration/external/guzzle6/test_dt_newrelic_header_disabled.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
4444
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
4545
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
46-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]],
4746
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
4847
[{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]],
4948
[{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]],

tests/integration/external/guzzle6/test_dt_synthetics.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
[{"name":"WebTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
6666
[{"name":"WebTransactionTotalTime/Uri__FILE__"}, [1, "??", "??", "??", "??", "??"]],
6767
[{"name":"HttpDispatcher"}, [1, "??", "??", "??", "??", "??"]],
68-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]],
6968
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
7069
[{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]],
7170
[{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]],

tests/integration/external/guzzle6/test_dt_synthetics_logging_off.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
[{"name":"WebTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
6969
[{"name":"WebTransactionTotalTime/Uri__FILE__"}, [1, "??", "??", "??", "??", "??"]],
7070
[{"name":"HttpDispatcher"}, [1, "??", "??", "??", "??", "??"]],
71-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]],
7271
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
7372
[{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]],
7473
[{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]],

tests/integration/external/guzzle6/test_no_cat_no_dt.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
4343
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
4444
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
45-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [1, 0, 0, 0, 0, 0]],
4645
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
4746
[{"name":"Supportability/Logging/Forwarding/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]],
4847
[{"name":"Supportability/Logging/Metrics/PHP/enabled"}, [1, "??", "??", "??", "??", "??"]]

tests/integration/external/guzzle7/test_cat.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
5454
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
5555
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
56-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [2, 0, 0, 0, 0, 0]],
5756
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
5857
[{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"},
5958
[3, 0, 0, 0, 0, 0]],

tests/integration/external/guzzle7/test_dt.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
4343
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
4444
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
45-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [2, 0, 0, 0, 0, 0]],
4645
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
4746
[{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"}, [3, 0, 0, 0, 0, 0]],
4847
[{"name":"DurationByCaller/Unknown/Unknown/Unknown/Unknown/all"}, [1, "??", "??", "??", "??", "??"]],

tests/integration/external/guzzle7/test_dt_newrelic_header_disabled.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
[{"name":"OtherTransaction/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
4444
[{"name":"OtherTransactionTotalTime"}, [1, "??", "??", "??", "??", "??"]],
4545
[{"name":"OtherTransactionTotalTime/php__FILE__"}, [1, "??", "??", "??", "??", "??"]],
46-
[{"name":"Supportability/library/Guzzle 4-5/detected"}, [2, 0, 0, 0, 0, 0]],
4746
[{"name":"Supportability/library/Guzzle 6/detected"}, [1, 0, 0, 0, 0, 0]],
4847
[{"name":"Supportability/Unsupported/curl_setopt/CURLOPT_HEADERFUNCTION/closure"},
4948
[3, 0, 0, 0, 0, 0]],

0 commit comments

Comments
 (0)