File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ NR_PHP_WRAPPER(nr_mongodb_operation_after) {
191
191
zval * database = NULL ;
192
192
zval * server = NULL ;
193
193
zval * this_var = NULL ;
194
+ bool discard_segment = false;
194
195
nr_datastore_instance_t instance = {
195
196
.host = NULL ,
196
197
.port_path_or_id = NULL ,
@@ -216,6 +217,7 @@ NR_PHP_WRAPPER(nr_mongodb_operation_after) {
216
217
if (!nr_php_object_instanceof_class (this_var , this_klass )) {
217
218
nrl_verbosedebug (NRL_FRAMEWORK , "%s: operation is not %s" , __func__ ,
218
219
this_klass );
220
+ discard_segment = true;
219
221
goto leave ;
220
222
}
221
223
@@ -235,9 +237,12 @@ NR_PHP_WRAPPER(nr_mongodb_operation_after) {
235
237
nr_mongodb_get_host_and_port_path_or_id (server , & instance .host ,
236
238
& instance .port_path_or_id );
237
239
238
- nr_segment_datastore_end (& auto_segment , & params );
239
-
240
240
leave :
241
+ if (discard_segment ) {
242
+ nr_segment_discard (& auto_segment );
243
+ } else {
244
+ nr_segment_datastore_end (& auto_segment , & params );
245
+ }
241
246
nr_php_arg_release (& server );
242
247
nr_php_scope_release (& this_var );
243
248
nr_free (instance .host );
You can’t perform that action at this time.
0 commit comments