CGI-Application-Plugin-OpenTracing

 view release on metacpan or  search on metacpan

lib/CGI/Application/Plugin/OpenTracing.pm  view on Meta::CPAN

203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
    $plugin->add_tags(TRC_ACTIVE_SCOPE,
        error   => 1,
        message => $error,
        grep_error_tags( $plugin->get_tags(TRC_ACTIVE_SCOPE) ),
    );
     
    # run span should continue
    my $root = $plugin->get_scope(CGI_RUN)->get_span;
     
    my $tracer = $plugin->get_tracer();
    _cascade_set_failed_spans($tracer, $error, $root);
     
    return;
}
 
 
 
################################################################################
#
#   Plugin methods - These do not require the CGI-App
#

lib/CGI/Application/Plugin/OpenTracing.pm  view on Meta::CPAN

328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
                @implementation_import_opts,
                @bootstrap_options,
            )
    ;
         
    return $bootstrapped_tracer;
}
 
 
 
sub _cascade_set_failed_spans {
    my ($tracer, $error, $root_span) = @_;
    my $root_addr = refaddr($root_span) if defined $root_span;
 
    while (my $scope = $tracer->get_scope_manager->get_active_scope()) {
        my $span = $scope->get_span();
        last if defined $root_addr and $root_addr eq refaddr($span);
         
#       $span->add_tags(error => 1, message => $error);
        $scope->close();
    }

lib/CGI/Application/Plugin/OpenTracing.pm  view on Meta::CPAN

720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
            message => $error,
        );
         
        $plugin->add_tags(TRC_ACTIVE_SCOPE,
            error   => 1,
            message => $error,
            grep_error_tags( $plugin->get_tags(TRC_ACTIVE_SCOPE) ),
        );
         
        my $tracer = $plugin->get_tracer();
        _cascade_set_failed_spans($tracer, $error);
 
        die $error;
    };
}
 
 
 
1;



( run in 0.340 second using v1.01-cache-2.11-cpan-95122f20152 )