NAME

OpenTracing::Implementation::DataDog::Tracer - Keep track of traces

SYNOPSIS

use aliased 'OpenTracing::Implementation::DataDog::Tracer';
use aliased 'OpenTracing::Implementation::DataDog::Agent';
use aliased 'OpenTracing::Implementation::DataDog::ScopeManager';

my $TRACER = Tracer->new(
    agent                 => Agent->new(),
    scope_manager         => ScopeManager->new(),
    default_scope_builder => sub {
        return {
            service_name  => 'Your Service name',
            resource_name => 'Some Resource name',
        }
    },
);

and later

sub foo {
    
    my $scope = $TRACER->start_active_span( 'Operation Name' => %options );
    
    ...
    
    $scope->close;
    
    return $foo
}

CAVEATS

extract_context and inject_context do not support any off the defined methods at all. All that extract_context does at this moment, is providing a deafault SpanContext, either given or cuntructed using a code-reference in default_context_builder