line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use Mojo::Base -base, -signatures; |
2
|
7
|
|
|
7
|
|
169469
|
|
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
41
|
|
3
|
|
|
|
|
|
|
use HTTP::Status qw(status_message); |
4
|
7
|
|
|
7
|
|
3837
|
use Readonly; |
|
7
|
|
|
|
|
22811
|
|
|
7
|
|
|
|
|
657
|
|
5
|
7
|
|
|
7
|
|
3102
|
use Sentry::Tracing::Status; |
|
7
|
|
|
|
|
22017
|
|
|
7
|
|
|
|
|
326
|
|
6
|
7
|
|
|
7
|
|
2687
|
use Sentry::Tracing::Transaction; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
55
|
|
7
|
7
|
|
|
7
|
|
2259
|
use Sentry::Util qw(uuid4); |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
64
|
|
8
|
7
|
|
|
7
|
|
2707
|
use Time::HiRes qw(time); |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
389
|
|
9
|
7
|
|
|
7
|
|
43
|
|
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
40
|
|
10
|
|
|
|
|
|
|
Readonly my $SPAN_ID_LENGTH => 16; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# https://develop.sentry.dev/sdk/unified-api/tracing |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Hexadecimal string representing a uuid4 value. The length is exactly 32 |
15
|
|
|
|
|
|
|
# characters. Dashes are not allowed. Has to be lowercase |
16
|
|
|
|
|
|
|
has span_id => sub { substr(uuid4(), 0, $SPAN_ID_LENGTH) }; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Optional. A map or list of tags for this event. Each tag must be less than 200 |
19
|
|
|
|
|
|
|
# characters. |
20
|
|
|
|
|
|
|
has tags => sub { {} }; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Required. Determines which trace the Span belongs to. The value should be 16 |
23
|
|
|
|
|
|
|
# random bytes encoded as a hex string (32 characters long). |
24
|
|
|
|
|
|
|
has trace_id => sub { uuid4() }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# Recommended. Short code identifying the type of operation the span is |
27
|
|
|
|
|
|
|
# measuring. |
28
|
|
|
|
|
|
|
has op => undef; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# Optional. Longer description of the span's operation, which uniquely |
31
|
|
|
|
|
|
|
# identifies the span but is consistent across instances of the span. |
32
|
|
|
|
|
|
|
has description => undef; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Required. A timestamp representing when the measuring started. The format is |
35
|
|
|
|
|
|
|
# either a string as defined in RFC 3339 or a numeric (integer or float) value |
36
|
|
|
|
|
|
|
# representing the number of seconds that have elapsed since the Unix epoch. The |
37
|
|
|
|
|
|
|
# start_timestamp value must be greater or equal the timestamp value, otherwise |
38
|
|
|
|
|
|
|
# the Span is discarded as invalid. |
39
|
|
|
|
|
|
|
has start_timestamp => time; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# Required. A timestamp representing when the measuring finished. The format is |
42
|
|
|
|
|
|
|
# either a string as defined in RFC 3339 or a numeric (integer or float) value |
43
|
|
|
|
|
|
|
# representing the number of seconds that have elapsed since the Unix epoch. |
44
|
|
|
|
|
|
|
has timestamp => undef; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# Optional. Describes the status of the Span/Transaction. |
47
|
|
|
|
|
|
|
has status => undef; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Optional. Arbitrary data associated with this Span. |
50
|
|
|
|
|
|
|
has data => undef; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
has parent_span_id => undef; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# Was this span chosen to be sent as part of the sample? |
55
|
|
|
|
|
|
|
has sampled => undef; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
has spans => sub { [] }; |
58
|
|
|
|
|
|
|
has transaction => undef; |
59
|
|
|
|
|
|
|
has request => undef; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $child_span = Sentry::Tracing::Span->new({ |
62
|
4
|
|
|
4
|
0
|
4685
|
$span_context->%*, |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
6
|
|
63
|
4
|
|
|
|
|
14
|
parent_span_id => $self->span_id, |
64
|
|
|
|
|
|
|
sampled => $self->sampled, |
65
|
|
|
|
|
|
|
trace_id => $self->trace_id, |
66
|
|
|
|
|
|
|
start_timestamp => time, |
67
|
|
|
|
|
|
|
}); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
push $self->spans->@*, $child_span; |
70
|
|
|
|
|
|
|
|
71
|
4
|
|
|
|
|
44
|
$child_span->transaction($self->transaction); |
72
|
|
|
|
|
|
|
|
73
|
4
|
|
|
|
|
10
|
return $child_span; |
74
|
|
|
|
|
|
|
} |
75
|
4
|
|
|
|
|
28
|
|
76
|
|
|
|
|
|
|
return { |
77
|
|
|
|
|
|
|
data => $self->data, |
78
|
29
|
|
|
29
|
0
|
87
|
description => $self->description, |
|
29
|
|
|
|
|
41
|
|
|
29
|
|
|
|
|
36
|
|
79
|
|
|
|
|
|
|
op => $self->op, |
80
|
29
|
|
|
|
|
79
|
parent_span_id => $self->parent_span_id, |
81
|
|
|
|
|
|
|
span_id => $self->span_id, |
82
|
|
|
|
|
|
|
status => $self->status, |
83
|
|
|
|
|
|
|
tags => $self->tags, |
84
|
|
|
|
|
|
|
trace_id => $self->trace_id, |
85
|
|
|
|
|
|
|
}; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
return { |
89
|
|
|
|
|
|
|
data => $self->data, |
90
|
|
|
|
|
|
|
description => $self->description, |
91
|
0
|
|
|
0
|
0
|
0
|
op => $self->op, |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
92
|
|
|
|
|
|
|
parent_span_id => $self->parent_span_id, |
93
|
0
|
|
|
|
|
0
|
span_id => $self->span_id, |
94
|
|
|
|
|
|
|
start_timestamp => $self->start_timestamp, |
95
|
|
|
|
|
|
|
status => $self->status, |
96
|
|
|
|
|
|
|
tags => $self->tags, |
97
|
|
|
|
|
|
|
timestamp => $self->timestamp, |
98
|
|
|
|
|
|
|
trace_id => $self->trace_id, |
99
|
|
|
|
|
|
|
}; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
$self->tags({ $self->tags->%*, $key => $value }); |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
$self->set_tag('http.status_code' => $status); |
106
|
11
|
|
|
11
|
0
|
2383
|
$self->status(Sentry::Tracing::Status->from_http_code($status)); |
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
17
|
|
|
11
|
|
|
|
|
14
|
|
|
11
|
|
|
|
|
13
|
|
107
|
11
|
|
|
|
|
33
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
$self->timestamp(time); |
110
|
9
|
|
|
9
|
0
|
1548
|
} |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
12
|
|
111
|
9
|
|
|
|
|
33
|
|
112
|
9
|
|
|
|
|
150
|
1; |