line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OpenTracing::SpanContext; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
66
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
155
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.005'; # VERSION |
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TEAM'; # AUTHORITY |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
13
|
use parent qw(OpenTracing::Common); |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
21
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
113
|
no indirect; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
12
|
2
|
|
|
2
|
|
104
|
use utf8; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
10
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=encoding utf8 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
OpenTracing::SpanContext - tracks IDs and baggage for spans |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=cut |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 span |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Returns the L instance that this wraps. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
1
|
|
sub span { shift->{span} } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 log |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Writes a log entry to the L. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
1
|
|
sub log { shift->span->log(@_) } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 new_span |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Creates a new sub-span under this L instance. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub new_span { |
47
|
0
|
|
|
0
|
1
|
|
my ($self, $name, %args) = @_; |
48
|
0
|
|
|
|
|
|
my $parent = $self->span; |
49
|
0
|
|
|
|
|
|
@args{qw(trace_id parent_id)} = ( |
50
|
|
|
|
|
|
|
$parent->trace_id, |
51
|
|
|
|
|
|
|
$parent->id, |
52
|
|
|
|
|
|
|
); |
53
|
0
|
|
|
|
|
|
$parent->tracer->span(operation_name => $name, %args); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 DESTROY |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Called on destruction, will mark completion on the span by calling |
59
|
|
|
|
|
|
|
L. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |