Perceptyx / perl-cgi-application-plugin-opentracing

A Plugin for CGI Applications that will add OpenTracing capabilities.
Artistic License 2.0
0 stars 1 forks source link

add method `get_global_tracer` to the CGI-Application object for convenience #4

Open vanHoesel opened 2 years ago

vanHoesel commented 2 years ago

instead of adding the use OpenTracing::GlobalTracer to all and ever place where one desires to have the Tracer, it would be way more convenient that on could simply do anywhere:

my $scope = $cgi_app->get_global_tracer->start_active_span( foo => %options )

One can of course always use the GlobalTracer, which should be returning the same object.

vanHoesel commented 2 years ago

This would be very convenient, but we should strife for a non-invasive approach that does not require to modify code and subroutines, but creates OpenTracing wrappers around a subroutine.

OpenTracing::WrapSub

vanHoesel commented 2 years ago

To have access to the Global Tracer is a must when a huge chunk of code that has no subs, and want to split it in segments, and trace each part of it separately (for timing purposes or large if-else codeblocks). Then a follows_from would be convenient to have, but requires more deeper OpenTracing programming.