@@ -106,30 +106,30 @@ void nr_lib_aws_sdk_php_sqs_handle(nr_segment_t* segment,
106
106
return ;
107
107
}
108
108
109
- /* Determine if we instrument this command. */
110
- #define COMMAND_IS (CMD ) \
109
+ #define AWS_COMMAND_IS (CMD ) \
111
110
(command_name_len == (sizeof(CMD) - 1) && nr_streq(CMD, command_name_string))
112
111
113
112
/* Determine if we instrument this command. */
114
- if (COMMAND_IS ("sendMessageBatch" )) {
113
+ if (AWS_COMMAND_IS ("sendMessageBatch" )) {
115
114
message_params .message_action = NR_SPANKIND_PRODUCER ;
116
- } else if (COMMAND_IS ("sendMessage" )) {
115
+ } else if (AWS_COMMAND_IS ("sendMessage" )) {
117
116
message_params .message_action = NR_SPANKIND_PRODUCER ;
118
- } else if (COMMAND_IS ("receiveMessage" )) {
117
+ } else if (AWS_COMMAND_IS ("receiveMessage" )) {
119
118
message_params .message_action = NR_SPANKIND_CONSUMER ;
120
119
} else {
121
120
/* Nothing to do here so exit. */
122
121
return ;
123
122
}
124
- #undef IS_COMMAND
123
+ #undef IS_AWS_COMMAND
125
124
126
125
cloud_attrs .aws_operation = command_name_string ;
127
126
128
127
command_arg_value = nr_lib_aws_sdk_php_get_command_arg_value (
129
128
AWS_SDK_PHP_SQSCLIENT_QUEUEURL_ARG , NR_EXECUTE_ORIG_ARGS );
130
129
131
130
/*
132
- * nr_lib_aws_sdk_php_sqs_parse_queueurl requires a modifiable string to populate message_params and cloud_attrs.
131
+ * nr_lib_aws_sdk_php_sqs_parse_queueurl requires a modifiable string to
132
+ * populate message_params and cloud_attrs.
133
133
*/
134
134
nr_lib_aws_sdk_php_sqs_parse_queueurl (command_arg_value , & message_params ,
135
135
& cloud_attrs );
@@ -368,15 +368,18 @@ NR_PHP_WRAPPER(nr_aws_client_call) {
368
368
command_name_string = Z_STRVAL_P (command_name );
369
369
klass_len = nr_php_class_entry_name_length (class_entry );
370
370
371
- if (klass_len == AWS_SDK_PHP_SQSCLIENT_CLASS_LEN
372
- && nr_striendswith (klass , klass_len ,
373
- AWS_SDK_PHP_SQSCLIENT_CLASS_SHORT ,
374
- AWS_SDK_PHP_SQSCLIENT_CLASS_SHORT_LEN )) {
371
+ #define AWS_CLASS_IS (KLASS , SHORT_KLASS ) \
372
+ (klass_len == (sizeof(KLASS) - 1) \
373
+ && nr_striendswith(klass, klass_len, SHORT_KLASS, sizeof(SHORT_KLASS) - 1))
374
+
375
+ if AWS_CLASS_IS ("Aws\\Sqs\\SqsClient" , "SqsClient" ) {
375
376
nr_lib_aws_sdk_php_sqs_handle (auto_segment , command_name_string ,
376
377
Z_STRLEN_P (command_name ),
377
378
NR_EXECUTE_ORIG_ARGS );
378
379
}
379
380
381
+ #undef AWS_CLASS_IS
382
+
380
383
if (NR_SEGMENT_CUSTOM == auto_segment -> type ) {
381
384
/*
382
385
* We need to end the segment that we started in the 'before' wrapper if
0 commit comments