line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use Mojo::Base 'Sentry::Integration::Base', -signatures; |
2
|
4
|
|
|
4
|
|
25
|
|
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
22
|
|
3
|
|
|
|
|
|
|
use Mojo::Util qw(dumper); |
4
|
4
|
|
|
4
|
|
752
|
use Sentry::Util 'around'; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
142
|
|
5
|
4
|
|
|
4
|
|
18
|
|
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1506
|
|
6
|
|
|
|
|
|
|
has breadcrumbs => 1; |
7
|
|
|
|
|
|
|
has tracing => 1; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
return if (!$self->breadcrumbs && !$self->tracing); |
10
|
3
|
|
|
3
|
0
|
6
|
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
5
|
|
11
|
3
|
0
|
33
|
|
|
10
|
around( |
12
|
|
|
|
|
|
|
'LWP::UserAgent', |
13
|
0
|
|
|
|
|
|
request => sub ($orig, $lwp, $request, @args) { |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
|
|
my $url = $request->uri; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
# Exclude Requests to the Sentry server |
18
|
|
|
|
|
|
|
return $orig->($lwp, $request, @args) |
19
|
|
|
|
|
|
|
if $request->header('x-sentry-auth'); |
20
|
0
|
0
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $hub = $get_current_hub->(); |
22
|
|
|
|
|
|
|
my $span; |
23
|
0
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
if ($self->tracing && (my $parent_span = $hub->get_scope()->get_span)) { |
25
|
|
|
|
|
|
|
$span = $parent_span->start_child({ |
26
|
0
|
0
|
0
|
|
|
|
op => 'http', |
27
|
0
|
|
|
|
|
|
name => 'My Transaction', |
28
|
|
|
|
|
|
|
description => $request->method . ' ' . $request->uri, |
29
|
|
|
|
|
|
|
data => { |
30
|
|
|
|
|
|
|
url => $request->uri, |
31
|
|
|
|
|
|
|
method => $request->method, |
32
|
|
|
|
|
|
|
headers => $request->headers, |
33
|
|
|
|
|
|
|
}, |
34
|
|
|
|
|
|
|
}); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $result = $orig->($lwp, $request, @args); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
$hub->add_breadcrumb({ |
40
|
|
|
|
|
|
|
type => 'http', |
41
|
0
|
0
|
|
|
|
|
category => 'LWP::UserAgent', |
42
|
|
|
|
|
|
|
data => { |
43
|
|
|
|
|
|
|
url => $request->uri, |
44
|
|
|
|
|
|
|
method => $request->method, |
45
|
|
|
|
|
|
|
status_code => $result->code, |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
}) |
48
|
|
|
|
|
|
|
if $self->breadcrumbs; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
if ($span) { |
51
|
|
|
|
|
|
|
if ($result->code) { |
52
|
0
|
0
|
|
|
|
|
$span->set_http_status($result->code); |
53
|
0
|
0
|
|
|
|
|
} |
54
|
0
|
|
|
|
|
|
$span->finish(); |
55
|
|
|
|
|
|
|
} |
56
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
return $result; |
58
|
|
|
|
|
|
|
} |
59
|
0
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
} |
61
|
3
|
|
|
|
|
30
|
|
62
|
|
|
|
|
|
|
1; |