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