| 1 | 5 | ▶ | use Object::Pad; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | # ABSTRACT: A Tracer for the OpenTelemetry SDK | ||||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | package OpenTelemetry::SDK::Trace::Tracer; | ||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 5 | our $VERSION = '0.101'; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | ▶ | class OpenTelemetry::SDK::Trace::Tracer :isa(OpenTelemetry::Trace::Tracer) { | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 5 | ▶ | use OpenTelemetry::Constants 'SPAN_KIND_INTERNAL'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 5 | ▶ | use OpenTelemetry::Context; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 5 | ▶ | use OpenTelemetry::Trace; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 5 | ▶ | use OpenTelemetry::Common (); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 5 | ▶ | use Ref::Util 'is_hashref'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 5 | field $span_creator :param; | |||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 3 | ▶ | method create_span ( %args ) { | ||||||||||||||||||
|
Subroutine
create_span: called CC=8 SCAR=23.7
Pod
documented
| |||||||||||||||||||||
| 18 | 3 | ▶ | $args{name} //= 'empty'; | ||||||||||||||||||
|
Condition50%1/2
$args{"name"} //= "empty"
MC/DC0%0/1
$args{"name"} //= "empty"
$args{"name"}
Truth table50%1/2
A
A= $args{"name"}
| |||||||||||||||||||||
| 19 | 3 | ▶ | $args{kind} //= SPAN_KIND_INTERNAL; | ||||||||||||||||||
|
Condition50%1/2
$args{"kind"} //= 1
MC/DC0%0/1
$args{"kind"} //= 1
$args{"kind"}
Truth table50%1/2
A
A= $args{"kind"}
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 3 | ▶ | unless (is_hashref( $args{attributes} // {} )) { | ||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$args{"attributes"} // {}
MC/DC0%0/1
$args{"attributes"} // {}
$args{"attributes"}
Truth table50%1/2
A
A= $args{"attributes"}
| |||||||||||||||||||||
| 22 | OpenTelemetry::Common::internal_logger | ||||||||||||||||||||
| 23 | 0 | ▶ | ->warn('The \'attributes\' parameter to create_span must be a hash reference, it was instead a ' . ( ref($args{attribute}) || 'plain scalar' ) ); | ||||||||||||||||||
|
Condition0%0/2
ref $args{'attribute'} || 'plain scalar'
MC/DC0%0/1
ref $args{'attribute'} || 'plain scalar'
ref $args{'attribute'}
Truth table0%0/2
A
A= ref $args{'attribute'}
| |||||||||||||||||||||
| 24 | 0 | delete $args{attributes}; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | $args{context} = OpenTelemetry::Context->current | ||||||||||||||||||||
| 28 | 3 | ▶ | unless exists $args{context}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | return $self->SUPER::create_span(%args) | ||||||||||||||||||||
| 31 | 3 | ▶ | if OpenTelemetry::Trace->is_untraced_context($args{context}); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 2 | $span_creator->(%args); | |||||||||||||||||||
| 34 | 5 | } | |||||||||||||||||||
| 35 | 5 | } | |||||||||||||||||||