Skip to content

Commit 0e6ec90

Browse files
committed
fix(agent): Update comment
1 parent b5c7def commit 0e6ec90

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

agent/lib_php_amqplib.c

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,29 @@
5656
*
5757
* While the RabbitMQ tutorial for using with the dockerized RabbitMQ setup
5858
* correctly and loads the PhpAmqpLib\\Channel\\AMQPChannel class in time for
59-
* the agent to wrap the instrumented functions, there are AWS MQ_BROKER
59+
* the agent to wrap the instrumented functions, with AWS MQ_BROKER
6060
* specific but valid scenarios where the PhpAmqpLib\\Channel\\AMQPChannel class
61-
* file does not explicitly load or does not load in time, and the instrumented
61+
* file does not explicitly load and the instrumented
6262
* functions are NEVER wrapped regardless of how many times they are called in
63-
* one txn. Specifically, this centered around the very slight but impactful
64-
* differences when using managing the AWS MQ Broker connect vs
65-
* causes an explicit load of the AMQPChannel class/file and
66-
* PhpAmqpLib\Connection\AMQPSSLConnection which does NOT cause an explicit load
67-
* of the AMQPChannelclass/file. The following method is thus the only way to
68-
* ensure the class is loaded in time for the functions to be wrapped.
63+
* one txn.
64+
* Specifically, this centered around the very slight but impactful
65+
* differences when using managing the AWS MQ_BROKER connect vs using the
66+
* official RabbitMq Server, and this function is needed ONLY to support AWS's
67+
* MQ_BROKER.
6968
*
69+
* When connecting via SSL with rabbitmq's official server is explicitly loaded.
70+
* Hoever, when connecting via SSL with an MQ_BROKER that uses RabbitMQ(using
71+
* the exact same php file and with only changes in the server name for the
72+
* connection), the AMQPChannel file (and therefore class), the AMQPChannel file
73+
* (and therefore class) is NOT explicitly loaded.
74+
*
75+
* Because the very key `PhpAmqpLib/Channel/AMQPChannel.php` file never gets
76+
* explicitly loaded when interacting with the AWS MQ_BROKER, the class is not
77+
* automatically loaded even though it is available and can be resolved if
78+
* called from within PHP. Because of this, the instrumented functions NEVER
79+
* get wrapped when connecting to the MQ_BROKER and therefore the
80+
* instrumentation is never triggered. The explicit loading of the class is
81+
* needed to work with MQ_BROKER.
7082
*/
7183

7284
/*

0 commit comments

Comments
 (0)