NAME

OpenTracing::Implementation - Use OpenTracing with a specific implementation

VERSION

'v0.31.0'

SYNOPSIS

use OpenTracing::Implementation 'YourBackend', option_one => 'foo';

Or if you like

use OpenTracing::Implementation;

And one can then do a manual bootstrap

OpenTracing::Implementation->bootstrap_global_tracer( '+My::Implementation',
    option_one => 'foo',
    option_two => 'bar',
);

Alternativly, when you like to rely on environment variables

my $tracer = OpenTracing::Implementation->bootstrap_default_tracer(
    option_one => 'foo',
    option_two => 'bar',
);
# but maybe not all options make sense to every tracer, be warned

OpenTracing::GlobalTracer->set_global_tracer( $tracer );

Or if you just want a bootastrapped tracer:

my $tracer = OpenTracing::Implementation->bootstrap_tracer( 'ProviderFoo'
    option_one => 'foo',
    option_two => 'bar',
);

DESCRIPTION

This module provides an easy way to bootstrap a specific OpenTracing::Implementation compliant tracer and have it globally available.

CLASS METHODS

bootstrap_tracer

Bootstraps a given tracer implementation with various options for that tracer.

Required Positional Paramaters
implementation_name

Must be a Str type. It will look for the implementation inside the OpenTracing::Implementation namespace, so it is easy to specify any of the exisitng ones like NoOp, Test, and DataDog.

If a tracer lives outside that namespace, it would need to be prepended with a +, like in +My::Iplementation.

Optional Parameters

Any parameters required to bootstrap the given implementation according to their specifications and documentation.

Retruns
The build Tracer object

bootstrap_default_tracer

Same as bootstrap_tracer, except that it will use whatever is specified in the OPENTRACING_IMPLEMENTATION environment variable, Or NoOp if not set.

Do not pass in the name as first argument.

bootstrap_global_tracer

Same as bootstrap_tracer, but additionally sets the 'singleton' inside OpenTracing::GlabalTracer.

ENVIRONMENT VARIABLES

OPENTRACING_IMPLEMENTATION

Will be used when calling bootstrap_default_tracer.

AUTHOR

Theo van Hoesel <tvanhoesel@perceptyx.com>

COPYRIGHT AND LICENSE

'OpenTracing Implementation' is Copyright (C) 2020, Perceptyx Inc

This package is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

This package is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties.

For details, see the full text of the license in the file LICENSE.