line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OpenTracing::Interface::Tracer; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
571054
|
use strict; |
|
3
|
|
|
|
|
30
|
|
|
3
|
|
|
|
|
92
|
|
5
|
3
|
|
|
3
|
|
19
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
145
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
1369
|
use Role::MethodReturns; |
|
3
|
|
|
|
|
452764
|
|
|
3
|
|
|
|
|
21
|
|
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
3
|
|
18317
|
use OpenTracing::Types qw/ContextReference Scope ScopeManager Span SpanContext/; |
|
3
|
|
|
|
|
3806
|
|
|
3
|
|
|
|
|
32
|
|
14
|
3
|
|
|
3
|
|
3009
|
use Types::Standard qw/Any ArrayRef Bool Dict HashRef Optional Str/; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
18
|
|
15
|
3
|
|
|
3
|
|
6050
|
use Types::Common::Numeric qw/PositiveOrZeroNum/; |
|
3
|
|
|
|
|
66016
|
|
|
3
|
|
|
|
|
27
|
|
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
3
|
|
1635
|
use Carp; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
484
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
around get_scope_manager => instance_method ( ) { |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
returns( ScopeManager, |
23
|
|
|
|
|
|
|
$original->( $instance => ( ) ) |
24
|
|
|
|
|
|
|
) |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
around get_active_span => instance_method ( ) { |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
returns_maybe( Span, |
33
|
|
|
|
|
|
|
$original->( $instance => ( ) ) |
34
|
|
|
|
|
|
|
) |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
around start_active_span => instance_method ( Str $operation_name, @options ) { |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
croak "'child_of' and 'references' are mutual exclusive options" |
43
|
|
|
|
|
|
|
if exists { @options }->{child_of} && exists { @options }->{references}; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
( Dict[ |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
child_of => Optional[ Span | SpanContext ], |
48
|
|
|
|
|
|
|
references => Optional[ ArrayRef[ ContextReference ]], |
49
|
|
|
|
|
|
|
tags => Optional[ HashRef[ Str ] ], |
50
|
|
|
|
|
|
|
start_time => Optional[ PositiveOrZeroNum ], |
51
|
|
|
|
|
|
|
ignore_active_span => Optional[ Bool ], |
52
|
|
|
|
|
|
|
finish_span_on_close => Optional[ Bool ], |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
] )->assert_valid( { @options } ); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
returns( Scope, |
57
|
|
|
|
|
|
|
$original->( $instance => ( $operation_name, @options ) ) |
58
|
|
|
|
|
|
|
) |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
}; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
around start_span => instance_method ( Str $operation_name, @options ) { |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
croak "'child_of' and 'references' are mutual exclusive options" |
67
|
|
|
|
|
|
|
if exists { @options }->{child_of} && exists { @options }->{references}; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
( Dict[ |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
child_of => Optional[ Span | SpanContext ], |
72
|
|
|
|
|
|
|
references => Optional[ ArrayRef[ ContextReference ]], |
73
|
|
|
|
|
|
|
tags => Optional[ HashRef[ Str ] ], |
74
|
|
|
|
|
|
|
start_time => Optional[ PositiveOrZeroNum ], |
75
|
|
|
|
|
|
|
ignore_active_span => Optional[ Bool ], |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
] )->assert_valid( { @options } ); |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
returns( Span, |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
$original->( $instance => ( $operation_name, @options ) ) |
82
|
|
|
|
|
|
|
) |
83
|
|
|
|
|
|
|
}; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
around inject_context => instance_method ( $carrier_format, $carrier, |
88
|
|
|
|
|
|
|
SpanContext $span_context |
89
|
|
|
|
|
|
|
) { |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
returns( Any, |
92
|
|
|
|
|
|
|
$original->( $instance => ( $carrier_format, $carrier, $span_context ) ) |
93
|
|
|
|
|
|
|
) |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
}; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
around extract_context => instance_method ( $carrier_format, $carrier ) { |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
returns_maybe( SpanContext, |
102
|
|
|
|
|
|
|
$original->( $instance => ( $carrier_format, $carrier ) ) |
103
|
|
|
|
|
|
|
) |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
}; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
1; |