The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

OpenTracing::Integration - top-level class for integrating OpenTracing with other Perl modules

SYNOPSIS

 # Apply tracing for specific modules
 use OpenTracing::Integration qw(HTTP::Tiny DBI);

 # Trace every module we know about
 use OpenTracing::Integration qw(:all);

DESCRIPTION

This is the base rôle for handling tracing integration with other CPAN modules.

It provides functionality for loading available integrations via the import list on a use statement:

  • with :all, any module that supports OpenTracing will be pulled in, if the module-to-be-traced is already loaded

  • with a specific list of modules, these will be applied unconditionally, loading the modules-to-be-traced as required

This means that you can expect HTTP::Tiny to be traced if you do this:

 use OpenTracing::Integration qw(HTTP::Tiny);

or this:

 use HTTP::Tiny;
 use OpenTracing::Integration qw(:all);

but it will not be traced if you do this:

 use OpenTracing::Integration qw(:all);
 use HTTP::Tiny;

The reason for this inconsistent behaviour is simple: with a large install, :all might pull in a lot of unwanted modules. Instead, you'd do this at the end of your module imports, and any functionality that you're actively using in the code would gain tracing, if available.

AUTHOR

Tom Molesworth TEAM@cpan.org

LICENSE

Copyright Tom Molesworth 2018-2021. Licensed under the same terms as Perl itself.