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