line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use Mojo::Base -base, -signatures; |
2
|
6
|
|
|
6
|
|
212654
|
|
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
60
|
|
3
|
|
|
|
|
|
|
use Clone qw(); |
4
|
6
|
|
|
6
|
|
3417
|
use Mojo::Util 'dumper'; |
|
6
|
|
|
|
|
14049
|
|
|
6
|
|
|
|
|
163
|
|
5
|
6
|
|
|
6
|
|
44
|
use Sentry::Severity; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
309
|
|
6
|
6
|
|
|
6
|
|
2429
|
use Sentry::Tracing::Span; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
52
|
|
7
|
6
|
|
|
6
|
|
2357
|
use Sentry::Util 'merge'; |
|
6
|
|
|
|
|
20
|
|
|
6
|
|
|
|
|
77
|
|
8
|
6
|
|
|
6
|
|
239
|
use Time::HiRes; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
365
|
|
9
|
6
|
|
|
6
|
|
35
|
|
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
23
|
|
10
|
|
|
|
|
|
|
has breadcrumbs => sub { [] }; |
11
|
|
|
|
|
|
|
has contexts => sub { {} }; |
12
|
|
|
|
|
|
|
has error_event_processors => sub { [] }; |
13
|
|
|
|
|
|
|
has event_processors => sub { [] }; |
14
|
|
|
|
|
|
|
has extra => sub { {} }; |
15
|
|
|
|
|
|
|
has fingerprint => sub { [] }; |
16
|
|
|
|
|
|
|
has level => Sentry::Severity->Info; |
17
|
|
|
|
|
|
|
has span => undef; |
18
|
|
|
|
|
|
|
has tags => sub { {} }; |
19
|
|
|
|
|
|
|
has transaction_name => undef; |
20
|
|
|
|
|
|
|
has user => undef; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$self->span($span); |
23
|
9
|
|
|
9
|
0
|
41
|
return $self; |
|
9
|
|
|
|
|
14
|
|
|
9
|
|
|
|
|
11
|
|
|
9
|
|
|
|
|
13
|
|
24
|
9
|
|
|
|
|
34
|
} |
25
|
9
|
|
|
|
|
60
|
|
26
|
|
|
|
|
|
|
$self->user($user); |
27
|
|
|
|
|
|
|
} |
28
|
1
|
|
|
1
|
0
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
1
|
|
29
|
1
|
|
|
|
|
5
|
$self->extra->{$name} = $value; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
0
|
0
|
0
|
$self->extra = { %{ $self->extra }, %{$extras} }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
33
|
0
|
|
|
|
|
0
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$self->tags->{$key} = $value; |
36
|
0
|
|
|
0
|
0
|
0
|
} |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
37
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
38
|
|
|
|
|
|
|
$self->tags({ $self->tags->%*, $tags->%* }); |
39
|
|
|
|
|
|
|
} |
40
|
1
|
|
|
1
|
0
|
14
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1
|
|
41
|
1
|
|
|
|
|
5
|
if (not defined $context) { |
42
|
|
|
|
|
|
|
delete $self->contexts->{$key}; |
43
|
|
|
|
|
|
|
} else { |
44
|
15
|
|
|
15
|
0
|
107
|
$self->contexts->{$key} = $context; |
|
15
|
|
|
|
|
20
|
|
|
15
|
|
|
|
|
17
|
|
|
15
|
|
|
|
|
15
|
|
45
|
15
|
|
|
|
|
28
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# $self->_notify_scope_listeners(); |
48
|
0
|
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
49
|
0
|
0
|
|
|
|
0
|
return $self; |
50
|
0
|
|
|
|
|
0
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
0
|
$self->level($level); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$self->transaction_name($name); |
56
|
|
|
|
|
|
|
return $self; |
57
|
0
|
|
|
|
|
0
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
return $self->span; |
60
|
0
|
|
|
0
|
0
|
0
|
} |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
61
|
0
|
|
|
|
|
0
|
|
62
|
|
|
|
|
|
|
$self->fingerprint($fingerprint); |
63
|
|
|
|
|
|
|
} |
64
|
0
|
|
|
0
|
0
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
65
|
0
|
|
|
|
|
0
|
push $self->event_processors->@*, $event_processor; |
66
|
0
|
|
|
|
|
0
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
push $self->error_event_processors->@*, $error_event_processor; |
69
|
5
|
|
|
5
|
0
|
55
|
} |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
11
|
|
70
|
5
|
|
|
|
|
33
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# Resets a scope to default values while keeping all registered event |
73
|
0
|
|
|
0
|
0
|
0
|
# processors. This does not affect either child or parent scopes |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
74
|
0
|
|
|
|
|
0
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
$breadcrumb->{timestamp} //= time; |
77
|
0
|
|
|
0
|
0
|
0
|
push @{ $self->breadcrumbs }, $breadcrumb; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
78
|
0
|
|
|
|
|
0
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$self->breadcrumbs([]); |
81
|
0
|
|
|
0
|
0
|
0
|
} |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
82
|
0
|
|
|
|
|
0
|
|
83
|
|
|
|
|
|
|
# Applies fingerprint from the scope to the event if there's one, |
84
|
|
|
|
|
|
|
# uses message if there's one instead or get rid of empty fingerprint |
85
|
0
|
|
|
0
|
0
|
0
|
$event->{fingerprint} //= []; |
|
0
|
|
|
|
|
0
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$event->{fingerprint} = [$event->{fingerprint}] |
88
|
|
|
|
|
|
|
if ref($event->{fingerprint} ne 'ARRAY'); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
$event->{fingerprint} = [$event->{fingerprint}->@*, $self->fingerprint->@*]; |
91
|
18
|
|
|
18
|
0
|
76
|
|
|
18
|
|
|
|
|
30
|
|
|
18
|
|
|
|
|
27
|
|
|
18
|
|
|
|
|
39
|
|
92
|
18
|
|
66
|
|
|
101
|
delete $event->{fingerprint} unless scalar $event->{fingerprint}->@*; |
93
|
18
|
|
|
|
|
33
|
} |
|
18
|
|
|
|
|
59
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# Applies the scope data to the given event object. This also applies the event |
96
|
0
|
|
|
0
|
0
|
0
|
# processors stored in the scope internally. Some implementations might want to |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
97
|
0
|
|
|
|
|
0
|
# set a max breadcrumbs count here. |
98
|
|
|
|
|
|
|
merge($event, $self, 'extra') if $self->extra; |
99
|
|
|
|
|
|
|
merge($event, $self, 'tags') if $self->tags; |
100
|
|
|
|
|
|
|
merge($event, $self, 'user') if $self->user; |
101
|
|
|
|
|
|
|
merge($event, $self, 'contexts') if $self->contexts; |
102
|
21
|
|
|
21
|
|
32
|
|
|
21
|
|
|
|
|
31
|
|
|
21
|
|
|
|
|
34
|
|
|
21
|
|
|
|
|
27
|
|
103
|
21
|
|
50
|
|
|
107
|
$event->{level} //= $self->level if $self->level; |
104
|
|
|
|
|
|
|
$event->{transaction} = $self->transaction_name if $self->transaction_name; |
105
|
|
|
|
|
|
|
|
106
|
21
|
50
|
|
|
|
81
|
if ($self->span) { |
107
|
|
|
|
|
|
|
$event->{request} = $self->span->request; |
108
|
21
|
|
|
|
|
90
|
|
109
|
|
|
|
|
|
|
$event->{contexts} = { |
110
|
21
|
50
|
|
|
|
102
|
trace => $self->span->get_trace_context(), |
111
|
|
|
|
|
|
|
($event->{contexts} // {})->%* |
112
|
|
|
|
|
|
|
}; |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
if (my $transaction_name = $self->span->transaction->name) { |
115
|
|
|
|
|
|
|
$event->{tags} |
116
|
21
|
|
|
21
|
0
|
829
|
= { transaction => $transaction_name, ($event->{tags} // {})->%* }; |
|
21
|
|
|
|
|
34
|
|
|
21
|
|
|
|
|
26
|
|
|
21
|
|
|
|
|
33
|
|
|
21
|
|
|
|
|
21
|
|
117
|
21
|
50
|
|
|
|
66
|
} |
118
|
21
|
50
|
|
|
|
82
|
} |
119
|
21
|
50
|
|
|
|
75
|
|
120
|
21
|
50
|
|
|
|
140
|
$self->_apply_fingerprint($event); |
121
|
|
|
|
|
|
|
|
122
|
21
|
50
|
66
|
|
|
65
|
$event->{breadcrumbs} |
123
|
21
|
50
|
|
|
|
243
|
= [($event->{breadcrumbs} // [])->@*, $self->breadcrumbs->@*]; |
124
|
|
|
|
|
|
|
|
125
|
21
|
100
|
|
|
|
172
|
my @event_processors |
126
|
20
|
|
|
|
|
96
|
= (get_global_event_processors()->@*, $self->event_processors->@*); |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
foreach my $processor (@event_processors) { |
129
|
|
|
|
|
|
|
$event = $processor->($event, $hint); |
130
|
20
|
|
50
|
|
|
139
|
} |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
return $event; |
133
|
20
|
50
|
|
|
|
234
|
} |
134
|
|
|
|
|
|
|
|
135
|
20
|
|
50
|
|
|
268
|
Clone::clone($self); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
$self->$_($fields->{$_}) for keys $fields->%*; |
139
|
21
|
|
|
|
|
100
|
} |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
state $processors = []; |
142
|
21
|
|
50
|
|
|
121
|
return $processors; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
21
|
|
|
|
|
99
|
push get_global_event_processors()->@*, $processor; |
146
|
|
|
|
|
|
|
} |
147
|
21
|
|
|
|
|
66
|
|
148
|
1
|
|
|
|
|
5
|
1; |